2006 Feb 02 12:45 AM
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
2006 Feb 02 12:54 AM
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
2006 Feb 02 12:55 AM
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
2006 Feb 02 1:00 AM
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.
2006 Feb 02 1:06 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |