‎2006 Dec 04 11:25 AM
Hi All,
I have issue with SUBMIT Statement.
I am submitting <b>Report2</b> from <b>Report1</b> but it is stopping at the selection screen of <b>REPORT2</b>.
Statement is written as below:
<b> SUBMIT REPORT2 VIA SELECTION-SCREEN
WITH SELECTION-TABLE RSPARM.</b>
As per my requirement i will <b>REPORT2's</b> selection screen from <b>RSPARM</b> in <b>Report1</b> and after submitting <b>Report2</b> it should process <b>Report2</b>.
Can anybody tell me why it is stopping at <b>Selection-Screen</b> of <b>Report2</b> and what can be the solution.
Also i have one more issue in <b>Report2</b> that is
<b>'i need to check if this is a batch run(sy-batch)'</b> if it is true i need to send email to some users.
How can i write the same condition. Can anybody give how to go about it!
Thanks in advance.
Thanks & Regards,
Deep.
‎2006 Dec 04 11:30 AM
SUBMIT REPORT2 VIA SELECTION-SCREEN
WITH SELECTION-TABLE RSPARM
AND RETURN.
‎2006 Dec 04 11:30 AM
hi,
take away the addition via selection-screen and that will help u.
use this additon instead ... WITH sel1 value1 WITH sel2 value2 ...
santhosh
‎2006 Dec 04 11:33 AM
HI,
Add the bold one.
SUBMIT REPORT2 VIA SELECTION-SCREEN
WITH SELECTION-TABLE RSPARM <b>AND RETURN</b>
if you want to know the Report2 is a batch program, then make use a Function module BP_JOB_SELECT_SM37B to get the Job name, and read the table with your job name then you com eto know the result
Regards
Sudheer
‎2006 Dec 04 11:51 AM
Hi,
If we give AND RETURN option to existing SUBMIT it will come back to calling program na!
In our example if we submit REPORT2 from REPORT1 it will come back to REPORT1 na!
I don't want that to happen, My code just need to submit REPORT2 from REPORT1 and execute REPORT2 without coming back to REPORT1.
I should show output of REPOR2 only.
For second query what we exactly need to pass to know if it is a batch run[SY-BATCH]!
Thanks for those replies.
Thanks,
Deep.
‎2006 Dec 04 12:28 PM
‎2006 Dec 04 12:31 PM
HI,
If u dont want to return to the REPORT1 back then no need of AND RETURN statement.
‎2006 Dec 04 12:52 PM
Hi Deep,
Just a try. As far as your query goes it seems that you run report2 always from report1. So if the user runs the report: REPORT1 in back ground we know that sy-batch will be set to 'X', in this case must set a Flag some thing like GV_FLAG to 'X'.
And SAY: EXPORT gv_flag TO MEMORY ID ...
and in REPORT2, in the initialization event say
IMPORT gv_flag FROM MEMORY ID ...
and check if this flag is set and send a mail.
Please let me know if this solved your problem.
Regards,
Goutham.