Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a new version for a report dynamically.

charan_reddy_112
Discoverer
0 Kudos
802

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.

1 ACCEPTED SOLUTION

thilakan_t
Participant
730

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.

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos
730

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!

thilakan_t
Participant
731

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.

RahulYadavTest
Discoverer
0 Kudos
555

how can  i start ABAP NetWeaver IDE tools as fresher student  

Sandra_Rossi
Active Contributor
0 Kudos
540

@RahulYadavTest Please ask your questions here: Technology Q&A | SAP Community.

But please, search first, this question has been asked one hundred times.