Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Implementation of transport acknowledgment in ABAP synchronous proxy

Former Member
0 Kudos

Hi All,

We need to implement transport acknowledgment in synchronous proxy to send a response message such as ‘Data is received successfully at ECC(SAP system)’ to PO system immediately after receiving the data and before data processing.

I have tried with the logic given in link: Acknowledgments - Proxy Programming - SAP Library

However, there is no method like get_protocol() in the abap proxy we have used and thus I am getting error that 'Method "GET_PROTOCOL" is unknown or PROTECTED or PRIVATE.'

Please reply if anyone has worked on such scenario.


Thanks & Regards,

Kanchan Wakchaure.

4 REPLIES 4

VenuAnumayam
Participant
0 Kudos

Not sure how you coded your GET_PROTOCOL method.

Can you try as mentioned in SAP Help. Please take a look at this link:

PS: I haven't used it yet. Thought it might help.

https://help.sap.com/saphelp_nw73ehp1/helpdata/en/48/5a3c285ae007dbe10000000a42189b/content.htm

Ryan-Crosby
Active Contributor
0 Kudos

Hi Kanchan,

If you are working on a synchronous scenario then the fact that you get a response serves as your acknowledgement that the data was delivered.  Requesting an acknowledgement within a proxy is intended for asynchronous processing for which the sender would not know if the message is delivered successfully.

Regards,

Ryan Crosby

0 Kudos

Hi Ryan,


Thank you for the response.


You are right  that synchronous proxy output provides acknowledgment, but it is sent to PO system after processing the data. Our requirement is to send the response immediately after receiving the data and before processing it in ECC system.


I tried below logic as given in link: Acknowledgments - Proxy Programming - SAP Library


DATA: lo_clientproxy TYPE REF TO


          lo_sys_exception TYPE REF TO cx_ai_system_fault,

          lo_async_messaging TYPE REF TO if_wsprotocol_async_messaging,

          lo_msg_id_protocol TYPE REF TO if_wsprotocol_message_id,

          l_msg_id TYPE sxmsguid,

          l_ack_request TYPE prx_ack_request_details,

          ls_request TYPE string.

    TRY.

       CREATE OBJECT lo_clientproxy.

       lo_async_messaging ?= lo_clientproxy->get_protocol( if_wsprotocol=>async_messaging ).

        CLEAR l_ack_request.

        l_ack_request = if_wsprotocol_async_messaging=>co_transport_acknowledgment.

        lo_async_messaging->set_acknowledgment_requested( l_ack_request ).

     

        CALL METHOD lo_clientproxy->execute_asynchronous

            EXPORTING

              output = ls_request.

       lo_msg_id_protocol ?= lo_clientproxy->get_protocol( if_wsprotocol=>message_id ).

        l_msg_id = lo_msg_id_protocol->get_message_id( ).

       COMMIT WORK.

     CATCH cx_ai_system_fault INTO lo_sys_exception.

     ENDTRY.

With this logic, how the response will be sent back to PO? Should I create an outbound asynchronous proxy along with above logic to send the acknowledgment from ECC to PO?

Or can I implement transport acknowledgment with synchronous proxy as well?

Thanks & Regards,

Kanchan Wakchaure.

0 Kudos

Hi Kanchan,

I don't think you can initiate an acknowledgement on a synchronous proxy for the reason I already mentioned.  However, if you wanted to make it asynchronous in a way you could submit the data to some time of job (with a short delay) and send the response back which would include your message.  Tackling it in that fashion allows you to remain within the constraints of a synchronous interface but give back the message before any processing occurs.

Regards,

Ryan Crosby