cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

I have created a module to encode a pdf attachment to base64. When I see it the receiver channel the encoding says binary. How can I change the content encoding to base64.

Thanks

Asif

0 Likes
View Entire Topic
Former Member
0 Likes

No I did not change it to base64. I sent it as is, the receiving system was able read it without converting to base64. Their original sample provided by them had it as base64, but they were read the attachment as binary. My scenario was ECC (idoc)->PI (PIDX invoice and pick a pdf file from ftp and attach it to the invoice - this was in the adapter module)-> RNIF.

Regards

Asif

vk_k3
Participant
0 Likes

Ok, Can you please give me some rough idea on the syntax you have used in the adapter module to attach the PDF File to the Invoice ?

Did you write code in Adapter Module to pick the file from the FTP and attach it to the Invoice ?

Regards,

Vkjoat

Former Member
0 Likes

VKjoat

Below is the code snippet to do the attachment. This is just part of the code, you need to create the complete module. Refer the links below to create your module.

Object obj = null;   // Handler to get Principle data

Message msg = null;  // Handler to get Message object

//Get the Principal data...

            obj = inputModuleData.getPrincipalData();

            msg = (Message) obj;

                    Payload payload = msg.createPayload();

                    payload.setContentType("application/pdf");

                    payload.setContent(file.getBytes());

                    payload.setAttribute("Content-ID", "[email protected].");

                    payload.setName("filename");

                    msg.addAttachment(payload);

                    inputModuleData.setPrincipalData(msg);

Links:

http://scn.sap.com/docs/DOC-3816

http://scn.sap.com/people/farooq.farooqui3/blog/2008/09/24/sap-xipi-encode-outgoing-payload-using-ad...

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e674...

Regards

Asif

Former Member
0 Likes

Hi ALL

    We are able do attachment using UDF Need help for updating Content-Transfer-Encoding: Binary  to base64

Content-Type: application/pdf

Content-Transfer-Encoding: base64

content-id: <Attachment0>

Former Member
0 Likes

Hi,

Our scenario is ECC (idoc)->PI (PIDX invoice )-> RNIF. We want to change Content-Transfer-Encoding from binary to 8 bit. Can you please let me know how we can update Encoding in PIDX message?

Currently we can see binary in PIDX message but receiver wants it to be 8 bit.

Thanks and Regards,

Prachi