on 11-24-2009 11:10 AM
Hi Experts,
I have a requiement where I need to store the XML Payload inside and ABAP table in binary format (in a single field) and then read the payload from the ABAP table again into standard XML and map it to a file structure for the file adapter to use.
Can you please tell me if you have had a similar requirement in the past and how you resolved it?
Thank you,
Brendon
Hi Brendon,
Is storing in Binary format a part of the requirement?
Can you store the data in string format?
Regards,
Ravi Kanth Talagaana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santhosh,
Thanks for your repsonse. I thought of that approach using SXMB_READ_MESSAGE_VERSION_RAW or something similar, but the problem is that we only want to store the message if it meets certain critera (therefore if the message does not meet the criteria, it will not be stored in raw format inside ABAP).
Regards,
Brendon
Dear Brendon~
>>therefore if the message does not meet the criteria, it will not be stored in raw format inside ABAP
My point is XI stores the payload message in any case on ABAP tables for Monitoring & processing purpose...
instead of storing payload and retrieve it your requirement criteria you could only read the message from the standard table if it meets your criteria..
~SaNv..
1. You have to read the payload using the abap code as below..
CALL METHOD persist_main->read_msg_all
EXPORTING
im_msgguid = <message id>
im_pid = <central>
im_version = ' '
IMPORTING
ex_message = xms_msg_main.
* xms_msg->deleteheaderbyname(
* nsuri = if_xms_run_time_env=>co_nsuri
* lcname = if_xms_run_time_env=>co_lcname ).
xmb_msg_main ?= xms_msg_main.
CALL METHOD xmb_msg_main->if_xms_message_xmb~get_main_payloads
RECEIVING
return = payload.
READ TABLE payload INTO wa_payload INDEX 1.
CALL METHOD wa_payload-mainpayload->getbinarycontent
RECEIVING
return = content_main.
now content_main will have the payload.
2. You can parse this content using ABAP XML parser and return. This would be similar like ABAP Mapping
ixmlfactory = cl_ixml=>create( ).
streamfactory = ixmlfactory->create_stream_factory( ).
istream = streamfactory->create_istream_xstring( content_main ).
idocument = ixmlfactory->create_document( ).
iparser = ixmlfactory->create_parser( stream_factory =
streamfactory
istream = istream
document = idocument ).
iparser->parse( ).
~SaNv...
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.