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: 

submit program issue not generating spool.

Former Member
0 Kudos

Hi Experts,

 

I am facing weird problem while calling the submit program (e.g.
ZREPORT_BG) from actual program (e.g.ZREPORT). Actually I have requirement to
create an activity group in background by selecting background check box in the
selection screen.

 

But when I am calling submit program ZREPORT_BG, I have few
issues as below.

  1. Start-of-selection and end-of-selection events
    are not triggering in the calling program (ZREPORT_BG).
  2. Alv display output is displaying in the called
    program.
  3. Spool is generating with the last message in the
    calling program (irrespective to sy-subrc).

    

Please let me know if I am missing anything while calling
program.

Thanks,

Siva

2 REPLIES 2

rajkumarnarasimman
Active Contributor
0 Kudos

Hi siva,

By default, the Initialization event will be called in the calling program.

If the calling program(ZREPORT_BG) have selection screen, then after the selection screen triggered and executed only, the start of selection and end of selection event will be called.

If the issue is occurring only in background, Kindly debug the program in background using the background option in SE38.

Regards

Rajkumar Narasimman

0 Kudos

Hi Raj,

Actually my issue with the submit statement.

In the below submit program, if I don't use the statements "WITH SELECTION-TABLE lt_sel_tab USER sy-uname VIA JOB lv_job_name NUMBER lv_job_nr" I am able to go to start of selection and end of selection in the submitted program.

if I call just program SUBMIT zmmapi12_bg AND RETURN, I am able to go inside the start of selection and end of selection. please let me know If I am missing any thing.

   

CALL FUNCTION 'JOB_OPEN'

    EXPORTING

      jobname          = lv_job_name

    IMPORTING

      jobcount         = lv_job_nr

    EXCEPTIONS

      cant_create_job  = 1

      invalid_job_data = 2

      jobname_missing  = 3

      OTHERS           = 4.

  IF syst-subrc = 0.

    SUBMIT zmmapi12_bg WITH SELECTION-TABLE

         lt_sel_tab

USER sy-uname

VIA JOB lv_job_name NUMBER lv_job_nr

        AND RETURN.

    IF sy-subrc = 0.

      CALL FUNCTION 'JOB_CLOSE'

        EXPORTING

          jobcount             = lv_job_nr

          jobname              = lv_job_name

          strtimmed            = 'X'