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: 
Read only

Submit ABAP report & return

Former Member
0 Likes
2,683

HI,

I have to submit to two reports from my ABAP report, one after the other. Now, after submitting to the first ABAP report, suppose there is some problem with the selection paramters and user plans to exit out, so he presses on the back button, this not only brings him back to my program but also triggers the second following ABAP report to submission. The value of sy-subrc is 0, irrespective of the user runs the called report or not. Can anybody suggest how I can find out if the user was able to run the report at the first place or not, since the second report should only run if the first report was run successfully. We dont want the second report to run if the first report didnt run.

Thanks in advance.

Shiv

HI,

I have to submit to two reports from my ABAP report, one after the other. Now, after submitting to the first ABAP report, suppose there is some problem with the selection paramters and user plans to exit out, so he presses on the back button, this not only brings him back to my program but also triggers the second following ABAP report to submission. The value of sy-subrc is 0, irrespective of the user runs the called report or not. Can anybody suggest how I can find out if the user was able to run the report at the first place or not, since the second report should only run if the first report was run successfully. We dont want the second report to run if the first report didnt run.

Thanks in advance.

Shiv

4 REPLIES 4
Read only

Former Member
0 Likes
1,398

Hi

You should update the first report has to be called, here you can populate an IMPORT/EXPORT parameter in START-OF-SELECTION event. After submitting the report you read this parameter and if it's filled you run the second report:

REPORT ZREPORT.

DATA RUN.

SUBMIT ZREPORT2 VIA SELECTION-SCREEN AND RETURN.

IMPORT RUN FROM MEMORY ID 'ZRUN'.

IF RUN = 'X'.

SUBMIT ZREPORT3 VIA SELECTION-SCREEN AND RETURN.

ENDIF.

REPORT ZREPORT2.

DATA RUN.

START-OF-SELECTION.

RUN = 'X'.

EXPORT RUN TO MEMORY ID 'ZRUN'.

Max

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,398

Interesting. Do you have total control of all programs. Meaning, are they all custom, or are they standard? I'm thinking that we can play around with memory to achieve this. Going under the assumption that you have contol over the driver and the first submitted report. Here is the plan.

In the driver.....

data: flag(1) type c.

free memory id 'TEST'.

submit zreport and return.

import flag = flag from memory id 'TEST'.
free memory id 'TEST'.
if flag = space.
submit zreport2 and return.
endif.



In the submitted program....




[code]

report zreport1.



data: flag(1) type c.

parameters: p_check type c.

start-of-selection.

flag = 'X'.  " Report was executed
export flag = flag to memory id 'TEST'.



What do ya think?

REgards,

Rich Heilman

Read only

0 Likes
1,398

It looks interesting indeed.

Well,fortunately, I am having to submit to a Z report first before a SAP report, so I think I can have a change in the report little bit at the start-of-selection.

Think it will work from there. Thanks.

I have awarded required points too.

Read only

0 Likes
1,398

Cool, I'm sure that it will work then. Looks like Max was thinking the same.

Regards,

Rich Heilman