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: 

send IDOC with attachment

Former Member
0 Kudos

Hi Experts ,

I want to send IDOC with some attachment like TEXt file or image.

I read forums regarding this but couldn't get it.

Can anyone help me on this.

Thanks ,

Akriti

6 REPLIES 6

Former Member
0 Kudos

Hi,

i am afraid this is not possible. Data is stored in character format in an IDoc (you can think about it as a text file) and cannot contain binary data or attachments.

Dov

jack_graus2
Active Contributor
0 Kudos

Hi, as far as I am aware there are no standard IDOC's that send out attachments.

However you can add it in an IDOC extension and use a ABAP exit or enhancement in the outbound IDOC to populate the IDOC data.

We have a development in place that attaches invoice archivelink documents into the invoice IDOC. The data is encoded into base 64 format.

Regards Jack

0 Kudos

Hi

I have a question for you. We want to do the exact same thing as you have described here :

"invoice archivelink documents into the invoice IDOC. The data is encoded into base 64 format."

We have an output type for the IDOC, but the IDOC is not saved iin archivelink, which is also expected, but we would like to avoid having to have 2 output types, one to create teh PDF to the archivelink and one to create the IDOC, so how did you handle the part of saving the billing document to archivelink without using 2 output types?

Hope you can clarify

Thanks in advance

Br Birgitte Hamborg Jakobsen

Former Member
0 Kudos

Thanks for the comments.

I read in some forums that we can add an extra segment with binary type field and can attach the binary format of that file in it an then can send the IDOC to SAP.

Is it possible? if yes then could you please explain how?

And there is one issue that how can i get the file attached in the IDOC in SAP.

Regards,

Akriti

0 Kudos

Hi, the IDOC segments are character based. To put binary attachment data into the IDOC the binary data first need to be converted into BASE64 format. The BASE64 format is a character format.

To convert binary data into BASE64 function module SSCF_BASE64_ENCODE can be used.

Not sure you are sending or receiving an IDOC in SAP.

When receiving in SAP then you can use function module SSCF_BASE64_DECODE to decode the BASE64 IDOC data into binary data.

Also not sure how you want to process the attachment in SAP. When saving to a SAP office file you could use function module SO_DOCUMENT_INSERT_API1.

Regards Jack

Former Member
0 Kudos

Thanks Jack.. This was really helpful

Actually my scenario is to save the file attached to the IDOC into SAP content server.

Can you help me in this .

Regards

Akriti