2012 Mar 26 8:47 AM
Hi,
might be this is common Q, but it is taking time to resolve it.
we have one program X, passing data to antoher program via submit program Y
the date whatever is in Y, it should generate spool request.
what we did is,
in X, we created spool request, called Y ,and return job close.
please find the code below:
SELECT-OPTIONS: s_date FOR jhap-erfdate NO-EXTENSION,
s_time FOR jhap-erftime .
DATA : l_jobcount TYPE tbtcjob-jobcount,
l_jobname TYPE tbtcjob-jobname VALUE 'ZSMS_TEST1',
l_print_parameters TYPE pri_params.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = l_jobname
IMPORTING
jobcount = l_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
SUBMIT ZSMS_TEST1
with s_date in s_date
with s_time in s_time
TO SAP-SPOOL
SPOOL PARAMETERS l_print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB l_jobname NUMBER l_jobcount
AND RETURN.
here ZSMS_TEST1 has code just fetch the data from JHAP and displaying the O/P
here what is concern is, if i execute X, it is generating spool nicely, and i am able to see the o/p also in spool.
but i want to see the logic processing in debugging,
in debug mode when submit statement occurs,
cursor coming to SUBMIT line, entering inside, some system code is coming, i pressed F7, and F7, again cursor is coming back to same line, but not able to see the code of the (ZSMS_TEST1) Y..
if i comment sppool parameters in SUBMIT statement, am able to see the logic processing in debug mode, but sppol is not generating
could you please help on this...
Sri
2012 Mar 26 11:08 AM
Hi Sriram,
the simple reason why you cannot debug is: the second report is not started directly. It just enters the job queue and will start in the background, if there is open slot. This may take some seconds, minutes or even hours, depends on the work load of the server (see docu regarding background jobs).
2012 Mar 26 11:12 AM
Thank you for your reply,
but if i want to see it in debug mode...is there anty procedure...?
2012 Mar 26 11:23 AM
HI
to debug a report executed via job , exists one method.
in the ZSMS_TEST1 report fill the next code (before the code tha you need to debug.)
DATA X TYPE I VALUE 0.
if sy-uname = 'your UNAME'.
DO.
IF X = 1 .
EXIT.
ENDIF.
ENDDO.
ENDIF.
this loop not finish ever. Ok? then execute the program and go to transaction SM50 and you can see the report in execution. Mark it and via menu, select debbug report, then you can change x var to 1 , and debbug your process.
From SM50 you can see the processes that are running (background and foreground,) and you can debug it.
Regards,
Marc.