Dynpro – How to disable functions instead of hiding them in a screen

SAPIf you need to manipulate with a screen dynamically, sometimes you need to enable/disable some functions/buttons in the toolbar. Standard exclusion of function when setting PF-STATUS will by default hide the excluded functions. But what if you want to display them, but just in disabled state ? Continue reading

ALV – Dynpro controlled by a global class

SAPIn this article I’ll present an approach how to handle a screen with a global ABAP class. The idea is simple – we will create a class which will listen to PAI and PBO events raised by the screen. All data processing and screen element manipulation is done in the class code. Let’s check out how exactly it is done Continue reading

ABAP – cool program discovering all user exits for a TCode

SAPI believe all of you were searching for a list of available user exits that are triggered after a specific transaction code is executed. Here I’d like to present simple program, that will discover and display exactly that – list of available user exits for given TCode. Continue reading

ABAP – append a component to ITAB dynamically

SAPIt’s not a trivial thing to add new field into already existing itab during run time, but there is a way how to modify the ITAB strucuture. You can add, remove or modify order of the components (fields) in the itab.  Continue reading

ALV – Keep selection and scroll position after ALV refresh

SAPThere is an issue with ALV grid that if you refresh the grid being in edit mode using method REFRESH_TABLE_DISPLAY (in case you use CL_GUI_ALV_GRID) after you have changed some data, it may happen the cursor and/or scroll goes to the first (top left) cell of the grid. It might be a little confusing for user, but you can avoid this issue by using the following methods (and attached piece of code) Continue reading

ABAP – Fill BAPI structures from SAP table structures dynamically

SAPDue to fact that BAPI structures uses different field names than standard SAP tables I used to apply a trick I’m going to present in this article – map BAPI fileds to SAP fields in a Z-table and fill BAPI structures dynamically during runtime Continue reading

Test driven development in ABAP – Unit test classes

Test Driven Development using ABAP UnitThis article provides info about creation an ABAP unit test class that might significantly reduce the future maintenance cost at the testing level. The flow is simple – you design your functional tests in advance and then you create your code. You can run the test class repeatedly to tell you which tests still didn’t pass. Continue reading