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: 

Email

Former Member
0 Kudos

Hi All,

I have a requirement of sending data as Email with Excel sheet as attachment.

I have populated the data into internal table populating into other table and passing this table as

parameter to the FM SO_NEW_DOCUMENT_ATT_SEND_API1.

Now in my outbox the status is Yellow(highlited) Sending in process.

Are there any prerequisites that i need to do before doing this?

Thanks

Madan

7 REPLIES 7

former_member223537
Active Contributor
0 Kudos

Hi,

After the call to the FM


CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'....

WAIT UP TO 1 SECONDS.
  SUBMIT rsconn01 WITH mode = 'INT'
                WITH output = 'X'
                AND RETURN.

Also ensure that BASIS has configured sending external emails.

Best regards,

Prashant

0 Kudos

Hi Prashanth,

Thanks for the solution.Its working fine.

But when i am sending The receiver isreceiving 2 file.

1)Excel sheet

2).Txt which contains body of the message.

I dont want this .TXT

Can you help me..?/

Thanks

Former Member
0 Kudos

HI,

Add this code after the Fm SO_NEW_DOCUMENT_ATT_SEND_API1.

SUBMIT rsconn01

WITH mode = 'INT'

WITH output = ''

AND RETURN.

GauthamV
Active Contributor
0 Kudos

hi,

check the mail settings in SCOT transaction.

Former Member
0 Kudos

hi,

use this

WAIT UP TO 2 SECONDS.

SUBMIT rsconn01 WITH mode = 'INT'

WITH output = 'X'

AND RETURN.

check this standard pogram

http://www.sap-img.com/abap/sending-email-with-attachment.htm

also check blog

thanks.

former_member223537
Active Contributor
0 Kudos

Hi,

* Describe the body of the message
  lwa_packing_list-transf_bin = space.


* For attachment
  lwa_packing_list-transf_bin = 'X'.

Best regards,

Prashant

Former Member
0 Kudos

Check this code which is simple and will be able to attach the excel file

CLASS cl_abap_char_utilities definition load.

DATA: tab type x value 9,

ctab(1) type c,

clen type string.

*constants: ctab(1) type c value ','.

DATA: one type char3 value 'one',

two type char3 value 'two',

three type char5 value 'three',

out(1000) type c occurs 0 with header line.

CTAB = cl_abap_char_utilities=>newline .

"vertical_tab.

clen = cl_abap_char_utilities=>MaxCHAR. "charsize.

*class cl_gui_frontend_services definition load.

concatenate one

space

two

space

three

space

clen

  • INTO out SEPARATED BY tab.

into out. "separated by CTAB.

append out.

call function 'GUI_DOWNLOAD'

exporting

filename = 'c:\out.xls'

filetype = 'ASC'

trunc_trailing_blanks = 'X'

tables

data_tab = out

exceptions

file_write_error = 01

no_batch = 04

unknown_error = 05

others = 99.