2012 Feb 17 5:18 PM
Hello exprts,
can you please tell me a fm which converts a xstring into an itab? I´ve found some, but no one is working in CRM.
In best case, I get a itab with the structure: row and value from the fm!
In row is the row number and in value the cell value.
Thanks in advance!!
Best regdards
Anna
Hello exprts,
can you please tell me a fm which converts a xstring into an itab? I´ve found some, but no one is working in CRM.
In best case, I get a itab with the structure: row and value from the fm!
In row is the row number and in value the cell value.
Thanks in advance!!
Best regdards
Anna
2012 Feb 17 5:23 PM
2012 Feb 17 5:30 PM
Thank you for quick reply, but this fm does not exists in crm...
regards
Anna
2012 Feb 18 6:45 AM
Hi,
Please check these FMs,
ENH_XSTRING_TO_TAB
LXE_COMMON_XSTRING_TO_TABLE
ENH_VERS_MANAGEMNT_XSTRING2TAB
2012 Feb 18 1:54 PM
Hi ,
Use FM SMUM_XML_PARSE.
Please see below code snippet.
DATA : W_RESULT TYPE STRING,
BUFFER TYPE XSTRING,
IT_XML_TABLE TYPE TABLE OF SMUM_XMLTB,
wa_XML_TABLE TYPE SMUM_XMLTB,
RETURN TYPE TABLE OF BAPIRET2.
w_result = '<XmlSetResult><Message>0c2557aa-d37e-44e2-a59e-0e018bede434</Message></XmlSetResult>'.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = w_result
IMPORTING
buffer = buffer
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
xml_input = buffer
TABLES
xml_table = it_xml_table
return = return.
2012 Feb 20 4:14 PM
Hi Anna
You can create your own function and include code below to parse the code
ex_leng = xstrlen( im_xstring ).
l_rest = ex_leng.
WHILE l_off < ex_leng.
IF l_rest <= 255.
l_tl = l_rest.
ELSE.
l_tl = 255.
ENDIF.
l_hex = im_xstring+l_off(l_tl).
APPEND l_hex TO ex_data.
l_act = xstrlen( l_hex ).
l_rest = l_rest - l_act.
l_off = l_off + l_act.
ENDWHILE.Best regards
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |