How to Copy SAP Variants of ABAP Reports Using RS_COPY_SELECTION_SETS Function Module
ABAP developers may require to copy ABAP reports in order to create new ABAP programs for additional functions in SAP system according to users requests. At this point it is ABAP developers responsibility to copy variants of SAP users, or copy SAP variant configuration created for the original SAP report to the new SAP program. In this tutorial, I will try to show how SAP developers can copy variants from one ABAP report to another using rs_copy_selection_sets function module.
When the ABAP report is executed, as seen on the parameters screen there is no SAP variants saved for this ABAP program. We need to copy SAP report variants of this ABAP report from an other ABAP report to this program.
Run the transaction code SE37. The tcode SE37 will enable SAP users execute functional modules.
Using the transaction code SE37 screen, ABAP developers can run rs_copy_selection_sets function module using F8.
Here is the ABAP function module rs_copy_selection_sets initial screen. This is an ABAP save variant function we will use to copy SAP variants. You can see the parameters on the below screen.
Write the source ABAP report name, in source_report input area. Here we define the source of the ABAP variants we want to copy from.
Then write the target ABAP report name in target_report input area. Using this parameter we define the ABAP program where we want to create a copy of the variants.
Then run function module rs_copy_selection_sets using F8 shortcut.
After the execution of the function module to copy SAP variants, the rs_copy_selection_sets result screen is displayed as follows.
Now, when we call the target ABAP report, we will see that the SAP variants from source ABAP program are copied to this new program successfully.
In this ABAP tutorial, we displayed how ABAP developers can copy SAP report variants from one ABAP report to another using function module rs_copy_selection_sets.