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

Emailing

Former Member
0 Likes
458

Hello folks,

Does anyone have idea about how can we use spooling concept in emailing reports through ABAP code.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
431

Hi,

Submit the report in background using

JOB_OPEN ( Get jobcount )

SUBMIT <program name > to SAP-SPOOL

jobname .... etc

JOB_CLOSE

Then get the spool number using following FM :

BP_JOB_READ ( Pass jobcount & jobname )

Get LISTIDENT from JOB_READ_STEPLIST table.

Then Convert Spool to the format req. for eg.

CONVERT_ABAPSPOOLJOB_2_PDF for pdf conversion.

Check Spool content with FM :

RSPO_RETURN_ABAP_SPOOL_JOB

Then create Body Content, subject etc & send the mail using FM :

SO_NEW_DOCUMENT_ATT_SEND_API1

Then delete the spool using FM :

RSPO_R_RDELETE_SPOOLREQ.

Hope this would solve the problem.

Best regards,

Prashant

3 REPLIES 3
Read only

venkata_ramisetti
Active Contributor
0 Likes
431

hI,

LOOK AT THE BELOW FORUM THREADS...

Thanks,

Ramakrishna

Read only

Former Member
0 Likes
431

Hi ,

check this sample code..

http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html

regards

vijay

Read only

Former Member
0 Likes
432

Hi,

Submit the report in background using

JOB_OPEN ( Get jobcount )

SUBMIT <program name > to SAP-SPOOL

jobname .... etc

JOB_CLOSE

Then get the spool number using following FM :

BP_JOB_READ ( Pass jobcount & jobname )

Get LISTIDENT from JOB_READ_STEPLIST table.

Then Convert Spool to the format req. for eg.

CONVERT_ABAPSPOOLJOB_2_PDF for pdf conversion.

Check Spool content with FM :

RSPO_RETURN_ABAP_SPOOL_JOB

Then create Body Content, subject etc & send the mail using FM :

SO_NEW_DOCUMENT_ATT_SEND_API1

Then delete the spool using FM :

RSPO_R_RDELETE_SPOOLREQ.

Hope this would solve the problem.

Best regards,

Prashant