Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

XSL: transformation hierarchical XML into flat xml for RFC in ERP

Hi All,

Hi All,  I have big problem with mapping. I read data from SOAP and i need put received XML to RFC in ERP by XI. Technicaly i have not problem, connection and otherwise is OK. Problem is only with mapping. The XML from SOAP is multilevel with parameters, but table in RFC is FLAT. Basic mapping and XSLT transform i know. But how to transform this XML to XML in bottom?. Have you any idea how to do it using XSLT version 1.0 please? Every parameters from XML I need in one specific column ("flat" xml).

Input XML:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:SNPR xmlns:ns0="http://xxxxxxxxxxxxx/">

            <ns0:status dateReaseon="2013-03-07" sCode="0" sText="OK"/>

            <ns0:statPD number="445522999" nP="ANO" dateZN="2013-03-02" numberF="451">

                        <ns0:zvU>

                                   <ns0:s1 dateCreate="2013-01-01" dateClose="2013-01-10">

                                               <ns0:standardUC pref="47" number="45456456" kBN="0340"/>

                                               <ns0:nostandardUC number="7897897"/>

                                   </ns0:s1>

                        </ns0:zvU>

            </ns0:statPD>

           

            <ns0:statPD number="4564" nP="NE" dateZN="2013-02-15" numberF="451">

                        <ns0:zvU>

                                   <ns0:s1 dateCreate="2012-01-01" dateClose="2013-11-10">

                                               <ns0:standardUC pref="47" number="1111111" kBN="1000"/>

                                               <ns0:nostandardUC number="7897789"/>

                                   </ns0:s1>

                                   <ns0:s1 dateCreate="2012-01-01" dateClose="2013-11-11">

                                               <ns0:standardUC pref="00" number="222222222" kBN="2000"/>

                                               <ns0:nostandardUC number="999"/>

                                   </ns0:s1>

                        </ns0:zvU>

            </ns0:statPD>

</ns0:SNPR>

I need this output XML: HOW TO DO IT BY XSLT please?

<?xml version="1.0" encoding="UTF-8"?>

<roor>

    <item>

        <status_dateReason>2013-03-07</status_dateReason>

        <satus_sCode>0</satus_sCode>

        <status_sText>OK</status_sText>

        <statPD_number>445522999</statPD_number>

        <statPD_nP>ANO</statPD_nP>

        <sattPD_dateZN>2013-03-02</satPD_dateZN>

        <statPD_numberF>451</statPD_numberF>

        <statPD_zvU_s1_dateCreate>2013-01-01</statPD_zvU_s1_dateCreate>

        <statPD_zvU_s1_dateClose>2013-01-10</statPD_zvU_s1_dateClose>

        <statPD_zvU_s1_standardUC_pref>47</statPD_zvU_s1_standardUC_pref>

        <statPD_zvU_s1_standardUC_number>45456456</statPD_zvU_s1_standardUC_number>

        <statPD_zvU_s1_standardUC_kBN>0340</statPD_zvU_s1_standardUC_kBN>

        <statPD_zvU_s1_nostandardUC_number>7897897</statPD_zvU_s1_nostandardUC_number>

    </item>   

    <item>

        <status_dateReason>2013-03-07</status_dateReason>

        <satus_sCode>0</satus_sCode>

        <status_sText>OK</status_sText>

        <statPD_number>4564</statPD_number>

        <statPD_nP>NE</statPD_nP>

        <sattPD_dateZN>2013-02-15</satPD_dateZN>

        <statPD_numberF>451</statPD_numberF>

        <statPD_zvU_s1_dateCreate>2012-01-01</statPD_zvU_s1_dateCreate>

        <statPD_zvU_s1_dateClose>2013-11-10</statPD_zvU_s1_dateClose>

        <statPD_zvU_s1_standardUC_pref>47</statPD_zvU_s1_standardUC_pref>

        <statPD_zvU_s1_standardUC_number>1111111</statPD_zvU_s1_standardUC_number>

        <statPD_zvU_s1_standardUC_kBN>1000</statPD_zvU_s1_standardUC_kBN>

        <statPD_zvU_s1_nostandardUC_number>7897897</statPD_zvU_s1_nostandardUC_number>

    </item>   

    <item>

        <status_dateReason>2013-03-07</status_dateReason>

        <satus_sCode>0</satus_sCode>

        <status_sText>OK</status_sText>

        <statPD_number>4564</statPD_number>

        <statPD_nP>NE</statPD_nP>

        <sattPD_dateZN>2013-02-15</satPD_dateZN>

        <statPD_numberF>451</statPD_numberF>

        <statPD_zvU_s1_dateCreate>2012-01-01</statPD_zvU_s1_dateCreate>

        <statPD_zvU_s1_dateClose>2013-11-11</statPD_zvU_s1_dateClose>

        <statPD_zvU_s1_standardUC_pref>00</statPD_zvU_s1_standardUC_pref>

        <statPD_zvU_s1_standardUC_number>222222222</statPD_zvU_s1_standardUC_number>

        <statPD_zvU_s1_standardUC_kBN>2000</statPD_zvU_s1_standardUC_kBN>

        <statPD_zvU_s1_nostandardUC_number>999</statPD_zvU_s1_nostandardUC_number>

    </item>

</roor>

Thanks you All

Michal

Former Member
Not what you were looking for? View more on this topic or Ask a question