2023 Dec 27 10:51 AM
My task was to write a abap program,
where i need to create new version for a given report dynamically.
I tried using SVRS_AFTER_CHANGED_ONLINE_NEW function.
REPORT ZIN21CREATE_REPORT_VERSIONS.
data : E071_ENTRY type table of E071 .
APPEND value #( TRKORR = 'z001' AS4POS = 143808 PGMID = 'ZR_IN21_SMARTFORMS_SUB' OBJECT = 'REPS'
OBJ_NAME = 'OBJ_NAME' OBJFUNC = '' LOCKFLAG = '2' GENNUM = '' LANG = 'HR' ACTIVITY = '' ) to E071_ENTRY.
CALL FUNCTION 'SVRS_AFTER_CHANGED_ONLINE_NEW'
EXPORTING
e071_entry = E071_ENTRY
iv_trkorr = '001' "Replace with desired version name
iv_pgmid = 'ZR_IN21_SMARTFORMS_SUB' "Program ID
iv_object = 'REPS' "Object type (report)
iv_obj_name = 'ZR_IN21_SMARTFORMS_SUB' "Report name
iv_mode = 'SPACE' "Make the version persistent
EXCEPTIONS
no_versions = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
WRITE: / 'Error creating version of report'. "ls_report_object-object.
ELSE.
WRITE: / 'Version'. "l_version, 'of report'. "ls_report_object-object, 'created successfully.'.
ENDIF.
But i am getting dump.
Can anyone suggest me alternative way to create version for a report dynamically.
2023 Dec 27 4:31 PM
seems you are using correct FM. pass valid values in correct type of parameters. In my system E071_ENTRY is a structure but you are using like a table. Correct it and try again.
2023 Dec 27 12:14 PM
Please edit your question (Actions>Edit), select your code and press the button [CODE], which makes the code appear colored/indented, it'll be easier for people to look at it. Thanks!
2023 Dec 27 4:31 PM
seems you are using correct FM. pass valid values in correct type of parameters. In my system E071_ENTRY is a structure but you are using like a table. Correct it and try again.
2024 Aug 20 8:56 AM
2024 Aug 20 9:10 AM
@RahulYadavTest Please ask your questions here: Technology Q&A | SAP Community.
But please, search first, this question has been asked one hundred times.