‎2008 Apr 25 3:24 PM
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
‎2008 Apr 25 8:36 PM
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