Application Development 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: 

2 questions about submit

Former Member
0 Kudos

Hello Experts, i have two questions about submit.

1- How to know that a program was called by "Submit"? I find in SND that is not possible with SYST fields.

2- I am calling a report with 'SUBMIT' statement (Submit and Return), the called program has some error message ( MESSAGE e....). When the error occurs in the called program, an error message is displayed in the screen without coming back to calling program. I want that the called program be executed and when the error occurs, I get back to calling program.

How can I do that?

Correct answers will be greatly appreciated!!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

>

> 1- How to know that a program was called by "Submit"? I find in SND that is not possible with SYST fields.

=== export a variable from calling program and import it in the called progra,, if you find the same value as exported.. you know that its been called from that program.

for more information.. press F1 on EXPORT or IMPORT.

>

> 2- I am calling a report with 'SUBMIT' statement (Submit and Return), the called program has some error message ( MESSAGE e....). When the error occurs in the called program, an error message is displayed in the screen without coming back to calling program. I want that the called program be executed and when the error occurs, I get back to calling program.

> How can I do that?

yes you can... dont populate the message in the called program... (remove the error message) rather than that... use same export import method as i said above.. export a error flag variable from called program and import the error value in the calling program.. then do what ever you want..

2 REPLIES 2

Former Member
0 Kudos

>

> 1- How to know that a program was called by "Submit"? I find in SND that is not possible with SYST fields.

=== export a variable from calling program and import it in the called progra,, if you find the same value as exported.. you know that its been called from that program.

for more information.. press F1 on EXPORT or IMPORT.

>

> 2- I am calling a report with 'SUBMIT' statement (Submit and Return), the called program has some error message ( MESSAGE e....). When the error occurs in the called program, an error message is displayed in the screen without coming back to calling program. I want that the called program be executed and when the error occurs, I get back to calling program.

> How can I do that?

yes you can... dont populate the message in the called program... (remove the error message) rather than that... use same export import method as i said above.. export a error flag variable from called program and import the error value in the calling program.. then do what ever you want..

Former Member
0 Kudos

Hi,

Before passing control to the called program, store the calling program's name in a memory id.

And compare the memory id variable and the sy-repid, if there are different, then the program is called by a SUBMIT stmt.

When sy-subrc is not zero, do not display the error message using MESSAGE, instead assign the error message to the standard variables sy-msgid, sy-msgno, sy-msgv1..sy-msgv4 and RETURN.

Hopefully, when you come back to the calling program, all these variables will still be available until it is overridden by any other message (success or failure).

Regards,

Subramanian