1
votes

Requirement: To convert SRT_MMASTER table's MESSAGE_DATA field data into readable string format or in internal table.

I have tried different function modules to convert Byte String (Blob) data stored in SRT_MMASTER table's MESSAGE_DATA field but none of it returned readable string format or at least generate an XML file in return.

I have tried Function modules like :

SCMS_BINARY_TO_STRING, 
SDIXML_XML_TO_DOM, 
SDIXML_DOM_TO_DATA,
SMUM_XML_PARSE

and methods like :

cl_soap_xml_parser=>get_data
cl_soap_xml_parser=>get_formatted_data
CALL METHOD cl_bcs_convert=>raw_to_string

and more, but none were able to convert it to correct readable format.

Can you suggest which function module or class/method can be used to solve the purpose?

1
Can you describe what "SRT_MMASTER table's MESSAGE_DATA" is made of, and what it contains? And for a given example, what output do you expect? - Sandra Rossi
could you please add a minmal example record from the table? - koks der drache
@SandraRossi, SRT_MMASTER-MESSAGE_DATA field's Datatype is RAWSTRING (Byte String [BLOB]) - Chandan Jha
Based on your comments on Haojie answer (which I tested and which answers your question), it seems that you are looking for something else so can you ask a new question to tell what exactly you are looking for? (seems to be more than the field MESSAGE_DATA of database table SRT_MMASTER) - Sandra Rossi

1 Answers

1
votes

You can use IMPORT from DATA BUFFER and cl_soap_xml_helper=>xstring_to_string

DATA:
     lt_message_item        TYPE srt_persistency_item_t,
     lx_message_data TYPE xstring.

SELECT SINGLE message_data FROM srt_mmaster INTO lx_message_data.

IMPORT message_data = lt_message_item FROM DATA BUFFER lx_message_data.

DATA(lv_string) = cl_soap_xml_helper=>xstring_to_string(  lt_item[ 1 ]-value ).