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

mail sending problem......

arpit_shah
Contributor
0 Likes
501

dear all,

i want to send external mail through sap......

in that i m making spool & convert to pdf and send as a attachment.......

i hv a got idea from

<a href="http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm.">http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm.</a>

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

but as per requirement i m changing some logic.....but it is not work.......

i m calling some other program using submit.

i m giving code here.....

SUBMIT YPPDAILYUPDATE "VIA SELECTION-SCREEN

with pstngdt in temp

with entdate eq ' '

with posdate eq 'X'

with rdata eq 'X'

with logic eq ' '

with high eq 'X'

with trend eq ' '

AND RETURN

.

new-page.

commit work.

new-page print off.

IF sy-batch EQ 'X'.

PERFORM get_job_details.

PERFORM obtain_spool_id.

select yemail as p_email into CORRESPONDING FIELDS OF TABLE mailtab

from ymail

where ytcode = 'YPP18'.

gd_attachment_desc1 = 'YPP18'.

PERFORM convert_spool_to_pdf.

loop at mailtab into mailstr.

p_email1 = mailstr-p_email.

PERFORM process_email.

endloop.

wait up to 5 seconds.

SUBMIT rsconn01 WITH mode = 'INT'

WITH output = 'X'

AND RETURN.

  • ENDIF.

ELSE.

SKIP.

WRITE:/ 'Program must be executed in background in-order for spool & mail sending',

'request to be created.'.

ENDIF.

_______________

but using this i m running this program in background then also it not generate any spool......

pls give a solution for this problem.....

i will provide points for that....

Regards,

Arpit

<a href="http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm.">http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm.</a>

3 REPLIES 3
Read only

VikasB
Active Participant
0 Likes
472

Hi Arpit,

You can create spool in the Report itself.

have a look at this code and paste it where do you want to create it and convert it into PDF for mailin purpose.

   CONSTANTS : l_c_device(4)    VALUE 'LOCL'.

**   Create Spool Request
  NEW-PAGE PRINT ON
  LINE-SIZE 120
  DESTINATION l_c_device
  IMMEDIATELY ' '
  KEEP IN SPOOL 'X'
  NEW LIST IDENTIFICATION 'X'
  NO DIALOG.

Regards,

Vikas.

plz reward if helpful...

Read only

0 Likes
472

hi.....vikas what is 'LOCL'....

but it is not working.....

i hv to change anything in that.......

In direct execution it is fine working.....

but in background processing not giving correct output. & spool also not generated.

pls advice.....

Regards,

Arpit

Read only

0 Likes
472

i want to pass mail id as cc or bcc.

then what to do for this..

and send person name with email id...

e.g

Arpit <anshah1985@gmail.com>;

for this what to do?.................