cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the message id of inbound message to Proxy

Former Member
0 Kudos

Hi Experts,,

I have a business requirement to get the message id of inbound message to ABAP proxy. The coding to get the message id should be done in ABAP proxy itself. Please let me know at the earliest. Thanks and appreciate

Ricky

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi !

Message ID -

This thread also

Thanks!!

Former Member
0 Kudos

Just to add one more thing. I am working on ABAP 4.7 version and there is

no class cl_proxy_access in it. So any suggestions around this class may not be helpful. Thanks

Former Member
0 Kudos

for cl_proxy_access

check with these

http://help.sap.com/saphelp_nw04/helpdata/en/51/d5cd16235e4643ae8ec92395c4ad97/frameset.htm

Querying the Acknowledgment Object

In the application program, you actively query the status of the acknowledgment by querying an acknowledgment object. You have the following options:

If you can still access the client proxy instance, you can query an acknowledgment object in real-time by using the GET_ACKNOWLEDGMENT method.

· It is unlikely that you will still have access to the client proxy instance when you want to query the status of the acknowledgment. If this is the case, proceed as follows (also see the example below):

a. After the proxy call, get the message ID of the message sent (see: Accessing the Message ID).

b. Using the message ID and the CL_PROXY_ACCESS=>GET_ACKNOWLEDGMENT( ) method you can get and evaluate the acknowledgment object.

Code

Requesting an Acknowledgment

Method sendWithACK.

DATA:

  • Reference variables for proxy and exception class

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.

  • Structures to set and get message content

ls_request TYPE ,

TRY.

  • create proxy client

CREATE OBJECT lo_clientProxy.

  • get protocol for asynchronous messaging

lo_async_messaging ?=

lo_clientProxy->get_protocol( if_wsprotocol=>async_messaging ).

  • Ask for transport acknowledgment

clear l_ack_request.

l_ack_request =

IF_WSPROTOCOL_ASYNC_MESSAGING=>CO_TRANSPORT_ACKNOWLEDGMENT.

lo_async_messaging->set_acknowledgment_requested( l_ack_request ).

  • do asynchronous client proxy call

CALL METHOD lo_clientProxy->execute_asynchronous

EXPORTING output = ls_request.

  • get message id of sent message

lo_msg_id_protocol ?=

lo_clientProxy->get_protocol( if_wsprotocol=>message_id ).

l_msg_id = lo_msg_id_protocol->get_message_id( ).

  • send message

COMMIT WORK.

CATCH cx_ai_system_fault INTO lo_sys_exception.

  • Error handling

ENDTRY.

  • Somehow pass the message ID to the caller for an evaluation

  • at a later point in time

Return lo_msg_id.

Endmethod.

Querying an Acknowledgment

You can query the acknowledgment object later by using the message ID:

Data:

lo_ack TYPE REF TO if_ws_acknowledgment,

l_ack_status_simple type PRX_ACK_STATUS,

l_ack_status_detail type PRX_ACK_STATUS_DETAIL_TABLE.

  • read ack

lo_ack = cl_proxy_access=>get_acknowledgment( l_msg_id ).

l_ack_status_simple = lo_ack->get_status( ).

l_ack_status_detail = lo_ack->get_status_detail( ).

Thanks !!

Former Member
0 Kudos

Thanks for the replies. But none of these are helpful to my requirement.

I wanted to write a simple code in ABAP proxy inbound to get message_id of the inbound message. And since I am working in 4.7 version, there is no such class cl_proxy access in the system. I am not expecting any solutions using this class.

Hopefully, the question is much clearer than the previous ones

Thanks

Former Member
0 Kudos

Hello Johnson,

Check this....

http://help.sap.com/saphelp_nw04/helpdata/en/a1/082589fc4246f09793039d5fb01a17/content.htm

With Regards,

Vidya

*****please reward points if found useful