Skip to Content
0

SUBMIT and RETURN not working when run in background

Apr 13 at 03:35 PM

126

avatar image

Hi Experts,

I am trying to schedule a report B via BG job from report A using SUBMIT AND RETURN along with using FM JOB_OPEN and JOB_CLOSE. The program runs fine in foreground, but when we try to schedule report B as BG job from program A, it is not getting executed. i have debugged and found that the program is not going to START-OF-SELECTION but validating selection screen events.

My submit statement looks like below:

SUBMIT REPORT2 WITH paramters_in_B = parameters_in_A

WITH selectoptions_in_B IN selectoptions_in_B

USER 'XXXX'

VIA JOB 'JOBNAME'

NUMBER 'XXXX' AND RETURN

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Sandra Rossi Apr 14 at 06:42 AM
0

Yes, at the time of the SUBMIT (my remark is about before JOB_CLOSE is executed, i.e. not during the background job, although it's executed at that moment too), it always go through the selection-screen validation : if there's an error and the submission runs in dialog mode, then the SUBMIT VIA JOB displays the selection screen along with the error message (yes, during the job submission). Anyway, your question is more about the job NOT being launched.

BUT did you check the return codes of JOB_OPEN, SUBMIT and CLOSE, and is the job really NOT scheduled in SM37 -> don't forget to also display the jobs with a missing start condition, i.e. planned/preliminary status)?

If everything is fine, then check the SAP notes, and if you find nothing then open a ticket at SAP support.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Sandra,

Thanks for your reply. There is no error message in JOB_OPEN, SUBMIT and CLOSE, also sy-subrc is 0. Could it be that the job was not started?

Regards,

Aditya

0
jyothir aditya k

If there's no error, then it should work. As I said, check in SM37 (if you closed the job without any start condition then it has a status with value planned/preliminary, you may still see it in SM37); otherwise check SAP notes, if none can be applied then open a ticket.

0
Horst Keller
Apr 14 at 10:04 AM
3

In fact, the füll behavior is explained here:

https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abapsubmit_via_job.htm

Especially, see step 1 ...

Share
10 |10000 characters needed characters left characters exceeded
ROBERTO Forti Santos Apr 13 at 10:47 PM
0

Hi Jyothir,

Also implement the below code in your submit statement regarding SAP link.

USING SELECTION-SCREEN dynnr

https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/abapsubmit_interface.htm

Regards,

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Roberto,

thanks for your reply. Apparently, I do not want to run the 2nd program in the foreground but in background. Using the above it is taking me to Selection screen of 2nd program where i could see a button to schedule in background.

Once gain thanks for the reply.

Regards,

Aditya

1

Hi Jyothir,

Check if the USER has authorization - object S_BTCH_NAM.

"USING SELECTION-SCREEN dynnr" works fine considering yours submit via JOB (background).

Below SAP explain.

Addition 1

... USING SELECTION-SCREEN dynnr

Effect

This addition defines which selection screen is called. dynnr is a data object that must contain the dynpro number of a selection screen defined in the called program when the statement SUBMIT is executed.

  • If the addition USING SELECTION-SCREEN is omitted or the dynpro number 1000 is entered, the standard selection screen is called. If no standard selection screen is defined in the called program, no selection screen is called.
  • If a dynpro number other than 1000 is entered in the addition USING SELECTION-SCREEN, the corresponding standalone selection screen is called. If no selection screen with this dynpro number is defined in the called program, a non-handleable exception is raised.

Addition 2

... VIA SELECTION-SCREEN

Effect

If this addition is specified, the selection screen is "displayed" on the screen. Otherwise, background selection screen processing takes place. In background selection screen processing, the selection screen events are raised without the selection screen being displayed.

Regards,

1