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: 

Read spool of a program and sent the content in a email

Former Member
0 Kudos
531

Hi Guys,

I have a problem while executing a Report program in background.if i run the prg in foreground the content of the report is fully populated in the lotus Email.But when i run the same prg in background.....the email is populated with only last three lines of the report.I am extrating all the content of the report in to an internal table and passing to the function..'SO_NEW_DOCUMENT_SEND_API1'.

please help me out to over come this issue....is there that i need to do specify spool recepients list...while scheduling a background job...or....can i read the spool of the prog and read the spool content into an internal table and pass it to the above function module....in the same prg....

Please help me....

Full points will be awarded...

Thanks,

Radha

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos
124

Hi,

While creating batch job, specify a "Spool list recipient" on the first screen of SM36 and then an email address for the recipient.

aRs

4 REPLIES 4

former_member194669
Active Contributor
0 Kudos
125

Hi,

While creating batch job, specify a "Spool list recipient" on the first screen of SM36 and then an email address for the recipient.

aRs

Former Member
0 Kudos
124

hi Radha,

try out this way......

1) when u r writing to the spool (r simply writing in background), u try out this way,

loop at itab.

write itab.

endloop.

new-page.

commit work.

new-page print off.

2) then call fm "get_job_runtime_info" to get the jobname, jobcount and stepcount.

3) select listident(Spoolnumber) from table "tbtcp" for the above values with listident ne 0.

4) read the spool into a table using any std sap fm.......

Pls reply if this works.... i assume that u didnt send the contents in mail as any attachments right?

(Note = u can only c the spool contents in SP01, after the prog executed)

(Also u can try this in debugging in background using SM50, creating an infinite loop in the code).......

Former Member
0 Kudos
124

Hi,

Refer to the following link:

http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos
124

Hi,

Refer to the following link:

http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

Hope this helps.

Reward if helpful.

Regards,

Sipra