cancel
Showing results for 
Search instead for 
Did you mean: 

how to find contents of ABAP proxy message

Former Member
0 Kudos

we are using an ABAP proxy to send data including a document number from SAP to PI when a document is received on our SAP ERP system.

it is possible under certain conditions that the proxy will not be processed, but the document has. I want to be able to check the messages sent to PI to ensure that all the data has actually created a proxy message. How can I, if it is possible, find the data within the messages so I can determine if the whole process has completed OK.

Put another way how do we know what data is in a message as listed under transaction SXMB_MONI ? The GUID in this transaction appears to relate to table SXMSPMAST but how can I find the information contained within that message so I can then link the message with the original document and then if necessary call the proxy again for that document ?

Colin

Edited by: Colin Heap on Oct 22, 2009 5:16 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

your answer is there in SAP PI 7.1 EHP 1, EHP 1 is giving the facility of payload search.

Former Member
0 Kudos

Nice to know, but I'm on the SAP ERP side and have no access to PI.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Ravi,

I get errors on ERP when I use this program , but it's pointed me in the right direction so I'll weither modify that program or create my own from your suggestions. Assuming I get it to work I'll add the results to this forum.

Thanks again for the help.

Former Member
0 Kudos

The problems I mentioned above seem to have been down to the xml messages themsleves rather than the coding found from Ravis' link however I made a few changes to the code to add more flexibility in the search parameter and also a TRY - ENDTRY to deal with the problem of abends when the SAP cannot interpret the message contents.

please refer to the original BLOG ( Super Message Monitor for SAP XI ) by Alessandro Guarneri at the link in Ravis' post.

I have then made the following changes. Please note that the field names used in my code are slighlty different to the original code to fit in with local coding practice however I think it will be easy for a programmer to interpret the changes

1. Selection Screen 850 has been changed to use a SELECT-OPTION for the payload value. In Alessandros' code this is in INCLUDE ZXIMONI_RSXMB_SEL_MSG_SEL.


* Super selection screen -------------------------------------------------- BEGIN
TABLES: idxsndpor, idxrcvpor.
SELECTION-SCREEN BEGIN OF SCREEN 0850 AS SUBSCREEN.
SELECTION-SCREEN COMMENT 5(40) text-S98.

* IDoc
SELECTION-SCREEN BEGIN OF BLOCK idoc WITH FRAME TITLE text-s16.
* Sender
SELECTION-SCREEN BEGIN OF BLOCK idoc_snd WITH FRAME TITLE text-s14.
SELECT-OPTIONS: s_snum FOR idxsndpor-idocnumber NO INTERVALS,
                s_styp FOR idxsndpor-idoctyp    NO INTERVALS.
SELECTION-SCREEN END OF BLOCK idoc_snd.
* Receiver
SELECTION-SCREEN BEGIN OF BLOCK idoc_rcv WITH FRAME TITLE text-s15.
SELECT-OPTIONS: s_rnum FOR idxrcvpor-idocnumber NO INTERVALS,
                s_rtyp FOR idxrcvpor-idoctyp    NO INTERVALS.
SELECTION-SCREEN END OF BLOCK idoc_rcv.
SELECTION-SCREEN END OF BLOCK idoc.

* Payload
SELECTION-SCREEN BEGIN OF BLOCK xp WITH FRAME TITLE text-s30.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (30) text-x01 FOR FIELD p_xpath.
PARAMETERS: p_xpath TYPE text256.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (30) text-x02 FOR FIELD s_xvalue.  
PARAMETERS: p_xvalue TYPE text256 NO-DISPLAY.                    
SELECT-OPTIONS s_xvalue for p_xvalue.                                       
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK xp.

SELECTION-SCREEN END OF SCREEN 0850.
* Super selection screen -------------------------------------------------- END

I'm having trouble entering the next piece of code for INCLUDE ZXIMONI_RSXMB_CUSTFILTERS so will enter it in the next post.

Former Member
0 Kudos

This code change was to Alessandros' include ZXIMONI_RSXMB_CUSTFILTERS. Again some of the field names have changed to fit naming standards but I think the idea is clear, that the TRY - ENDTRY has been added, the search parameter is now a select-option and there is an extra message if nothing is found.


  z_li_msg ?= z_li_ifmsg.
  z_li_pay = z_li_msg->get_payload_with_main_document( ).
  z_lv_payxstr = z_li_pay->getbinarycontent( ).

* Create DOM
  z_istream = z_streamfactory->create_istream_xstring( z_lv_payxstr ).
  z_idocument = z_ixmlfactory->create_document( ).
  z_iparser = z_ixmlfactory->create_parser( stream_factory = z_streamfactory
      istream = z_istream
      document = z_idocument ).
  z_iparser->parse( ).
* Search for xpath / value
  z_lv_xpath = p_xpath.

  z_root = z_idocument->get_root_element( ).

TRY.
  z_el = z_root->find_from_path( path = z_lv_xpath ).
ENDTRY.
  IF NOT z_el IS BOUND.
* Element not found, so delete message
  DELETE gt_msgtab.
  ELSE.
  z_path_bound = 'YES'.
  z_vl = z_el->get_value( ).
  IF Not z_vl in s_xvalue.
*   Value doesn't match, so delete message
  DELETE gt_msgtab.
  ENDIF.
  ENDIF.
  ENDLOOP.
  ENDIF.

  DATA: z_msg(100),
  z_msgnr TYPE i,
  z_msgnrstr type string.
  DESCRIBE TABLE gt_msgtab LINES z_msgnr.
  z_msgnrstr = z_msgnr.
  CONCATENATE z_msgnrstr 'messages found.' INTO z_msg SEPARATED BY space.
  MESSAGE s100(xms_adm) WITH z_msg.

 if z_msgnr = 0 and not p_xpath is INITIAL.
  CONCATENATE 'The specified path "' p_xpath '"'  INTO z_msg.
  CALL FUNCTION 'POPUP_TO_INFORM'
  EXPORTING
  titel = 'XML message "PAYLOAD PATH" not found'
  txt1  = z_msg
  TXT2  = 'was not found within the messages for'
  TXT3  = 'the other search parameters specified'
  txt4  = 'Please check your selections'.

 endif.

former_member181962
Active Contributor
0 Kudos

Hi Colin,

Finding the link between the message GUID and the application document's number is not worth the effort .

Instead what I suggest is follow the following approach.

In the proxy, after the data is send succesfully to XI, update a ZTABLE which has the document number and a flag as the fields in it, with a success flag if succesful, and a not success flag if the data is not sent succesfully.

later, you can use this Z table to know which documents have been sent out and which are not.

Regards,

ravi kanth Talagana

Former Member
0 Kudos

Thanks Ravi, from your reply I realised that I had already found the tables with the payload ( SXMSCLUR / SXMSCLUP ), but couldn't see the data as it appears to have been encoded or compressed. I am still going to pursue this as it really would be helpful for us. If you know of the functions / methods that can translate the payload then that would be great, but thanks for your help so far.

former_member181962
Active Contributor
0 Kudos

Hi Colin,

This blog talks about searching the messages using payload content (Which is similar to your requierement).

http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3414800)ID1587130750DB01071334062206391421End...

See if it is helpful to you.

All that he did was in XI. You have to do it in your R/3 system.

Regards,

Ravi Kanth Talagana