on 02-10-2011 4:14 PM
Hi I need to send an attachment in a synchronous ABAP Server Proxy.
I proceeded as follows:
1. design sync inbound interface in PI
2. generate abap server proxy
3. implement this abap proxy
4. tried to attach file to response like this:
data server_context type ref to if_ws_server_context.
data attachment_prot type ref to if_wsprotocol_attachments.
data attachment type ref to if_ai_attachment.
data attachments type prx_attach.
data lo_protocol type ref to if_wsprotocol.
data lo_payload_protocol type ref to if_wsprotocol_payload.
try.
server_context = cl_proxy_access=>get_server_context(
).
attachment_prot ?= server_context->get_protocol( if_wsprotocol=>attachments ).
attachment = attachment_prot->get_attachment_from_binary(
data = lv_xdata
type = if_ai_attachment=>c_mimetype_pdf
name = 'my attachment'
).
append attachment to attachments.
attachment_prot->set_attachments( attachments ).
catch cx_ai_system_fault .
output-mt_get_documents_resp-fault-fault_text = 'cx_ai_system_fault'.
output-mt_get_documents_resp-fault-fault_url = 'ERR001'.
endtry.
However I cannot see any attachment in the response.
Q1: is it possible at all to create attachments in sync server abap proxy?
Q2: if it is, what is wrong with my coding?
cheers
simon:)
>> is it possible at all to create attachments in sync server abap proxy?
Yes, it is 100 percent possible
Refer this blog for Q1 and Q2
/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
Thanks
Baskar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Baskar,
Yes thank you I did see this blog already. However it is commenting asynch communication initialized by NW application server.
I am talking about sync communication initialized by 3rd party system calling ABAP proxy and giving a response. To this response I would like to attach a file.
best regards
simon:)
Veronica,
Unfortunately, this was not possible, due to the system EHP state.
First after upgrade this functionality will be possible ( ECC 6.0 EHP5 - corresponding to NW AS EHP2 )
For an example, as Stefan pointed out, you might want to open OSS if your system is up-to-date and you need one.
best regards
Simon:)
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.