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: 

Attach mail sent through CL_BCS to Sales Order using GOS

0 Kudos
829

Hi

we are sending an email to customer using our custom program . This email, should be seen as part of the attachments when anyone opens the sales order. I know that GOS can be used to create attachments in Sales Order. But can we attach an email that is sent from SAP to the attachments list?

Please let me know if this is possible.

Thanks,

Vishwa.

1 ACCEPTED SOLUTION

Domi
Active Contributor
0 Kudos
311

Hi

You can create a binary relation to the SO using CREATE_LINK of class CL_BCS

To read all linked mails use eg CL_BINARY_RELATION=>READ_LINKS ( IT_RELATION_OPTIONS-LOW = 'BCSAPPLSRQ' )

To display the mail you can do something like this:

DATA: lr_doc TYPE REF TO CL_DOCUMENT_BCS.

lr_doc ?= CL_BCS=>GET_INSTANCE_BY_OID( ... )->SEND_REQUEST->GET_DOCUMENT( ).

lr_doc->IF_DOCUMENT_DISPLAY_BCS~DISPLAY_OUTPLACE( ).

The send request must be stored for this solution!

Regards

4 REPLIES 4

Domi
Active Contributor
0 Kudos
312

Hi

You can create a binary relation to the SO using CREATE_LINK of class CL_BCS

To read all linked mails use eg CL_BINARY_RELATION=>READ_LINKS ( IT_RELATION_OPTIONS-LOW = 'BCSAPPLSRQ' )

To display the mail you can do something like this:

DATA: lr_doc TYPE REF TO CL_DOCUMENT_BCS.

lr_doc ?= CL_BCS=>GET_INSTANCE_BY_OID( ... )->SEND_REQUEST->GET_DOCUMENT( ).

lr_doc->IF_DOCUMENT_DISPLAY_BCS~DISPLAY_OUTPLACE( ).

The send request must be stored for this solution!

Regards

0 Kudos
311

Hi

Thanks for your reply. We are doing something similar, as attaching to GOS is really not happening.

Thanks,

Vishwa.

Isegrim
Explorer
0 Kudos
311

Hi Vishwa,

And what is this "something similar"? Can you please share, I am facing the same Problem and could not make the solution proposal of Dominik working, either.

Thanks in Advance,

Erlend

valcoco59
Member
0 Kudos
311

Hi Vishwa and Erlend,

@Vishwa : Could you please share your source code ?

@Erlend : Did you find another solution ?

Thanks in advance for your help.

Valery