• 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

Creating ABAP type definition from JSON structure (JSON2ABAPtype)

Details
Łukasz Pęgiel
How to...
20 August 2018
Hits: 22794
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: 4035
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: 6545
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: 64575
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: 14082
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: 12035
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 ...

SAP Script error with percentages using decimal field

Details
Łukasz Pęgiel
Tips
03 June 2017
Hits: 7235
Tags: SAP SCRIPT , PRINTOUTS

If you would ask me if I would write something about SAP Script then I would definitely answer "Hell no!". I hate SAP Script to be honest, it has for me only one advantage - speed of printout if you compare it to Adobe Forms, but the rest for me..... is against.

 

Today I faces a really strange behaviour of one of the invoice printouts, one of the fields which was showing the tax percentage, was showing wrong value if the print program was called for the second time.

 

The first output was OK, 8,00 % as value.

 

 

 

But when I directly show again the preview of the same invoice then, the value was changed to 0,80 %.

 

Add a comment
Read more ...

Speed up your coding with ABAP in Eclipse (SITWRO 2017 session)

Details
Łukasz Pęgiel
How to...
28 May 2017
Hits: 6104

Bellow you can find the record of my session "Speed up your coding with ABAP in Eclipse"  at SAP Inside Track Wrocław 2017, which took place on 27th of May. During the session I was not able to cover whole topic although the session last 10 minutes longer than it should be, as I received lots of question during the session. 

I haven't watched whole video, I just checked if the voice was recorded correctly, so in case any problems with the video, please let me know.

Cheers
Łukasz

Add a comment

A new hope for dark side with Darkest Dark Theme for Eclipse

Details
Łukasz Pęgiel
How to...
27 February 2017
Hits: 14406
Tags: ECLIPSE , AiE , DARK THEME , ABAP IN ECLIPSE , ADT , ABAP DEVELOPMENTS TOOLS , SAP DEVELOPMENT TOOLS FOR ECLIPSE , DARKEST DARK THEME

Dark theme is available in Eclipse since a long time, but there were many problems with easy setting of all colors in editors, windows and popups.

Sometimes you had to even adjust your system settings to be able to adjust some colors.

This discouraged many persons to switch to the dark side of eclipse.

But now there is a new hope for it! 

Darkest Dark Theme by Genuitec which can be found in eclipse marketplace hits the spot here. It's not only changing the background colors of editors and windows, but it's adjusting the color settings for fonts, it changes a lot of standard icons and the display of many elements of eclipse.

Personally I didn't like the color settings for ABAP, so I've used my old files which you can find in this article AiE (ADT) dark theme settings, but this is my personal opinion, so for you the default settings may looks ok. There is also one big added value for Darkest Dark Theme: during installation you get also icon editor which can be used to customise all icons in eclipse! Your changes after synchronisation with Genuitec accounts can be used as a default settings for Darkest Dark theme (of course they must be accepted by moderator firstly).

So how does it looks like now?

You'll spot the change directly on logon screen, where there is no white/grey background places anymore.

Add a comment
Read more ...

Copying is not poss.because an entry is missing in Table TVCPL VL473

Details
Łukasz Pęgiel
How to...
15 February 2017
Hits: 21580
Tags: BAPI_OUTB_DELIVERY_CREATENOREF , VL473 , TVCPL , V_TVCPLAK , V_TVCPLAP

This time the problem which I solved was not an ABAP problem, although at the beginning I thought it is, as while creating of deliveries without reference in standard transaction were done correctly without any issues, then when I tried to do it in ABAP, I always received the error VL473 - Copying is not poss.because an entry is missing in Table TVCPL. 

I thought that this is some kind of nonsense as with standard t-code it was working correctly, so I tried several FM to create deliveries without reference but always with the same result as you can see on picture bellow. 

Then I did what I should do from beginning. I used where used function to display where TVCPL table is used and I found two views V_TVCPLAK and V_TVCPLAP.

Add a comment
Read more ...

Re-explode or delete purchase order line subcontracting BOM

Details
Łukasz Pęgiel
Tricks
04 February 2017
Hits: 11029
Tags: ME_COMPONENTS_MAINTAIN , ME_COMPONENTS_UPDATE_PREPARE , CL_PO_HEADER_HANDLE_MM , IF_PURCHASE_ORDER_MM , ME_COMPONENTS_REFRESH , MEREQS_EBAN_LOOKUP , ME_COMP_REQUIREMENT_DATE
To continue previous two posts about re-exploding and deleting subcontracting BOM of purchase requisition item, let me describe you how to do the same thing with subcontracting BOM of purchase order line.
 
The main part is again to use FM ME_COMPONENTS_MAINTAIN and ME_COMPONENTS_UPDATE_PREPARE , but this time there is no easy way to fill MDPA and MDLB structures which are needed here.
So I had to use CL_PO_HEADER_HANDLE_MM and IF_PURCHASE_ORDER_MM to fetch all data from purchase order and to move them to MDPA and MDLB structures. Once it was ready the rest was peanuts and I could get rid of using this two buttons :-)
 
 
Add a comment
Read more ...

Deletion of subcontracting BOM in Purchase Requisition

Details
Łukasz Pęgiel
Tricks
03 February 2017
Hits: 7920
Tags: ME_COMPONENTS_UPDATE_PREPARE , ME_COMPONENTS_MAINTAIN , IF_PURCHASE_REQUISITION , IF_BOM_MM , ME_COMPONENTS_REFRESH , ME_FILL_MDPA_FROM_EBAN , ME_FILL_MDLB_FROM_EBAN , CL_MESSAGE_HANDLER_MM
In previous post I've shown how to re-explode subcontracting components of purchase requisition using FM ME_COMPONENTS_MAINTAIN and ME_COMPONENTS_UPDATE_PREPARE . Using very similar code you can delete completly it's BOM. 
 
You may wonder why would need to delete subcontracting BOM? This is not possible in standard transaction ME52N and in most cases it makes no sense to have the subcontracting item without BOM. But in the case that you don't want that components are taken into consideration by MRP until you really need this then it could be helpful.
 
The code is 99% same like during the re-exploding the BOM, the difference is that FM ME_COMPONENTS_MAINTAIN is called with parameter i_vorga = 'D'  and message check at the end is bit different.
Add a comment
Read more ...

Re-explosion of subcontracting BOM in Purchase Requisition

Details
Łukasz Pęgiel
Tricks
02 February 2017
Hits: 10943
Tags: ME_COMPONENTS_UPDATE_PREPARE , ME_COMPONENTS_MAINTAIN , IF_PURCHASE_REQUISITION , IF_BOM_MM , ME_COMPONENTS_REFRESH , ME_FILL_MDPA_FROM_EBAN , ME_FILL_MDLB_FROM_EBAN , CL_MESSAGE_HANDLER_MM
I faced lately a small issue in one of the process in our company, I needed to re-explode the BOM of subcontracting item in purchase requisition. Normally users goes to ME52N and press "Explode BOM" button, but I needed to do this from ABAP side. 
 
I started with IF_PURCHASE_REQUISITION but although there is a method "explode_bom" for item, then it was calling the screen with the results instead of selecting and updating components in the database. IF_BOM_MM didn't helped as well.
 
I started to dig in the standard transactions and local classes of ME52N and finally I have figure out how to do this in backgroud. The solution was to run FM ME_COMPONENTS_MAINTAIN and ME_COMPONENTS_UPDATE_PREPARE in correct way together with message handler to not interrupt whole process.
Add a comment
Read more ...

#SAPTechEd 2016 Barcelona

Details
Łukasz Pęgiel
Thoughts
10 November 2016
Hits: 5750
Tags: SAP TechEd , SAP TechEd 2016 , TechEd
Hola!
although I'm still in Barcelona and the event just finished, I'd like to share with you some first thoughts I have about SAP TechEd 2016 event.
 
 
Add a comment
Read more ...

More Articles ...

  1. SAP TechEd Developer Hero 2016
  2. How to handle CL_GUI_ALV_GRID events in SALV
  3. Why I like to code in ABAP in Eclipse
  4. How to access private or protected data and methods of CL_GUI_ALV_GRID
  5. Send mail in BADI or User-Exit without commiting
  6. WYSIWYG HTML Editor in ABAP
  7. FALV (Fast ALV Grid)
  8. FALV (Fast ALV Grid) - First blood
  9. How to teach ABAP ???
  10. How to copy BOM using CEWB Function Modules
Page 5 of 11
  • Start
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • Next
  • End
Łukasz Pęgiel
SYNTAX-CHECK ALV Grid in the nutshell Field catalog - outputlen JSON2ABAPtype MEREQ GET FACTORY GUI ALV GRID ALV GRID IN THE NUTSHELL Downloading Exchange Rates from NBP National Bank of Poland OUTPUTLEN COC1 FEATURE CHECK SE41 ALV GRID ABAP Extensions - Automatic Logon REUSE DISPLAY LVC FCAT PERIOD AND DATE CONVERT OUTPUT FRONTEND FIELDCATALOG APPEND USER SETTINGS MB51 FALV MAT BOM CREATE COPY SAVE ABAP ZIP Create a nice looking chart with CL CHART ENGINE - Part 3 - Chart Data and render ABAP Code Retreat Field catalog - datatype TRANSFER SLIS Popup with multi-select ALV RM07DOCS CMD API EXTRACT SAPGUI PROGRESS INDICATOR INTLEN VIDEO DDIC FIELD LIST ENGINE SLIN PURCHASE REQUISITION Convert date to and from external date type SBCS SEND ITM PROVIDE Field catalog - no sum SALV CONTROLLER METADATA REFRESH FROM SELECTOPTIONS BAPI EXCHANGERATE OBJECTS SET CURRENT CELL VIA PATH PROCESS CUST BCS AGGREGATIONS HOW TO START WITH ALV IFIELDNAME COMPONENTS ABAP TEST COCKPIT DFIELDNANE Why I like to code in ABAP in Eclipse FIELDNAME LOOP AT SCREEN
  • 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.