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

Spool is Missing When a Report is Executed through a JOB

Former Member
0 Kudos
790

Hi,

I had a task in which I have to Pick the Session Log from SM35 and print it when a Report is executed .In the Report I Created a Session using the SUBMIT.I used Perfrom statemet from RSBDC_ANALYSE programe and picked the Log.I got the Exact result when I executed the Report in Foreground but when i tried to Execute in background I could not Get the SPOOL.

Report Is executed as a JOB and in that Report a Session will be Created and then it is Executed as a job I picked the Log from this Session.

Can any one please kindly help me out with this issue.

Thanks & Regard,

Prasad.

11 REPLIES 11
Read only

Sandra_Rossi
Active Contributor
0 Kudos
575

I don't understand everything, but your spool is probably not attached to the job (SM37) because you seem to print from another internal session than the initial one, but you may find the spool simply via SP01 transaction.

Read only

0 Kudos
575

Hi,

In the Main Programe Which Prints the Spool a Session Will be created and it will be executed and then after that I have written my code to Pick the Log of that session.

Read only

0 Kudos
575

Is your question about how to retrieve the log of a batch input session programmatically?

Read only

0 Kudos
575

Hi,

I have written the Code and it is working fine when I executed the Programe in Fore ground but when i tried to execute in Background I could not see any spool.

Read only

0 Kudos
575

did you check SP01?

Otherwise debug the job

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Kudos
575

Hi,

.I used Perfrom statemet from RSBDC_ANALYSE programe and picked the Log.

Can you please share the code, hoe you are fetching the log?

BR,

Suhas

Read only

0 Kudos
575

Hi Sandra,

Can you please kindly provide information how to Debug the Job

Read only

0 Kudos
575

WAIT UP TO 3 SECONDS.

DATA: Begin of PR_NEW,

POSITIONSINFO(60),

FEHLERTEXT(130),

end of PR_NEW.

DATA: wa_bseg TYPE BSEG,

wa_knb1 TYPE KNB1,

wa_kna1 TYPE KNA1,

wa_bkpf TYPE BKPF,

wa_xblnr(20) TYPE c.

SELECT * FROM APQI INTO CORRESPONDING FIELDS OF TABLE it_apqi

WHERE groupid = GROUP

AND credate = sy-datum.

READ TABLE it_apqi INDEX 1.

SELECT * FROM APQL INTO TABLE logtab_temse

WHERE qid = it_apqi-qid.

LOOP AT logtab_temse.

clear bdcld.

bdcld-temseid = logtab_temse-temseid.

bdcld-lmand = logtab_temse-mandant.

bdcld-edate = logtab_temse-credate.

bdcld-etime = logtab_temse-cretime.

bdcld-luser = logtab_temse-creator.

bdcld-grpn = logtab_temse-groupid.

bdcld-quid = logtab_temse-qid.

bdcld-local_host = logtab_temse-destsys(8).

APPEND bdcld.

ENDLOOP.

READ TABLE bdclm index 1.

perform read_bdc_log_plain IN PROGRAM RSBDC_ANALYSE

tables logtable

using bdcld-temseid bdcld-lmand.

LOOP AT logtable.

clear bdclm.

bdclm-indate = logtable-enterdate.

bdclm-intime = logtable-entertime.

bdclm+14(352) = logtable-logmessage.

if bdclm-mcnt > 0.

bdclm-mcnt = bdclm-mcnt - 1.

endif.

if bdclm-mnr = '312'.

append bdclm.

endif.

ENDLOOP.

LOOP AT bdclm.

CLEAR wa_bseg.

CLEAR wa_knb1.

CLEAR wa_kna1.

CLEAR wa_bkpf.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = bdclm-mpar+02(09)

IMPORTING

OUTPUT = wa_belnr.

.

SELECT SINGLE * FROM BSEG INTO wa_bseg

WHERE belnr = wa_belnr

AND bukrs = bdclm-mpar+13(04)

AND buzei = '001'

AND gjahr = sy-datum+0(4).

SELECT SINGLE * FROM BKPF INTO wa_bkpf

WHERE belnr = wa_belnr

AND bukrs = bdclm-mpar+13(04)

AND gjahr = sy-datum+0(4).

SELECT SINGLE * FROM KNB1 INTO wa_knb1

WHERE kunnr = wa_bseg-kunnr

AND bukrs = wa_bseg-bukrs.

SELECT SINGLE * FROM KNA1 INTO wa_kna1

WHERE kunnr = wa_bseg-kunnr.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = wa_bseg-kunnr

IMPORTING

OUTPUT = wa_bseg-kunnr.

CONCATENATE 'Ref.doc.' wa_bkpf-xblnr INTO wa_xblnr SEPARATED BY space.

PR_NEW-POSITIONSINFO+000(010) = wa_bseg-belnr.

PR_NEW-POSITIONSINFO+011(19) = wa_xblnr.

PR_NEW-POSITIONSINFO+031(004) = wa_bseg-bukrs.

PR_NEW-POSITIONSINFO+036(006) = wa_bseg-kunnr.

PR_NEW-POSITIONSINFO+043(004) = wa_bseg-zterm.

PR_NEW-POSITIONSINFO+048(004) = wa_knb1-zterm.

IF wa_bseg-zterm NE wa_knb1-zterm.

CONCATENATE 'Terms of payment of Customer' wa_bseg-kunnr wa_kna1-mcod1

'was changed from' wa_knb1-zterm 'to' wa_bseg-zterm

INTO PR_NEW-FEHLERTEXT SEPARATED BY space.

WRITE: / PR_NEW-FEHLERTEXT.

WRITE: / PR_NEW-POSITIONSINFO.

WRITE: /.

ENDIF.

ENDLOOP.

Read only

0 Kudos
575

First submit the job with or without any start job conditions as you wish.

SM37 transaction, select the job (whatever finished or not) and enter JDBG in the okcode field. Program will be started interactively with the same variant and stops at the first statement in non-system program.

Read only

Former Member
0 Kudos
575

It's working fine thank you

Read only

0 Kudos
575

Glad for you. Don't forget to give a feedback (check forum rules)

In case someone has the same problem, could you explain what was the issue and how you solved it?