• 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: 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: 22094
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: 14017
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: 15715
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: 8028
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: 9523
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: 86724
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 ...

Creating ABAP type definition from JSON structure (JSON2ABAPtype)

Details
Łukasz Pęgiel
How to...
20 August 2018
Hits: 30226
Tags: /UI2/CL_JSON , JSON , JSON2ABAPtype

I'm playing lately with TFS web services in ABAP and as I'm lazy guy I wanted to make my life a bit easier while working with the JSON results.

There is already a nice class /UI2/CL_JSON available which can deserialize JSON and also it can generate a dynamic structure from JSON file but at the end to make programming easier you need to create local or global structure that will be matching the structure of JSON. 

Instead of spending time on creating manually all needed types, I've decided to create a small report that will do the work for me. Once done it will serve for long time.

The prerequisites for this program is to have class /UI2/CL_JSON in latest version that have a method GENERATE in the first place. On the server in which I was developing this program I had to implement two SAPNotes (2526405 ,2629179) in order to get correct results from the mentioned method. Once done the rest was quite easy.

 

Add a comment
Read more ...

How to extend the time between SAP license installations on NPL

Details
Łukasz Pęgiel
Tricks
03 August 2018
Hits: 5045
Tags: VIRTUALBOX , SLICENSE , SAP NPL

This time it will not be about ABAP but about the way how to extend the time between installation of new license for you NPL instance that is run using Virtualbox and OpenSuse. 

 

Normally it's not a big deal to instal the license, but if you don't use your instance for a while and in the meantime the license has expired, the before you can do anything you need to login to your instance with SAP* user and update the license in SLICENSE transaction. This sometimes makes me a bit nervous. That's why I've setup my installation this way, that the time between OpenSuse and Windows host is not synchronized. This makes that instead of 3 months between installing new license you can extend this time even to year or more. 

Below you can find the way and prerequisites that are needed to achieve this.

Add a comment
Read more ...

Retro ASCII symbols in ALV Grid table

Details
Łukasz Pęgiel
How to...
03 June 2018
Hits: 8493
Tags: CL_GUI_ALV_GRID , CL_GUI_DOCKING_CONTAINER , SYM

The ALV Grid hides inside itself possibility to use ASCII symbols. All you need to do is to mark the one of fields in field-catalog as symbol and then use constants defined in TYPE-POOL SYM in order to display one of them. The image bellow shows few of them, of course they are not that nice like the ICONS, there is also not many of them, but it's good to know that such symbols exists, although I so far I've not used them at work.

Add a comment
Read more ...

Create XLSX file from internal table in background v2

Details
Łukasz Pęgiel
Tricks
01 June 2018
Hits: 97306
Tags: CL_SALV_CONTROLLER_METADATA , CL_SALV_BS_LEX , CL_SALV_TABLE

You may saw before the article Create XLSX/MHTML file from internal table in background and you may have use it without any issues before, but it seems that in newer releases of SAP (definitelly >= 7.50) this way makes corrupted XLSX files. 

So I've rechecked again how it is done in ALV grid in the new NW releases and I've updated the code, so now the issue with corrupted file is solved.

The mothod is simplified as much as possible at the moment, at the end all you must pass to a method is your internal table, but you can also pass sorting, filter and layout criteria using ALV grid structures.

The definition of the method should look like this:

    class-methods: create_xlsx_from_itab
      importing
                it_fieldcat      type lvc_t_fcat optional
                it_sort          type lvc_t_sort optional
                it_filt          type lvc_t_filt optional
                is_layout        type lvc_s_layo optional
                it_hyperlinks    type lvc_t_hype optional
        value(itdata) type standard table

      returning value(r_xstring) type xstring.

Add a comment
Read more ...

CMD_EI_API deletes contact persons?

Details
Łukasz Pęgiel
Tips
13 August 2017
Hits: 20096
Tags: CMD_EI_API , Customer BAPI , CMD_EI_API_EXTRACT , CVIC_MAP_CONTACT

I'm big fan of CMD_EI_API and VMD_EI_API classes. I use them to create, update and delete customer and vendor master data, including contact persons, partners and all data you have in XD02/XK02 transaction. Also to update Z fields from all customer and vendor related tables. But lately after upgrade from 7.40 SP5 to 7.40 SP16 the method maintain_bapi was not saving the changes to the customers.

After a while I've found out that I have to call additionally the method update_modules and now the customer was saved.

Add a comment
Read more ...

ABAP Favorites Eclipse plugin

Details
Łukasz Pęgiel
How to...
29 June 2017
Hits: 16099
Tags: ECLIPSE , ADT , ABAP DEVELOPMENT TOOLS IN ECLIPSE , ECLIPSE PLUGIN , ABAP FAVORITES

1.Why I’ve created the plug-in?

 

I was always missing a small functionality in Eclipse - a Favourite SAP T-Codes which we all know form SAP Menu. I know to you can call SMEN transaction using Alt+F8 but it does not fill the simplicity requirement. That's why I started to ask about the possibility to have favourite T-Codes view somewhere in ADT in Eclipse. I rather thought that Thomas, the product owner of ADT would say that they will implement this in one of next releases, but instead he encourage me to do it myself.

 

At first glance it was like WOW I hate Java, why I should do it myself when for the other it would take only some minutes, but then after few minutes I thought that this could be a really good exercise for myself to try to do something completely new in a language that is not my main programming language, or better said an a language which I don't use if I don't have to.  

Thomas gave me some really good starting points by giving links to the blogs from SCN. Additionally I've started to search the web for the eclipse plug-in developments so I could get some more information about it. It was hard time for me, I've stopped this few times until I said, no this cannot be that hard. You're supposed to be a cleaver guy so small plug-in in Java should not be that hard..... 

Add a comment
Read more ...

More Articles ...

  1. SAP Script error with percentages using decimal field
  2. Speed up your coding with ABAP in Eclipse (SITWRO 2017 session)
  3. A new hope for dark side with Darkest Dark Theme for Eclipse
  4. Copying is not poss.because an entry is missing in Table TVCPL VL473
  5. Re-explode or delete purchase order line subcontracting BOM
  6. Deletion of subcontracting BOM in Purchase Requisition
  7. Re-explosion of subcontracting BOM in Purchase Requisition
  8. #SAPTechEd 2016 Barcelona
  9. SAP TechEd Developer Hero 2016
  10. How to handle CL_GUI_ALV_GRID events in SALV
Page 4 of 11
  • Start
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • Next
  • End


Łukasz Pęgiel
ABAP STRUCTDESCR GUI ALV GRID ZDEMO FALV13 - Mix demo own screen and container MEPO DOCUMENT POPUP TVCPL Scan program for authority-check ALV Grid in the nutshell Field catalog - emphasize ALV GRID Retro ASCII symbols in ALV Grid table SAPGUI PROGRESS INDICATOR CTMS DDB HAS VALUES INTERNAL ZIP REUSE FIELDCATALOG MERGE RELEASABLE Other checks on purchase requisition state ABAP HTML CHECKBOX ALV GRID IN THE NUTSHELL CMD API SELECTION-SCREEN FUNCTION KEY HTTP CLIENT ELEMDESCR IXML FIX COLUMN Field catalog - currency TOTEXP ABAP in Eclipse QM ATTACHMENTS FALV11 - Editable Grid settings MB51 DISPLAY SUM LOAD COMPLEX BOM ESRUO USER INFO GET CURRENT CELL EDIT MASK LOOP AT SCREEN AiE ADT dark theme settings LVC FCAT REFRESH TABLE SAP CONVERT CSV FORMAT EDITOR WITH STATUS SALV AGGREGATIONS Field catalog - exponent PARSER SET VALUE ZCL FALV COLUMN - column fcat settings Create a nice looking chart with CL CHART ENGINE - Part 3 - Chart Data and render VIDEO Field catalog - no convext SBCS SEND UPDATE TECH FALV12 - Error log REDISPATCH
  • 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.