• Home
  • About me
  • FALV
  • ALV Grid in the nutshell
    • Basic Information
    • Field catalog
  • Articles
    • Tricks
    • FALV (Fast ALV Grid)
    • ALV Grid in the nutshell
    • Tips
    • How to...
    • For beginners
    • Thoughts
  • By Topic
    • ALV
    • ALV OO
    • SALV
    • GOS
    • Selection screen
    • Purchase Requisitions
    • Purchase Orders
    • Attachments
    • Others
    • Characteristics
    • Sample Programs
    • ZIP
    • OLE
    • Mails
    • Routings
    • EWB
    • Excel
  • Keywords
  • RSS
  • Download
  • Home

ALV Grid in the nutshell: Field catalog - symbol

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 3251
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , SYMBOL , ALV GRID

This field has similar functionality like ICON but instead of better looking icons, you can choose to display old-style ASCII symbols from type-pool SYM. Like in an example of ICON you have to setup the fieldcatalog value for field SYMBOL to ‘X’ and in the corresponding field of your internal table, you have put the value of the symbol. The corresponding field should be CHAR1 field.

 

Figure 39 ZDEMO_AIN_CL17 ALV with symbols

 

You can check the available symbols on your system, but I doubt they vary between old and new releases.

Figure 40 Possible symbols in ALV Grid

 


 

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - icon

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 17158
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , ICON , ALV GRID

If you want to display an icon inside the cell, then you need to setup a value of this field to ‘X’ and additionally you need to put an icon from type-pool ICON into the corresponding field of your internal table. The corresponding field should be an CHAR4 field. You can use of course the domain ICON_D as well. In my example I’ve filled all rows with the same icon (ICON_ABAP) during the selection of data into internal table, but in productive programs, you’ll probably do this during the loop over internal table, as probably you’ll want to setup different icons for a row, depending on the content of other field.

 


Figure 36 ZDEMO_AIN_CL16 Select with ICON_ABAP

 

Figure 37 ZDEMO_AIN_CL16 Results with ICON

To visualize all available icons, it’s enough to go to SE16 or SE16N and display the content of a table ICON. You’ll see then how icons looks in your current SAP GUI theme.

 

Figure 38 Content of ICON table

 


 

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - checkbox

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 13636
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , CHECKBOX , ALV GRID

The name of this field says almost everything about it. If you put an ‘X’ in it, then the column will be displayed as checkbox. The type of the field which is used as checkbox should be set to ABAP_BOOL or any other CHAR(1) type.

If you use editable grid then once the checkbox is checked, the cell of the table behind it will be filled with value ‘X’.

 


Figure 41 ZDEMO_AIN_CL18 Checkbox on editable grid

 


 

 

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - just

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 6888
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , JUST , ALV GRID

With this field, you can setup alignment of the column. You can use one of the following values:

  • R - Right,
  • L - Left,
  • C - Centre,
  • space – default setting for field type

 

 

Figure 42 ZDEMO_AIN_CL19 Fieldcatalog with alignment

As you can see the columns are using the settings from fieldcatalog correctly.

Figure 43 ZDEMO_AIN_CL19 Results

 


 

 

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - lzero

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 6815
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , LZERO , ALV GRID

This field allows manipulation of visibility of leading zeros. One of the most common example is the material number (MATNR), when there is no letter inside the name of material, it is stored in database with leading zeros. For example material 101 would is stored as 000000000000000101 in ECC and 0000000000000000000000000000000000000101 in S/4 HANA. In order to not display this not needed zeros, you can setup LZERO to ‘X’.

 

Figure 44 ZDEMO_AIN_CL20 With leading zeros

 

Figure 45 ZDEMO_AIN_CL20 Without leading zeros

 


 

 

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog - no_sign

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 4022
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , NO_SIGN , ALV GRID

NO_SIGN can be used to hide the sign of the number. For example you have negative values but you want to display it as positive.

In order to show you the behaviour of this settings, I’ve manipulated the distance of the flight in the demo program by multiplying it by -1.

 

Figure 46 ZDEMO_AIN_CL21 Select

 

Figure 47 ZDEMO_AIN_CL21 Without NO_SIGN option

 

Figure 48 ZDEMO_AIN_CL21 With NO_SIGN option

 


 

 

Add a comment
Read more ...

ALV Grid in the nutshell: Field catalog

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 36489
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , FIELDCATALOG , LVC_T_FCAT , ALV GRID

Field catalog is one of most important tables that is used in ALV Grid. In most cases you’ll create it manually or at least after automatic creation, you’ll update its content, as most of the columns settings are placed here. ALV Grid field catalog should have type LVC_T_FCAT. Of course as it’s not mandatory parameter you can also omit during the displaying on grid (like I did for example in program ZDEMO_AIN_CL01), but this is only allowed if the table you would like to display is of type that is kept in dictionary. In other case, you’ll be forced to create the field catalog and pass it as parameter to SET_TABLE_FOR_FIRST_DISPLAY method.

In table below you’ll find the list of all fields used in field catalog with its dictionary type and description. Some of the fields are quite simple to explain, some are harder, but bellow you’ll find description of all of them, whenever it was possible by me to check their behaviour. Click on the link on the field name (if exists) to get the deeper description and example of usage.

Add a comment
Read more ...

ALV Grid in the nutshell

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 24612
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , ALV GRID

I was thinking about writing a book about ALV Grid for a long time, but there was always an excuse to not to do it. One of the biggest was that SAP is now strongly advertising Fiori and UI5 as the next generation of UI in SAP world and I was thinking about when SAP will kill old ALVs. This so far didn’t happened and as there are dozens of ABAP developers who still creates reports and transactions inside the ERP systems using the good old ALV Grid, I’ve decided to finally do it. Personally I don’t see how expert users could easily switch to Fiori or UI5 apps, especially that I haven’t seen so far an editable grid or table there. But maybe I’m just blind. 

Personally I’d prefer that SAP would create new controls that would look like the one you can get in every Windows or iOS applications, which you can easily add via drag & drop in screen editor. But probably this will not happen soon, maybe even never. That’s why it’s really important to get an idea what you can do with the controls that are already available in SAP. In this tutorial I will try to show you what you can do with ALV Grid. If possible I will give you an example for each functionality, so you could really understand it easily. It will not be a story, it will be a journey through the good old ABAP days. It will not be easy to read, as this will be in most parts a technical description of possibilities that ALV Grid gives you, but I hope it will help you in your daily job. 

Add a comment
Read more ...

ALV Grid in the nutshell: Basic Information

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 40440
Tags: CL_GUI_ALV_GRID , ALV GRID IN THE NUTSHELL , HOW TO START WITH ALV , ALV GRID

​​​​​​ I wrote in previous post, you can’t use this class directly without any effort. First of all, the class itself will not display anything if you’ll not create a container for it. The following containers can be used:

  • Custom container
  • Splitter container
  • Docking container
  • Dialogbox container

 

1. Custom container

Custom container can be created with a class CL_GUI_CUSTOM_CONTAINER, but it needs a parent container in which it could be placed or it needs an custom control area to be created in custom screen . This solution is mainly used by me in the applications I develop now. But it’s also common that you’ll mix custom containers with other in one development.

Many persons creates the custom container during the PBO event of the screen that contains custom container area, but you don’t have to do that. You can create it also before calling the screen, like in the simple example of using CL_GUI_CUSTOM_CONTAINER that you can find in Figure 1 and in demo program ZDEMO_AIN_CL01.

Don’t try to find anything in this program, that was not needed just to quickly display the data on the grid. There is no GUI Status, there is no PBO and PAI handling. I did it on purpose just to create really simple example. (As you may read it the abapGit version can differ from here)

 

Figure 1 ZDEMO_AIN_CL01 example of using CL_GUI_CUSTOM_CONTAINER

 

Of course in order to be able to display the grid I had to create a SCREEN 0100 which contains custom container area named CC which you can find in Figure 2. The only additional setting for the screen I did was to setup its size to 200 x 255 and I have given the area possibility to resize vertically and horizontally, so it will fit to all screens. 

Add a comment
Read more ...

ZCL_CMD_CUSTOMER -> Wrapper for CMD_EI_API classes

Details
Łukasz Pęgiel
How to...
06 June 2019
Hits: 22093
Tags: CMD_EI_API , CMD_EI_API_EXTRACT , ZCL_CMD_CUSTOMER

If you know CMD_EI_API class, you are aware of its power. It's very helpful for the manipulation of customer master data, all master data including contacts. I have played with this class many times and although I got use to the structure of it, I thought one day that it would be handy to have a wrapper or framework to use it. So I've started to build it.

As a result I have now more handy (but not perfect) class to handle the creation or update of customer master data with CMD_EI_API=>MAINTAIN_BAPI method.

The whole source code is available as current version on Github, from where you can instal this class (and all supporting ones) with abapGit https://github.com/fidley/Customers. 

As there is no much documentation about this class yet, I will extend this article in future with more details, for now just the basics information how to start with it. 

Add a comment
Read more ...

SAP Fiori - HTTP request failed403,,CSRF token validation failed

Details
Łukasz Pęgiel
How to...
06 June 2019
Hits: 14014
Tags: FIORI , CSRF Token , SAP WebIDE

I've started some time ago a journey with SAP Fiori and first Fiori apps. It was not that smooth as I've expected, but now with experience received during that period I feel more and more comfortable with it. That's why when I've heard that I need to create an simple app in Fiori to create new incident in our helpdesk system. 

 

Normally it looks very simple both from backend and UI point of view, but the issue was that I had to make the possible to use the app without the logon to SAP.

SSO is not possible yet in my company so I've setup the SICF node of the application to use specific credentials for logon, and here the surprise started :) 

 HTTP request failed403,,CSRF token validation failed error appear when I was calling oModel.create method......

Add a comment
Read more ...

ABAP Code Retreat Tychy 2019 - Organizer Recap

Details
Łukasz Pęgiel
Thoughts
02 April 2019
Hits: 3986
Tags: ABAP Code Retreat , ACR , acrTYC , SAP Community Events

This year I've organized ABAP Code Retreat in Tychy for the second time. In this recap I want not only tell you about the event itself, but also about how the whole organisation of the event took place. If you'll read it to the end, you'll notice that it is not that hard :) 

I've organized one such event before in 2017, when Christian Drumm was leading the whole event. I was very satisfied that 16 from 24 registered participants, so my expectations were that this time it will be more persons. I aslo knew exactly how much food and drinks I need for the event, what path of organisation to follow, but if you want to organize such event, then I'll point all needs and steps, so you can see if maybe you can organize such event also.

Add a comment
Read more ...

Selection-Screen Function Key in Form, Function Module or Method

Details
Łukasz Pęgiel
Tricks
21 November 2018
Hits: 15714
Tags: SELECTION-SCREEN FUNCTION KEY , RSDBRUNT

Have you received someday an error from your ABAP object saying that "The statement SELECTION-SCREEN is not allowed within FORM routines and function modules." and you wondered why it is blocked to manipulate the five custom function codes on selection-screen? Well, definitely I have and it was really annoying as I wanted to be able to dynamically assign the slection-screen function key depending if it's already used by program or not.

 

To make long story short - I was correcting one day an old-style written code to include two additional function keys on selection-screen, which were "Favorite variants" and "Clear All fields". They are quite useful but you always had to attach an include(s) to your program and then call specific forms from it. One of the include contained the lines with statements SELECTION-SCREEN FUNCTION KEY 1 & 2, the other defnition for TABLES: sscrfields. I've move the logic to class instead of includes so I could get rid of the need of having them in the programs but I couldn't do anything with this statement as it's not possible to use it within the method. So I've let this statement to be added manually always while using the "Favorite" and "Clear All Fields" function.

Few days ago I've started to work on the created class again while users wants the favorite function to be extended, so after some refactoring and cleaning of my old bad programming, I've decided to check again if there is no really possibility to show or hide the function key on the selection-screen dynamically from method call. 

 

I knew already that whenever you handle selection-screen then program RSDBRUNT is called which is manipulating the output of the selection screen and also the GUI status. 

After some debugging I found interesting global variables there: CURRENT_SCREEN and CURRENT_SCR. 

CURRENT_SCREEN contained the information about active function keys and CURRENT_SCR together with lots other information - the table which is used to exclude function codes from GUI Status.

Add a comment
Read more ...

Unlock yourself on the DEV system

Details
Łukasz Pęgiel
Tricks
15 November 2018
Hits: 8027
Tags: ABAP4_CALL_TRANSACTION , CL_IDENTITY

This is funny story, I tend to lock myself many times on the DEV system because of the wrong typing of the password. Mainly it happened when I switch the layout of the keyboard in Windows from Polish to German.

Normally it would not be a problem to ask your colleagues which is sitting next to you, to unlock your user, but because of the company policy, we cannot manage other IT colleagues accounts in SAP. So I was asking always Basis team to unlock me, but as I do it often, then I said to myself, that there need to be an option to unlock myself without bothering my Basis colleagues.

And there is one.

But there are two prerequisites - you need to have access to other system that has trusted RFC connection to the DEV system and you have to have debugging rights with possibility to make changes during debugging. In most cases I think this is standard for developer :)

 

OK, so here are the steps:

1. On system to which you have access go to SE37/SE80 and run ABAP4_CALL_TRANSACTION FM with proper RFC target of your DEV system and transaction SU01.

Add a comment
Read more ...

More Articles ...

  1. Speed-up your Eclipse installation
  2. ATC Pseudo Comments list
  3. Creating ABAP type definition from JSON structure (JSON2ABAPtype)
  4. How to extend the time between SAP license installations on NPL
  5. Retro ASCII symbols in ALV Grid table
  6. Create XLSX file from internal table in background v2
  7. CMD_EI_API deletes contact persons?
  8. ABAP Favorites Eclipse plugin
  9. SAP Script error with percentages using decimal field
  10. Speed up your coding with ABAP in Eclipse (SITWRO 2017 session)
Page 3 of 11
  • Start
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • Next
  • End


Łukasz Pęgiel
ZCL TOOLTIP GUI STATUS ALV GRID BATTLESHIPS ESRUO - MM settings table - Part 1 DELETE USER OBJECTS BINARY RELATION CREATE COMMIT REFRESH FROM SELECTOPTIONS REUSE ALV VARIANT SAP TechEd GRID FRIEND GUI ECLIPSE LVC FCAT SAP DEVELOPMENT TOOLS FOR ECLIPSE RSBCS EXAMPLE EMAIL SIMPLE FIELDCATALOG ALV Grid in the nutshell QUANTITY ALV GRID IN THE NUTSHELL ICON PRETTY PRINTER GET DDIC FIELD LIST BAPI CLASS READ Field catalog - dfieldname Fieldname for column group ABAP ZIP AiE ROUND SCMS STRING XSTRING ADT CURRENT CELL QM ATTACHMENTS OUTB DELIVERY CREATENOREF HEADER HANDLE MM- GTGET GOS MANAGER SALV AGGREGATIONS ESRUO MAT BOM COPY APPEND MTK ZDEMO FALV05 - Adding Removing Disabling grid toolbar MS OUTLOOK TSK SYNTAX-CHECK How to handle CL GRID events in SALV VRM SET VALUES FRONTEND SERVICES EXECUTE FALV COLUMN - column fcat settings SAP TechEd 2016 Field catalog - quantity COM PROGRESS INDICATOR Mass replace popup for ALV grid
  • Laserowe usuwanie blizn Tychy
  • Laserowe usuwanie zmarszczek Tychy
  • Salon Kosmetyczny Tychy
  • Trycholog Tychy
  • Wypadanie włosów Tychy
Tweets by abapblog

Eclipse Plugins for ABAP

ABAP Favorites

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

ABAP ADT Extensions

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

ABAP Quick Fixes

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

 

Latest Articles

  • ABAP in Eclipse - Install, Configure, Use, and Enhance Your ADT
  • ALV Grid in the nutshell: Field catalog - col_id - ALV control: Column ID
  • ALV Grid in the nutshell: Field catalog - dfieldname – Fieldname for column group
  • ALV Grid in the nutshell: Field catalog - Hotspot - ALV control: SingleClick-sensitive
  • ALV Grid in the nutshell: Field catalog - sp_group - Group key
  • ALV Grid in the nutshell: Field catalog - domname - Domain name
  • ALV Grid in the nutshell: Field catalog - reprep - ALV control: Value is selection criterion for rep./rep.intf.
  • ALV Grid in the nutshell: Field catalog - reptext – Heading
  • ALV Grid in the nutshell: Field catalog - lowercase - Lowercase letters allowed/not allowed
  • ALV Grid in the nutshell: Field catalog - intlen - Internal Length in Bytes
  • Downloading Exchange Rates from NBP (National Bank of Poland)
  • Downloading Exchange Rates from Central Bank of Turkey
  • ABAP Extensions - Automatic Logon
  • ALV Grid in the nutshell: Field catalog - inttype - ABAP data type (C,D,N,...)
  • ALV Grid in the nutshell: Field catalog - datatype

Most Read

  • Create XLSX/MHTML file from internal table in background
  • Refresh ALV GRID and keep position and current cell
  • Create XLSX file from internal table in background v2
  • FALV (Fast ALV Grid)
  • ATC Pseudo Comments list
  • Call standard F4 search help with customized parameters
  • Dynamic GUI STATUS & TITLE with ABAP code
  • Create fieldcatalog from internal table
  • Link Attachments of Purchase Requisition to Purchase Order
  • GOS - How to add business documents at creation of object
  • Endless loop in BADI ME_PROCESS_PO_CUST
  • Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 3 - Chart Data and render
  • How to access private or protected data and methods of CL_GUI_ALV_GRID
  • Subtotal lines of ALV GRID OO as content separator
  • Popup with multi-select ALV
feed-image Feed Entries

Latest Comments

ABAP code and articles provided on http://abapblog.com, if it is not statet otherwise, were created by Łukasz Pęgiel. You can use the code in your SAP instance for commercial and non-commercial use without any warranty from side of the author. You cannot sell the code as a full program or a part of it.
Replicating of the articles and code is prohibited unless the agreement of the author is given to you. 

Bootstrap is a front-end framework of Twitter, Inc. Code licensed under MIT License. Font Awesome font licensed under SIL OFL 1.1.