Skip to Content
0
Former Member
Oct 17, 2006 at 09:21 AM

Help needed for Transforming XML into nested ITAB

53 Views

Hi guys,

I am having problems converting this XML into a ITAB. Pls look thru and advise me on the XSLT codes cheers!

<b><u>XML</u></b>

<?xml version="1.0" encoding="iso-8859-1"?>

<gebizXML>

<PROCESS>TX-TIME-EXTENSION</PROCESS>

<PAYLOAD>TEST</PAYLOAD>

</gebizXML>

<u><b>THE PROGRAM</b></u>

TYPES: BEGIN OF GENERIC,

PROCESS TYPE STRING,

PAYLOAD TYPE STRING,

END OF GENERIC.

DATA: G_XML TYPE TABLE OF GENERIC.

DATA: xml_string TYPE string .

DATA: xslt_error TYPE REF TO cx_xslt_exception,

xslt_message TYPE string .

CLEAR xml_string .

CONCATENATE

`<?xml version="1.0" encoding="utf-8"?>`

`<G_XML timestamp="20051213T221545+08:00">`

`<PROCESS>TX SCHEDULE</PROCESS>`

`<PAYLOAD>this is a test of a string</PAYLOAD>`

`</G_XML>` INTO xml_string .

TRY .

CALL TRANSFORMATION (`ZSAMPLEX2A`)

SOURCE

XML xml_string

RESULT

G_XML = G_XML.

CATCH

cx_xslt_exception INTO xslt_error.

xslt_message = xslt_error->get_text( ).

ENDTRY.