cancel
Showing results for 
Search instead for 
Did you mean: 

Sending payload in ABAP proxy

Former Member
0 Kudos

Hi all,

i have a requirement to send the inbound payload in the mail content when any error occurs in ABAP proxy. How can I achieve this?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

These docs are not relevant to sending the payload. I am lookng for the code for sending the xml payload coming in proxy as part of mail content when an error occurs

Thanks

Former Member
0 Kudos

are you looking for this

The following program fetches the payload for a request message independently of a proxy instance and returns it in the system:

DATA:

ls_request TYPE [Data type of output parameter],

lo_fault TYPE REF TO cx_ai_system_fault,

lo_payload_handler TYPE REF TO IF_WS_PAYLOAD_HANDLER,

lo_payload TYPE REF TO if_ws_payload,

lt_request_data TYPE PRX_T_PARAM,

ls_request_data TYPE PRX_S_PARAM.

lo_pointer TYPE REF TO xstring,

  • Fill request data

request-field1 = '[Value1]'.

request-field1 = '[Value1]'.

*...

request-fieldN = '[ValueN]'.

  • Use payload handler to get payload independently

  • from proxy call:

TRY.

  • Get Payload handler for a proxy method.

  • Note: You have to provide the proxy and method name in uppercase.

lo_payload_handler = cl_proxy_access=>get_payload_handler(

proxy_name = 'CO_...'

proxy_method = 'EXECUTE_SYNCHRONOUS' ).

  • Pass request data to payload handler

CLEAR lt_request_data.

CLEAR ls_request_data.

ls_request_data-name = 'OUTPUT'.

GET REFERENCE OF request into ls_request_data-value.

append ls_request_data to lt_request_data.

lo_payload =

lo_payload_handler->get_payload_from_request_data(

lt_request_data).

  • Catch system faults

CATCH cx_ai_system_fault INTO lo_fault.

WRITE: / 'System fault'.

WRITE: / 'Code:', lo_fault->code.

WRITE: / 'Text:', lo_fault->errortext.

EXIT.

ENDTRY.

  • Show payload for test purposes

lo_pointer = lo_payload->get_xml_pointer( ).

cl_proxy_service=>show_xml_document( lo_pointer->* ).

<b>Check this</b>

/people/krishna.moorthyp/blog/2005/12/23/monitoring-for-processed-xml-messages-in-abap-proxy

http://help.sap.com/saphelp_nw04/helpdata/en/31/6c5c3c3806af06e10000000a11402f/frameset.htm

Thanks !

Former Member
0 Kudos

Hello ,

Your Question is not clear...Could you pls restructure it.

Are you looking for client proxy or Server Proxy

With Regards,

Vidya

Former Member
0 Kudos

I want to send the payload from server proxy whenever error occurs while processing BAPIs in the proxy..

Thanks

Former Member
0 Kudos

ricky,

I guess ur scenario is legacy system->XI->Proxy(R/3) and Proxy->XI->Mail.

I think u can use fault message .In case any exception occurs in processing the BAPI u will get a fault message.And u can route the error message to mail thro' XI.

But i am not sure how to execute it.

Or else u can use Email Alerts for that.yes i guess that will be easy.Whenever exception/error occurs an Email Alert will be sent.

Regards

BILL

nisarkhan_n
Active Contributor
0 Kudos

I want to send the payload from server proxy whenever error occurs while processing BAPIs in the proxy?

1. Genereating the error if the BAPI fails in the PROXY: you can use the Fault message type as suggested by the Mr.DAS

2. if you want to send the whole payload then you have to take care of this on the ABAP side wither genereate mail which sends payload or send this payload back to XI which XI will send.......

i dnt think you can catch the whole payload from XI if BAPI fails until some thing is taken care from ABAP side, you can trigger the error messages but for paylod my suggestion is to take then failed messages from ABAP send back to XI or send from ABAP

Former Member
0 Kudos

Thanks for the replies. These replies are helpful but the real requirement is not met with this. Once again, In the inbound ABAP proxy, I have to capture the payload coming in (xml format). . The second requirement is to send the payload as part of mail content using cl_bcs->send_request. Has anyone done this before? Please share your experiences. Appreciate ur help

Thanks

Ricky