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

PO changes required while sending as PDF

Former Member
0 Likes
508

Hi Friends,

I am facing the below issues.

While sending a PO via external send as a PDF attachment, the user wants the below changes.

a) Multiple mail ids maintained in the vendor master but the mail has been delivered to the default id. We need to send it to multiple ids

b) Subject line for this message was SAPLMEDRUCK /20100311/005635, but we need the PO number in the subject like GMMEDC PO 6000078747

c) File name is appearing like 'SAPLMEDRUCK_20100311_005635' but it should be the POnumber,in this case 'PO# 6000078747'.

Here in NACE, the program is the program is SAPFM06P and the script is a z one (ZMEDRUCK_Can). For the first one, creating a group id can solve the purpose but i am not getting any solution for the 2nd and the 3rd points.

Please provide your valuable input to me.

With Regards,

Ajit Prasad.

Hi Friends,

I am facing the below issues.

While sending a PO via external send as a PDF attachment, the user wants the below changes.

a) Multiple mail ids maintained in the vendor master but the mail has been delivered to the default id. We need to send it to multiple ids

b) Subject line for this message was SAPLMEDRUCK /20100311/005635, but we need the PO number in the subject like GMMEDC PO 6000078747

c) File name is appearing like 'SAPLMEDRUCK_20100311_005635' but it should be the POnumber,in this case 'PO# 6000078747'.

Here in NACE, the program is the program is SAPFM06P and the script is a z one (ZMEDRUCK_Can). For the first one, creating a group id can solve the purpose but i am not getting any solution for the 2nd and the 3rd points.

Please provide your valuable input to me.

With Regards,

Ajit Prasad.

2 REPLIES 2
Read only

former_member778253
Active Participant
0 Likes
468

Hi

Use the below function module for sending mail:

'SO_NEW_DOCUMENT_ATT_SEND_API1'

in this fm,, pass your 'subject' to document_data parameter and

file name to 'packing list' parameter

Hope it helps..

Read only

0 Likes
468

Hi,

For some special type of attachments, 'SO_NEW_DOCUMENT_ATT_SEND_API1' FM can not be used.

Please try cl_bcs class to send email to multiple ids and all type of attachment.

Sample:

DATA: send_request        TYPE REF TO cl_bcs.
DATA: document            TYPE REF TO cl_document_bcs.
DATA: recipient           TYPE REF TO if_recipient_bcs.
DATA: sender              TYPE REF TO if_sender_bcs.

send_request = cl_bcs=>create_persistent( ).

* Create the email
document = cl_document_bcs=>create_document(
        i_type    = 'RAW'     "Type
        i_text    =                "text
        i_subject =  ).        "Subject

* Add attachment
document->add_attachment(
        i_attachment_type    = 'PDF'                        " type attachment
        i_attachment_subject = 'FA RFQ'               " name of attachment
        i_att_content_hex    = gi_rfq_attachment ). " Content

send_request->set_document( document ).

sender = cl_cam_address_bcs=>create_internet_address( 'Senders email here' ).
      send_request->set_sender( sender ).

* Add as many recipient as you want
recipient =  cl_cam_address_bcs=>create_internet_address( 'Recipients emails here ' ).  "Multiple

CALL METHOD send_request->add_recipient
        EXPORTING
          i_recipient = recipient
          i_express   = 'X'.

* Send email
sent_to_all = send_request->send( i_with_error_screen = 'X' ).

Hope this clear to you.

Regards,

Khanh