[XI/PI] ABAP Proxy to XI SOAP - 첨부파일 Attachment
ABAP Proxy Code : DATA: prxy TYPE REF TO ZIFCCO_ATTACH_OUT, mt_in TYPE ZIFCMT_ATTACH, dt_in TYPE ZIFCDT_ATTACH. dt_in-data = 'data is...'. mt_in-mt_attach = dt_in. DATA: attachment_protocol TYPE REF TO if_wsprotocol_attachments, attachment TYPE REF TO if_ai_attachment, attachments TYPE prx_attach, attach_xstring TYPE xstring. attach_xstring = '202020202020204B'. TRY. CREATE OBJECT prxy. attachment_protocol ?= prxy->get_protocol( if_wsprotocol=>attachments ). attachment = attachment_protocol->get_attachment_from_binary( data = attach_xstring type = if_ai_attachment=>c_mimetype_text_plain name = 'attachment_name'). APPEND attachment TO attachments. attachment_protocol->set_attachments( attachments ). CALL METHOD prxy->execute_asynchronous EXPORTING output = mt_in. COMMIT WORK. CATCH cx_ai_system_fault. WRITE 'system fault'. ENDTRY. |