• 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 - checkbox

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 9470
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

ALV Grid in the nutshell: Field catalog - just

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 3554
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

ALV Grid in the nutshell: Field catalog - lzero

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 3897
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

ALV Grid in the nutshell: Field catalog - no_sign

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 1991
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

ALV Grid in the nutshell: Field catalog

Details
Łukasz Pęgiel
ALV Grid in the nutshell
24 June 2019
Hits: 24462
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: 14796
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: 25237
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: 15415
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: 9680
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: 2766
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: 10757
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: 6003
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 ...

Speed-up your Eclipse installation

Details
Łukasz Pęgiel
How to...
15 November 2018
Hits: 7327
Tags: ECLIPSE , ADT , ABAP IN ECLIPSE

I was many times disappointed about the time Eclipse needs to start, but I thought that's the way it should be, especially that my previous PCs were not the fastest one and with small amount of RAM-memory. I was cleaning the installations each time I was installing new version of IDE by removing not needed plug-ins, especially that I'm working in Eclipse mainly with ABAP and ADT tools. But even if the installation looks quite clean, still on my new PC which has lots of RAM and very nice processor the starting time of Eclipse was horrible. Also sometimes I've felt that the performance of the editor is not the best ( even if the connection to SAP backend was fast).

Add a comment
Read more ...

ATC Pseudo Comments list

Details
Łukasz Pęgiel
Tips
26 September 2018
Hits: 55059
Tags: ATC , PSEUDO COMMENTS , #EC , PRAGMA , ABAP TEST COCKPIT , SLIN

I was implementing ATC checks in the company I work for and wanted to find the place where the information about possible pseudo comments are stored. 

In transaction ATC I could find them in the management of priorities for check variants, but I couldn't find corresponding DB table. Seems that they are stored directly in the checks that's why after some debugging I've setup a break-point in the SCI transaction and then I've collected all the checks that have assigned pseudo comments. The version of NW that I was extracting pseudo comments from is 7.52 SP02.

Now you can also use this information as I've attached the whole table bellow, hopefully it will help you to find the correct pseudo comment if the code cannot be adjusted in your opinion.

Add a comment
Read more ...

More Articles ...

  1. Creating ABAP type definition from JSON structure (JSON2ABAPtype)
  2. How to extend the time between SAP license installations on NPL
  3. Retro ASCII symbols in ALV Grid table
  4. Create XLSX file from internal table in background v2
  5. CMD_EI_API deletes contact persons?
  6. ABAP Favorites Eclipse plugin
  7. SAP Script error with percentages using decimal field
  8. Speed up your coding with ABAP in Eclipse (SITWRO 2017 session)
  9. A new hope for dark side with Darkest Dark Theme for Eclipse
  10. Copying is not poss.because an entry is missing in Table TVCPL VL473
Page 4 of 11
  • Start
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • Next
  • End
Łukasz Pęgiel
SALV TABLE FIELDCATALOG ALV GRID FALV AiE ADT dark theme settings LVC FCAT CVAPI DOC CHECKOUTVIEW CTMS DDB SET VALUE ONLINE KEY INIT ALV GRID IN THE NUTSHELL CREATE COM Create fieldcatalog from internal table SAVE USER OBJECTS GUI ALV GRID TOOLTIP RESET REJ ALLOWED TVCPLAP OUTLOOK APPLICATION CSRF token validation failed ROUND RECEIVE RESULTS FROM FUNCTION COMPONENTS MAINTAIN ESDUS EXTEND PROGRAM RUNTIME Convert date to and from external date type DARKEST DARK THEME ECLIPSE ZCL CMD CUSTOMER POPUP EXTENSION COC1 FEATURE CHECK MAT BOM COPY GOS MANAGER CHART ENGINE LAYOUT - layout settings SERVICE TOOLS GTMOVE LINKED MB51 ZERO By Topic ICON APPEND SETTINGS OPR ALLOCATION PROVIDE and Enhance Your ADT VAL FROM OBJECT GUI HTML EDITOR ABAP Extensions - Automatic Logon BCS MESSAGE ABAP IXML DOCUMENT DYNAMIC STATUS - for full screen or popup ALV Grid in the nutshell Field catalog - col id - ALV control Column ID LOAD COMPLEX UTIL EWB Components allocation to routing operation multilevel BOM Field catalog Creating editor for dynamic code
  • Laserowe usuwanie blizn Tychy
  • Laserowe usuwanie zmarszczek Tychy
  • Paznokcie hybrydowe Tychy
  • Paznokcie tytanowe 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
  • FALV (Fast ALV Grid)
  • Call standard F4 search help with customized parameters
  • Dynamic GUI STATUS & TITLE with ABAP code
  • Create XLSX file from internal table in background v2
  • ATC Pseudo Comments list
  • Create fieldcatalog from internal table
  • Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 3 - Chart Data and render
  • 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
  • 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.