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

submit report background ------ problem

Former Member
0 Likes
330

Hi Friends,

This is regarding submit program in background.

I am calling program like this..

SUBMIT ZXXXX

VIA JOB name NUMBER number

WITH P_MODE EQ 'N'

TO SAP-SPOOL

SPOOL PARAMETERS print_parameters

WITHOUT SPOOL DYNPRO

AND RETURN.

With this Job is creating successfully and status showing finished. But it seems program was not executed. no action has performed. time taken is 0 seconds

-


the same code I tested in debug mode by commenting

* VIA JOB name NUMBER number

in the above statement.

it is working fine. could you pls help me I want submit my program in background.

for your information. Before submit I am using function module JOB_OPEN.

and after submit I am using JOB_CLOSE.

Pls help me. very urgent.

Thanks in advance.

Raghunath

1 REPLY 1
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
279

You can check the job status in SM37. Here is a working example, see what's different in your code:

CONCATENATE 'Z' p_vkorg '_POST_RETURNS' INTO jobname.
  CLEAR jobcount.

  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      jobname  = jobname
    IMPORTING
      jobcount = jobcount.

  IF sy-subrc <> 0.
     ....
  ENDIF.

  SUBMIT ...
          WITH p...
          VIA JOB jobname
          NUMBER jobcount
          USER user_name
       AND RETURN.

* Close the job and run immediately
  CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
      jobcount  = jobcount
      jobname   = jobname
      strtimmed = 'X'.            " Start immediately