Skip to Content
0
Mar 12, 2008 at 01:04 PM

ABAP Proxy Attachment

514 Views

Hi All,

I had created an ABAP proxy which sends an XML message along with an attachment(PDF). The PDF is written to the application server first (just to double check the correctness of the file) and then the same file is sent to the XI as an attachment. But when i download it from the SXMB_MONI to the local system, it is saying that the file may be corrupted or might be a poblem with the decoding. i had gone through the following weblog.

[/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments|/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments]

I'm using the following code to send the pdf as attachment.

attachment_protocol TYPE REF TO if_wsprotocol_attachments,

attachment TYPE REF TO if_ai_attachment,

attachments TYPE prx_attach,

attach_xstring TYPE xstring.

attachment_protocol ?= prxy->get_protocol( if_wsprotocol=>attachments ).

attachment = attachment_protocol->get_attachment_from_binary( data = attach_xstring

type = if_ai_attachment=>c_mimetype_pdf

name = 'Invoice_attachment' ).

APPEND attachment TO attachments.

attachment_protocol->set_attachments( attachments ).

Can anyone please help me out in resolving the issue.

Thnx in Advance

Anil