SAP: scan ABAP programs
Useful little program that can help you scan other SAP programs RPR_ABAP_SOURCE_SCAN.
SAP: ABAP: Subroutine does not exist – bug
Scenario: you’re editing your code and when you try to double click on a previously defined subroutine you get a popup stating that it doesn’t exist. You check and confirm that the subroutine is included, the report compiles and runs properly.
Resolution: to fix the problem do the following steps:
- Click Utilities
- Click Update Navigation Index
The report will be regenerated and your problem should be solved.
ABAP: how to switch to a classic screen painter [4.6C]
Simple: select Utilities and navigate to the Screen Painter tab. There you will see a check box corresponding to the desired action.
SAP: transport classes
If you know how to transport copies of objects then you are half way there. So a quick and easy way to figure out what to put in to your transport [Change Object List] perform the following steps:
- go to SE24
- type in your class name
- click Goto – Object Directory Entry
At this point you should see your object definition entries: R3TR – CLAS – <CLASS NAME>. Grab that and move your transport.
SAP: Generating a Class Actor – CREATE_PERSISTENT
Been playing with the persistent objects and finally figured a part that involves generating a CREATE_PERSISTENT method in the Base agent class.
To do this
- Go to Persistence Representation

- Select Utilities – Generate – Class Agent – Class
- Click the Yes button
That’s all.
SAP: logging table changes
When a table is configured there is an option to log the changes that are done to the information.
You can then check who mad the changes and when the change took place by running report RSVTPROT.
ABAP: check if a function module exists programmatically
If you need to check if a function module within your program try running the following function: RH_FUNCTION_EXIST.
SAP tp: return codes
For each step that takes place within the tp command there could be 8 different possible return codes [0, 4, 6, 8, 12, 13, 14, 16]. The meaning for each of those codes is as follows:
Transport imported successfully:
0: Transport successful
4: Warning occurred
Transport did not import successfully:
6: Post-processing is required
8: Transport carried out with an error [individual object could not be transported successfully]
ex: objects could not be overwritten
Transport termination:
12 and greater: transport was terminated
SAP: throw validation message on a webDynpro screen
Here’s some code that would allow you to throw a exception message [say for validating purposes].
data: lr_api_controller type ref to if_wd_controller, lr_message_manager type ref to if_wd_message_manager.
lr_api_controller ?= wd_this->wd_get_api( ). lr_message_manager = lr_api_controller->get_message_manager( ). lr_message_manager->report_error_message( message_text = '!!!some message!!!' ).
Alternatively mark certain fields with ‘required’ state and run the following code.
data lo_api_controller type ref to if_wd_view_controller. lo_api_controller = wd_this->wd_get_api( ). cl_wd_dynamic_tool=>check_mandatory_attr_on_view( view_controller = lo_api_controller ).
SAP – ABAP – gui – hiding selection components
If you want to make your reports more functional you can start controling the properties of different components based on selections that are performed by the user.
For instance in this post I’ll show you a quick example of how to hide a on-screen component based on user selection.
PARAMETER: cb_a AS CHECKBOX DEFAULT 'X'
USER-COMMAND batch MODIF ID ida,
cb_bAS CHECKBOX DEFAULT 'X'
USER-COMMAND batch MODIF ID idb.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'IDA' AND cb_b NE 'X'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'IDB' AND cb_a NE 'X'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
This example will hide each of the check boxes depending on the selection of the other check-box. If both are selected then both are visible, if one is un-checked then the other is hidden.
The active attribute controls the visibility of a particular screen component. Explicitly: 0 = hidden, 1 = visible.
