on 11-26-2013 3:56 PM
SAP PI (7.11) receives an extended version INVOIC.INVOIC02 IDoc from SAP ECC 6.
The extension segment provides data required to retrieve contents of a PDF file from the outbound SAP ECC system. The retrieval is performed by an RFC which is called at mapping runtime. The RFC returns a string in encoded form representing the contents of the file. The business partner requires the file to be attached to the SOAP message and not passed as a string inside the payload.
sample section of the target payload containing the file contents.
<ns0:Attachment type="FILE">
<ns0:AttachmentName>FSO302175.pdf</ns0:AttachmentName>
<ns0:CustomContent>JVBERi0xLjcKNCAwIG9iago8PAovVHlwZSAvUGFnZQovUmVzb3VyY2VzCjw8……. </ns0:CustomContent>
</ns0:Attachment>
However, the vendor needs this to be included as MIME attachment.
Would checking the "Keep Attachment" option in the receiver soap adapter achieve this?
What would be the best way to do this?
Hello Girish,
You can create attachments via UDF or Java Mapping (adapter module is also viable). Since this is a pdf, you need a java library so that you can create one e.g http://scn.sap.com/people/prakash.singh4/blog/2005/04/05/create-a-pdf-file-using-java
After you have created your PDF via UDF or Java Mapping(which is most likely to be saved temporarily in AL11), read the file, convert it into output stream and then attach it in your message for ex:
Attachment attachments = output.getOutputAttachments().create(FileName, "application/octet-stream", pdfInByte);
output.getOutputAttachments().setAttachment(attachments);
. Make sure to clean up the file you have saved in AL11.
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your suggestions Mark.
Since time and effort has been invested in an RFC that is returning the PDF contents as a xstring converting it into binary and saving it as a file before attaching is what I'd like to do. Any suggestions on this are welcome too
I am working on this and will update the post shortly on my findings.
Cheers,
Girish
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.