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

ABAP – Change Documents example with Z-table

SAPIn this example I’ll follow on the theory of Change Documents presented in previous article (ABAP – Change Documents (theory)) and I’ll show how to create(or update an existing) Z-table where each modification will be logged into CDHRD and CDPOS tables Continue reading

ABAP – Change Documents (theory)

Data manipulation in SAP is done using standard documents such as Sales Orders, Purchase Orders, Vendor Invoices etc. Sometimes it’s necessary to make a change a document after it has been saved and created for the first time. From security point of view it is required/imperative that all such changes must be recorded by the system. For this purpose there is a standard functionality implemented in SAP system called “Change Documents” Continue reading