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

Issue with BACK functionality with SUBMIT program same as calling program

Former Member
0 Likes
4,038

Hi,

I have a SUBMIT stmt in report. This SUBMIT stmt calls the same calling program with new parameters depending on few conditions. The issue is with BACK button.

If I click on BACK button after the SUMBIT ( without AND RETURN ) has been executed, then it takes the control out of program. i.e to SAP's initial screen.

If AND RETURN clause is used with SUBMIT, in the above scenario, I have to press BACK twice to come to the program's selection screen.

Any inputs from anyone for this issue ?

Regards,

Shiva

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,342

Hello Sivanand,

It is working fine. Without return it will close the current session and new session is created for running new instance of program and there if you press back it will come out to initial screen whereas if you use return then the current session is retained and new session is created for new program instance. So in this case if you use back button then first it will come out of current session and then it will come out of earlier session.

What is the issue exactly you are facing?

For more information you can check SAP help for session handling.

http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba50035c111d1829f0000e829fbfe/frameset.htm

Thanks,

Augustin.

10 REPLIES 10
Read only

Former Member
0 Likes
2,342

Hi,

Please debug your program and go throgh the control you will understand whats actually happening..

whenn you use submit inside a program then you need to come twice back I guess if I am not wrong..

rgds,

nazeer

Read only

Former Member
0 Likes
2,343

Hello Sivanand,

It is working fine. Without return it will close the current session and new session is created for running new instance of program and there if you press back it will come out to initial screen whereas if you use return then the current session is retained and new session is created for new program instance. So in this case if you use back button then first it will come out of current session and then it will come out of earlier session.

What is the issue exactly you are facing?

For more information you can check SAP help for session handling.

http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba50035c111d1829f0000e829fbfe/frameset.htm

Thanks,

Augustin.

Read only

0 Likes
2,342

Hi Augustin,

What I'm trying to achieve is once I click on BACK button after the SUBMIT stmt execution, it should take me back to the program selection screen.

What is happening now is, if without return is used, it takes me out to SAP initial screen ( out of se38 ). And if I use return, then I have to click BACK twice to get back to program screen.

Any suggestions to achieve what I'm trying ?

Regards,

Shiva

Read only

0 Likes
2,342

Hi,

Try using this



SUBMIT ztrial EXPORTING LIST TO MEMORY AND RETURN.

This should work I guess.

Read only

0 Likes
2,342

Hi Nitwick,

Tried with SUBMIT prgname EXPORTING LIST TO MEMORY AND RETURN.

It works as needed when I put breakpoint @ submit and execute. Otherwise, still the same old execution. Any other suggestions ?

Regards,

Shiva

Read only

0 Likes
2,342

Hello Sivanand,

Why don't you try scheduling JOB instead of SUBMIT statement.

This way second report will execute in background and calling report will remain on selection screen.

You can use JOB_OPEN, JOB_SUBMIT & JOB_CLOSE for scheduling JOB programatically.

Hope this helps!

Thanks,

-Augustin.

Read only

0 Likes
2,342

Hi Augustin,

I cannot use background scheduling, as the called program is same as calling on with different parameters. User wants to see the output on the screen. BACK functionality comes into picture if the user wants to go back from this output screen now.

Regards,

Shiva

Read only

0 Likes
2,342

Please create a little program (remove all the parts which are not of interest for us) that we can use for test, and check what is wrong.

Read only

Former Member
0 Likes
2,342

Hi,

Essentially, it works like how you have written. The ouput of the called program is displayed and then the output of the calling program is displayed. So that's how the BACK button works. With the addition AND RETURN, it means you are returning to the calling program and executing it. Without the addition, the control does not get back to the calling program.

If you want to supress the output of called program when clicking on BACK, then you can use the addition


SUBMIT ztrial EXPORTING LIST TO MEMORY AND RETURN. 

Read only

0 Likes
2,342

Hi,

If you want to return to the selection screen of the program you can write "AND RETURN" at the end after submit and then write "leave to screen 0". This would land you up on the selection screen.