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

Email from a variable type XSTRING

Former Member
0 Likes
1,418

Hi all,

I have a variable of type XSTRING, i need to send this PDF file as an attachement to a mail. How can i do this?

Thanks in advance.

Warm regards,

Harshad.

3 REPLIES 3
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
975

Hello,

1. Use the method XSTRING_TO_SOLIX of class CL_DOCUMENT_BCS to convert to SOLIX_TAB.

2. Call the method ADD_ATTACHMENT class CL_DOCUMENT_BCS to add the attachment.

For further details look into the SAP example BCS_EXAMPLE_5.

Else use the method XSTRING_TO_SOLIX of class CL_DOCUMENT_BCS to get the hex contents & pass the resultant table to CONTENTS_HEX of the FM: SO_NEW_DOCUMENT_ATT_SEND_API1.

BR,

Suhas

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
975

Hi

Take ur XSTRING data into one Internal table and use:

call function 'EFG_GEN_SEND_EMAIL'

exporting

i_title = 'KPI Report - Status'(046)

i_sender = g_sender

i_recipient = g_email

i_flg_commit = k_x

i_flg_send_immediately = k_x

tables

i_tab_lines = it_tab_soli

exceptions

not_qualified = 1

failed = 2

others = 3.

if sy-subrc <> 0.

write:/ sy-subrc.

endif.

Regards,

Sreeram

Read only

Former Member
0 Likes
975

Solved with different logic