cancel
Showing results for 
Search instead for 
Did you mean: 

XML To Grid Format

Former Member
0 Kudos

Hi all,

     I have got data from RSAQ_REMOTE_QUERY_CALL in xml data. I need to format that data in grid view. In that <LINE> tag gives column value and <FDESC> tag gives Feild description respectively Below i have mentioned my xml data.

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

<RSAQ_REMOTE_QUERY_CALL>

<INPUT>

  <DATA_TO_MEMORY>X</DATA_TO_MEMORY>

  <DBACC>0</DBACC>

  <EXTERNAL_PRESENTATION>X</EXTERNAL_PRESENTATION>

  <QUERY>ZVBAP</QUERY>

  <SKIP_SELSCREEN>X</SKIP_SELSCREEN>

  <USERGROUP>SYSTQV000048</USERGROUP>

  <VARIANT>VAR</VARIANT>

  <WORKSPACE />

  </INPUT>

<OUTPUT>

  <LISTTEXT>REPORT PROG PRAC</LISTTEXT>

  <LIST_ID>G00</LIST_ID>

  <PROGRAM>AQTGSYSTQV000048ZVBAP=========</PROGRAM>

  <USED_VARIANT>VAR</USED_VARIANT>

  </OUTPUT>

<TABLES>

<FPAIRS>

<item>

  <INDEX_A>0007</INDEX_A>

  <INDEX_U>0008</INDEX_U>

  <TYPE>E</TYPE>

  </item>

  </FPAIRS>

<LDATA>

<item>

  <LINE>002:OR,004:0001,002:01,007:SCEM_02,000:, 002:PC;/</LINE>

  </item>

  </LDATA>

<LISTDESC>

<item>

  <FADD />

  <FDESC>Sales Organization</FDESC>

  <FNAME>VBAK-VKORG</FNAME>

  <FCOL>SOrg.</FCOL>

  <FNAMENEW>VBAK-VKORG</FNAMENEW>

  <FNAMEINT>VKORG</FNAMEINT>

  <FKEY />

  <FGTYP />

  <FNZERO />

  <FSUM />

  <FSONLY />

  <FSORT>00</FSORT>

  <FSODS />

  <FSUBT />

  <FLPOS>0002</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT />

  <FNOSUM />

  <FSONP />

  </item>

<item>

  <FADD />

  <FDESC>Distribution Channel</FDESC>

  <FNAME>VBAK-VTWEG</FNAME>

  <FCOL>DChl</FCOL>

  <FNAMENEW>VBAK-VTWEG</FNAMENEW>

  <FNAMEINT>VTWEG</FNAMEINT>

  <FKEY />

  <FGTYP />

  <FNZERO />

  <FSUM />

  <FSONLY />

  <FSORT>00</FSORT>

  <FSODS />

  <FSUBT />

  <FLPOS>0003</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT />

  <FNOSUM />

  <FSONP />

  </item>

<item>

  <FADD />

  <FDESC>Division</FDESC>

  <FNAME>VBAK-SPART</FNAME>

  <FCOL>Dv</FCOL>

  <FNAMENEW>VBAK-SPART</FNAMENEW>

  <FNAMEINT>SPART</FNAMEINT>

  <FKEY />

  <FGTYP />

  <FNZERO />

  <FSUM />

  <FSONLY />

  <FSORT>00</FSORT>

  <FSODS />

  <FSUBT />

  <FLPOS>0004</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT />

  <FNOSUM />

  <FSONP />

  </item>

<item>

  <FADD />

  <FDESC>Sold-to party</FDESC>

  <FNAME>VBAK-KUNNR</FNAME>

  <FCOL>Sold-to pt</FCOL>

  <FNAMENEW>VBAK-KUNNR</FNAMENEW>

  <FNAMEINT>KUNNR</FNAMEINT>

  <FKEY />

  <FGTYP />

  <FNZERO />

  <FSUM />

  <FSONLY />

  <FSORT>00</FSORT>

  <FSODS />

  <FSUBT />

  <FLPOS>0005</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT />

  <FNOSUM />

  <FSONP />

  </item>

<item>

  <FADD />

  <FDESC>Material Number Used by Customer</FDESC>

  <FNAME>VBAP-KDMAT</FNAME>

  <FCOL>Customer Material Number</FCOL>

  <FNAMENEW>VBAP-KDMAT</FNAMENEW>

  <FNAMEINT>KDMAT</FNAMEINT>

  <FKEY />

  <FGTYP />

  <FNZERO />

  <FSUM />

  <FSONLY />

  <FSORT>00</FSORT>

  <FSODS />

  <FSUBT />

  <FLPOS>0006</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT />

  <FNOSUM />

  <FSONP />

  </item>

<item>

  <FADD />

  <FDESC>Net Weight of the Item</FDESC>

  <FNAME>VBAP-NTGEW</FNAME>

  <FCOL>Net weight</FCOL>

  <FNAMENEW>VBAP-NTGEW</FNAMENEW>

  <FNAMEINT>NTGEW</FNAMEINT>

  <FKEY />

  <FGTYP />

  <FNZERO />

  <FSUM />

  <FSONLY />

  <FSORT>00</FSORT>

  <FSODS />

  <FSUBT />

  <FLPOS>0007</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT />

  <FNOSUM />

  <FSONP />

  </item>

  </LISTDESC>

  <SELECTION_TABLE />

  </TABLES>

  </RSAQ_REMOTE_QUERY_CALL>

I need get output as like below format.

Output: 

Sales Organization

Distribution Channel

Division

Sold-to party

Material Number Used by Customer

Net Weight of the Item

OR

0001

01

SCEM_02

null

PC

Please suggest me how to get this grid format from my xml data. Please reply as soon as possible.

Thanks in advance:)

Regards,

Glory

Accepted Solutions (1)

Accepted Solutions (1)

aravinth_anandhan
Active Participant
0 Kudos

Hi Glory,

Is your Header is fixed? i.e Sales Organization, Distribution Channel, Division.... only six fields are there?

Regards,

Aravinth

Former Member
0 Kudos

    Hi Aravindh,

No, Totally i have 9 fields in xml data. Do you how do to do this means please reply as soon as possible

Regards,

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi Glory,

I have tried using 6 fields, same from your XML structure. Pls let me know, always 9 fields will be there in your output or it is a dynamic fields.

Regards,

Aravinth

Former Member
0 Kudos

Hi Aravinth,

     Always there will be 9 fields in my xml input.. for data size purpose i have reduced it in forum.. Please share ur file in which u have tried for this forum..

Thanks in advance

Regards

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi Glory,

Pls refer the below figure, these are all the action blocks I have used

1. In document action, I have created 6 fields like Organization, Distribution Channel, Division....

2.Then I used STRING LIST TO XML PARSER action block to extract the values in LINE node, because it is comma separated. I referred this thread http://scn.sap.com/thread/1246762

3.Now map the string list to xml parser output to a repeater

4. Then I have created two local properties. First one is of type integer , this is for increment purpose and second one is of type XML, this is to store the extracted values from XML parser in line wise. My XML structure is like this,

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

<Rowset>

<Row/>

<Row/>

<Row/>

<Row/>

<Row/>

<Row/>

</Rowset>

5. Now I have used assignment action block to assign extracted value to the local XML. Refer the below pic

In this block, I used the below expression to assign incremented value to my local property. Ins is my local property name.

Local.Ins+1

And I used the below expression to assign values to local XML, we need to remove 002:... from extracted value, so I used string functions to do the same.

stringright(Repeater_1.Output{/Row/Item}, stringlength(Repeater_1.Output{/Row/Item})-stringindexof(Repeater_1.Output{/Row/Item},":"))

In target Xpath I have used

Local.String{/Rowset/Row[#Local.Ins#]}

String is my local XML property name

6. Finally I used Row action block to assign these values to the Document. For this we need to mention the row numbers in expression like this

Local.String{/Rowset/Row[1]}

And last value in LINE node is  002:PC;/, we removed only 002: from this value, but last two characters are ;/. To remove this, I used

stringleft(Local.String{/Rowset/Row[6]}, stringlength(Local.String{/Rowset/Row[6]})-2)

I am getting the following output from this transaction,

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

<Rowsets DateCreated="2012-06-26T19:16:22" EndDate="2012-06-26T14:30:49" StartDate="2012-06-26T14:30:49" Version="12.2.3 Build(182)">

    <Rowset>

        <Columns>

            <Column Description="" MaxRange="1" MinRange="0" Name="Sales_Org" SQLDataType="1" SourceColumn="Sales_Org"/>

            <Column Description="" MaxRange="1" MinRange="0" Name="Dist_Ch" SQLDataType="1" SourceColumn="Dist_Ch"/>

            <Column Description="" MaxRange="1" MinRange="0" Name="Division" SQLDataType="1" SourceColumn="Division"/>

            <Column Description="" MaxRange="1" MinRange="0" Name="Sold_to_Party" SQLDataType="1" SourceColumn="Sold_to_Party"/>

            <Column Description="" MaxRange="1" MinRange="0" Name="MatNo" SQLDataType="1" SourceColumn="MatNo"/>

            <Column Description="" MaxRange="1" MinRange="0" Name="Net_Weight" SQLDataType="1" SourceColumn="Net_Weight"/>

        </Columns>

        <Row>

            <Sales_Org>OR</Sales_Org>

            <Dist_Ch>0001</Dist_Ch>

            <Division>01</Division>

            <Sold_to_Party>SCEM_02</Sold_to_Party>

            <MatNo/>

            <Net_Weight>PC</Net_Weight>

        </Row>

    </Rowset>

</Rowsets>

If I missed anything in this post, kindly let me know.

Regards,

Aravinth

Former Member
0 Kudos

Hi Aravinth,

     Where you loading input xml data in above trx?

     While adding feilds in Document action block am getting Error as " Invalid character exists in XML column name" Please let me know where i did wrong??

   

Regards,

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi Glory,

While adding field in Document action, space is not allowed, so use underscore "_" instead of space.

I created one local parameter of type XML and copied your XML structure there. Then I mapped my local parameter's LINE node to STRING LIST TO XML PARSER. In your case, if you are getting that XML output from any BAPI or RFC, map that output to string list to XML parser action.

Note: As you told, your field header is 9 and it is fixed. So I created all field (Field names) in Document action and you are having line items(values) in LINE node as comma seperated. For that reason I used STRING LIST TO XML PARSER to extract values in line wise.

Regards,

Aravinth

Former Member
0 Kudos

Hi Aravinth,

Thanks for ur reply,

Can you please upload ur link properties as image for all action blocks ?? It will be more useful for me

Regards

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi,

Regards,

Aravinth

Former Member
0 Kudos

Hi Aravinth,

     Kindly upload ur links images for all action blocks. It will be more useful for me..I am getting error while running it.. Sorry for troubles

Regards

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi,

Which version of MII are you using? If you are using 12.2, debug your trx. Or let me know, what error you are getting?

Regards,

Aravinth

Former Member
0 Kudos

Hi Aravinth,

Am using MII12.1.8.. Please let me know what value should i pass through Local String parameter?

Regards,

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi,

Pass repeater output to Local String(Name i have given as string, but it is of type XML) using Assignment action block. Refer point 5 of my previous post.

Regards,

Aravinth

Former Member
0 Kudos

Hi,

Am getting error in Assignment Action block as follows

"

[ERROR] [Assignment_0] Link ('Local.String{/Rowset/Row[#Local.Ins#]}' [Assign] from "stringright(Repeater_0.Output{/Row/Item}, stringlength(Repeater_0.Output{/Row/Item})-stringindexof(Repeater_0.Output{/Row/Item},":"))") execution threw an exception. Exception: [No nodes found in variable 'Local.String' and xpath: "/Rowset/Row[#Local.Ins#]" XML was:] "

Former Member
0 Kudos

Hi,

     Thanks for ur valid reply.. Kindly upload ur links images for Assignment,Row,Repeater Action block since am getting error in this.

Regards,

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi Glory,

I think the error is bcoz of your local XML structure. Can you post your local XML structure?

Regards,

Aravinth

Former Member
0 Kudos

Hi Aravinth,

      This is my xml structure with nine feilds, this only i have given in local XML structure..

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

<RSAQ_REMOTE_QUERY_CALL>

<INPUT>

  <DATA_TO_MEMORY>X</DATA_TO_MEMORY>

  <DBACC>0</DBACC>

  <EXTERNAL_PRESENTATION>X</EXTERNAL_PRESENTATION>

  <QUERY>ZVBAP</QUERY>

  <SKIP_SELSCREEN>X</SKIP_SELSCREEN>

  <USERGROUP>SYSTQV000048</USERGROUP>

  <VARIANT>VAR</VARIANT>

  <WORKSPACE/>

  </INPUT>

<OUTPUT>

  <LISTTEXT>REPORT PROG PRAC</LISTTEXT>

  <LIST_ID>G00</LIST_ID>

  <PROGRAM>AQTGSYSTQV000048ZVBAP=========</PROGRAM>

  <USED_VARIANT>VAR</USED_VARIANT>

  </OUTPUT>

<TABLES>

<FPAIRS>

<item>

  <INDEX_A>0007</INDEX_A>

  <INDEX_U>0008</INDEX_U>

  <TYPE>E</TYPE>

  </item>

  </FPAIRS>

<LDATA>

<item>

  <LINE>002:OR,004:0001,002:01,002:01,007:SCEM_02,000:,007:590,000,002:KG,002:PC;/</LINE>

  </item>

  </LDATA>

<LISTDESC>

<item>

  <LID>G00</LID>

  <FPOS>01</FPOS>

  <FCONT>0</FCONT>

  <FCURPOS>000</FCURPOS>

  <FGRAF/>

  <FTYP>C</FTYP>

  <FLEN>008</FLEN>

  <FDEC>00</FDEC>

  <FOLEN>004</FOLEN>

  <FCUR/>

  <FADD/>

  <FDESC>Sales Document Type</FDESC>

  <FNAME>VBAK-AUART</FNAME>

  <FCOL>SaTy</FCOL>

  <FNAMENEW>VBAK-AUART</FNAMENEW>

  <FNAMEINT>AUART</FNAMEINT>

  <FKEY/>

  <FGTYP/>

  <FNZERO/>

  <FSUM/>

  <FSONLY/>

  <FSORT>00</FSORT>

  <FSODS/>

  <FSUBT/>

  <FLPOS>0001</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT/>

  <FNOSUM/>

  <FSONP/>

  </item>

<item>

  <LID>G00</LID>

  <FPOS>02</FPOS>

  <FCONT>0</FCONT>

  <FCURPOS>000</FCURPOS>

  <FGRAF/>

  <FTYP>C</FTYP>

  <FLEN>008</FLEN>

  <FDEC>00</FDEC>

  <FOLEN>004</FOLEN>

  <FCUR/>

  <FADD/>

  <FDESC>Sales Organization</FDESC>

  <FNAME>VBAK-VKORG</FNAME>

  <FCOL>SOrg.</FCOL>

  <FNAMENEW>VBAK-VKORG</FNAMENEW>

  <FNAMEINT>VKORG</FNAMEINT>

  <FKEY/>

  <FGTYP/>

  <FNZERO/>

  <FSUM/>

  <FSONLY/>

  <FSORT>00</FSORT>

  <FSODS/>

  <FSUBT/>

  <FLPOS>0002</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT/>

  <FNOSUM/>

  <FSONP/>

  </item>

<item>

  <LID>G00</LID>

  <FPOS>03</FPOS>

  <FCONT>0</FCONT>

  <FCURPOS>000</FCURPOS>

  <FGRAF/>

  <FTYP>C</FTYP>

  <FLEN>004</FLEN>

  <FDEC>00</FDEC>

  <FOLEN>002</FOLEN>

  <FCUR/>

  <FADD/>

  <FDESC>Distribution Channel</FDESC>

  <FNAME>VBAK-VTWEG</FNAME>

  <FCOL>DChl</FCOL>

  <FNAMENEW>VBAK-VTWEG</FNAMENEW>

  <FNAMEINT>VTWEG</FNAMEINT>

  <FKEY/>

  <FGTYP/>

  <FNZERO/>

  <FSUM/>

  <FSONLY/>

  <FSORT>00</FSORT>

  <FSODS/>

  <FSUBT/>

  <FLPOS>0003</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT/>

  <FNOSUM/>

  <FSONP/>

  </item>

<item>

  <LID>G00</LID>

  <FPOS>04</FPOS>

  <FCONT>0</FCONT>

  <FCURPOS>000</FCURPOS>

  <FGRAF/>

  <FTYP>C</FTYP>

  <FLEN>004</FLEN>

  <FDEC>00</FDEC>

  <FOLEN>002</FOLEN>

  <FCUR/>

  <FADD/>

  <FDESC>Division</FDESC>

  <FNAME>VBAK-SPART</FNAME>

  <FCOL>Dv</FCOL>

  <FNAMENEW>VBAK-SPART</FNAMENEW>

  <FNAMEINT>SPART</FNAMEINT>

  <FKEY/>

  <FGTYP/>

  <FNZERO/>

  <FSUM/>

  <FSONLY/>

  <FSORT>00</FSORT>

  <FSODS/>

  <FSUBT/>

  <FLPOS>0004</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT/>

  <FNOSUM/>

  <FSONP/>

  </item>

<item>

  <LID>G00</LID>

  <FPOS>05</FPOS>

  <FCONT>0</FCONT>

  <FCURPOS>000</FCURPOS>

  <FGRAF/>

  <FTYP>C</FTYP>

  <FLEN>020</FLEN>

  <FDEC>00</FDEC>

  <FOLEN>010</FOLEN>

  <FCUR/>

  <FADD/>

  <FDESC>Sold-to party</FDESC>

  <FNAME>VBAK-KUNNR</FNAME>

  <FCOL>Sold-to pt</FCOL>

  <FNAMENEW>VBAK-KUNNR</FNAMENEW>

  <FNAMEINT>KUNNR</FNAMEINT>

  <FKEY/>

  <FGTYP/>

  <FNZERO/>

  <FSUM/>

  <FSONLY/>

  <FSORT>00</FSORT>

  <FSODS/>

  <FSUBT/>

  <FLPOS>0005</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT/>

  <FNOSUM/>

  <FSONP/>

  </item>

<item>

  <LID>G00</LID>

  <FPOS>06</FPOS>

  <FCONT>0</FCONT>

  <FCURPOS>000</FCURPOS>

  <FGRAF/>

  <FTYP>C</FTYP>

  <FLEN>070</FLEN>

  <FDEC>00</FDEC>

  <FOLEN>035</FOLEN>

  <FCUR/>

  <FADD/>

  <FDESC>Material Number Used by Customer</FDESC>

  <FNAME>VBAP-KDMAT</FNAME>

  <FCOL>Customer Material Number</FCOL>

  <FNAMENEW>VBAP-KDMAT</FNAMENEW>

  <FNAMEINT>KDMAT</FNAMEINT>

  <FKEY/>

  <FGTYP/>

  <FNZERO/>

  <FSUM/>

  <FSONLY/>

  <FSORT>00</FSORT>

  <FSODS/>

  <FSUBT/>

  <FLPOS>0006</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT/>

  <FNOSUM/>

  <FSONP/>

  </item>

<item>

  <LID>G00</LID>

  <FPOS>07</FPOS>

  <FCONT>0</FCONT>

  <FCURPOS>000</FCURPOS>

  <FGRAF/>

  <FTYP>P</FTYP>

  <FLEN>008</FLEN>

  <FDEC>03</FDEC>

  <FOLEN>019</FOLEN>

  <FCUR>M</FCUR>

  <FADD/>

  <FDESC>Net Weight of the Item</FDESC>

  <FNAME>VBAP-NTGEW</FNAME>

  <FCOL>Net weight</FCOL>

  <FNAMENEW>VBAP-NTGEW</FNAMENEW>

  <FNAMEINT>NTGEW</FNAMEINT>

  <FKEY/>

  <FGTYP/>

  <FNZERO/>

  <FSUM/>

  <FSONLY/>

  <FSORT>00</FSORT>

  <FSODS/>

  <FSUBT/>

  <FLPOS>0007</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT/>

  <FNOSUM/>

  <FSONP/>

  </item>

- <item>

  <LID>G00</LID>

  <FPOS>08</FPOS>

  <FCONT>0</FCONT>

  <FCURPOS>000</FCURPOS>

  <FGRAF/>

  <FTYP>C</FTYP>

  <FLEN>006</FLEN>

  <FDEC>00</FDEC>

  <FOLEN>003</FOLEN>

  <FCUR>E</FCUR>

  <FADD/>

  <FDESC>Weight Unit</FDESC>

  <FNAME>VBAP-GEWEI</FNAME>

  <FCOL>WUn</FCOL>

  <FNAMENEW>VBAP-GEWEI</FNAMENEW>

  <FNAMEINT>GEWEI</FNAMEINT>

  <FKEY/>

  <FGTYP/>

  <FNZERO/>

  <FSUM/>

  <FSONLY/>

  <FSORT>00</FSORT>

  <FSODS/>

  <FSUBT/>

  <FLPOS>0008</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT/>

  <FNOSUM/>

  <FSONP/>

  </item>

<item>

  <LID>G00</LID>

  <FPOS>09</FPOS>

  <FCONT>0</FCONT>

  <FCURPOS>000</FCURPOS>

  <FGRAF/>

  <FTYP>C</FTYP>

  <FLEN>006</FLEN>

  <FDEC>00</FDEC>

  <FOLEN>003</FOLEN>

  <FCUR/>

  <FADD/>

  <FDESC>Sales unit</FDESC>

  <FNAME>VBAP-VRKME</FNAME>

  <FCOL>SU</FCOL>

  <FNAMENEW>VBAP-VRKME</FNAMENEW>

  <FNAMEINT>VRKME</FNAMEINT>

  <FKEY/>

  <FGTYP/>

  <FNZERO/>

  <FSUM/>

  <FSONLY/>

  <FSORT>00</FSORT>

  <FSODS/>

  <FSUBT/>

  <FLPOS>0009</FLPOS>

  <FNUMB>98</FNUMB>

  <FNUMBT/>

  <FNOSUM/>

  <FSONP/>

  </item>

  </LISTDESC>

  <SELECTION_TABLE/>

  </TABLES>

  </RSAQ_REMOTE_QUERY_CALL>

Kindly upload ur links images for those three action blocks

Regards

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi Glory,

For test case I used this XML structure in local property, but in ur case values will come dynamically from RFC or BAPI (i guess). Why you are trying to give this structure in local property? pls clarify..

Regards,

Aravinth

aravinth_anandhan
Active Participant
0 Kudos

Hi,

I guess, you created an local variable in the name of String as XML type and copied the above XML structure in it. Am I correct?

Regards,

Aravinth

Former Member
0 Kudos

Hi

     Yes, i copied XML structure to local variable. Is that correct way?

Regards

Glory

Former Member
0 Kudos

Hi Aravinth,

     Please upload ur links images in assignment,row,Repeater action blocks So that i can rectify error in this.

Regards,

Glory

Former Member
0 Kudos

Hi Aravinth,

     Please upload ur links images in assignment,row,Repeater action blocks So that i can rectify error in this.

Regards,

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi Glory,

For Repeater :

For Row action:

for Assignment link, refer point 5 in my previous post

Regards,

Aravinth

aravinth_anandhan
Active Participant
0 Kudos

Hi,

This is not correct. In my previous post refer 4th point. Copy the below structure to your local XML parameter. As I told you before, i tested for 6 fields, but you add three more Row

in it.

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

<Rowset>

<Row/>

<Row/>

<Row/>

<Row/>

<Row/>

<Row/>

</Rowset>

Regards,

Aravinth

Former Member
0 Kudos

Hi Aravinth,

     Thanks for ur valuable posts I have add xml structure with 9 row tags in local String parameter.

but then also while executing am getting following error "

  • [ERROR] [Assignment_0] Link ('Local.String{/Rowset/Row[#Local.Ins#]}' [Assign] from "stringright(Repeater_0.Output{/Row/Item}, stringlength(Repeater_0.Output{/Row/Item})-stringindexof(Repeater_0.Output{/Row/Item},":"))") execution threw an exception. Exception: [No nodes found in variable 'Local.String' and xpath: "/Rowset/Row[#Local.Ins#]" XML was: OR 0001 01 01 SCEM_02 590 000 KG ]
  • [ERROR] [Assignment_0] Action: Runtime threw an exception. Exception: [No nodes found in variable 'Local.String' and xpath: "/Rowset/Row[#Local.Ins#]" XML was: OR 0001 01 01 SCEM_02 590 000 KG ] "

Please solve this issue

Regards

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi Glory,

Go to your Assignment action block, select the link of string property and click evaluate.

do you find any error?

Regards,

Aravinth

aravinth_anandhan
Active Participant
0 Kudos

Hi,

I hope you are using second XML structure(XML having 9 field names), did you notice your LINE node in that XML

  <LINE>002:OR,004:0001,002:01,002:01,007:SCEM_02,000:,007:590,000,002:KG,002:PC;/</LINE>

it contains 10 values. Please make sure, only 9 values should be there. Pls revert back.

Regards,

Aravinth

Former Member
0 Kudos

Hi Aravinth,

     I dint find error in this evaluate action. But while executing it is showing error.

Finally i have added xml saver action block to save document output in that am not getting correct data as output. Below i have shown ouput from XML Saver Action Block

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

- <Rowsets DateCreated="2012-06-27T17:17:21" EndDate="2012-06-27T09:12:33" StartDate="2012-06-27T09:12:33" Version="12.1.8 Build(20)">

- <Rowset>

- <Columns>

<Column Description="" MaxRange="1" MinRange="0" Name="Sales_Doc_Type" SQLDataType="1" SourceColumn="Sales_Doc_Type" />

<Column Description="" MaxRange="1" MinRange="0" Name="Sales_Org" SQLDataType="1" SourceColumn="Sales_Org" />

<Column Description="" MaxRange="1" MinRange="0" Name="Distribution_Channel" SQLDataType="1" SourceColumn="Distribution_Channel" />

<Column Description="" MaxRange="1" MinRange="0" Name="Division" SQLDataType="1" SourceColumn="Division" />

<Column Description="" MaxRange="1" MinRange="0" Name="Sold_to_party" SQLDataType="1" SourceColumn="Sold_to_party" />

<Column Description="" MaxRange="1" MinRange="0" Name="Material_Customer" SQLDataType="1" SourceColumn="Material_Customer" />

<Column Description="" MaxRange="1" MinRange="0" Name="Net_Weight" SQLDataType="1" SourceColumn="Net_Weight" />

<Column Description="" MaxRange="1" MinRange="0" Name="Weight_Unit" SQLDataType="1" SourceColumn="Weight_Unit" />

<Column Description="" MaxRange="1" MinRange="0" Name="Sales_Unit" SQLDataType="1" SourceColumn="Sales_Unit" />

</Columns>

- <Row>

<Sales_Doc_Type>OR</Sales_Doc_Type>

<Sales_Org>0001</Sales_Org>

<Distribution_Channel>01</Distribution_Channel>

<Division /> X
<Sold_to_party>SCEM_02</Sold_to_party>

<Material_Customer />

<Net_Weight>590</Net_Weight>

<Weight_Unit>000</Weight_Unit> X
<Sales_Unit /> X

</Row>

</Rowset>

</Rowsets>

I have marked X for wrong values in xml..

Please solve this issue

Regards,

Glory

Former Member
0 Kudos

Hi Aravinth

It has nine value only. Consider 590,000 as one value for the description "Net Weight of Item"

Regards

Glory

aravinth_anandhan
Active Participant
0 Kudos

Hi Glory,

In String_To_XML_Parser action block, we have given comma as delimiter. So it will split 590 as one value and 000 as another value.

Regards,

Aravinth

agentry_src
Active Contributor
0 Kudos

Hi Glory and Aravinth,

When you have mixed delimiters with content (comma is your delimiter but is also the decimal separator), you can either switch to a different delimeter such as a tilda (~) or you can do a laborious stringpart extraction for the entire <LINE> field into each of the XMII XML Document row items. (I lean towards using a different delimiter in the BAPI, but have used both methods successfully).

Regards, Mike

agentry_src
Active Contributor
0 Kudos

Hi Glory,

If you do not have the option of changing the delimiter in the BAPI, then learn how to extract the pieces of LINE using stringpart in the Expression Editor for the Assignment part of the Add Row action block.

I would also recommend that you download some of the MII projects available from SCN.  The techniques that  Aravinth has been so patiently explaining are in many of the example transactions.  Or take a MII training course.  Most of this is basic skills which you would be learning there.

Regards, Mike

Answers (3)

Answers (3)

former_member185280
Active Contributor
0 Kudos

Glory, Did you ever take a look at the document on the xMII wiki that deals with this interface? I think I mentioned it in one of your threads a few weeks ago. If memory serves me right I am pretty sure it more or less lays out a step by step solution to the requirement you have been struggling with for several weeks now.

Former Member
0 Kudos

Hi christian,

Kindly share link for xMII wiki document for this interface

Regards,

Glory

former_member185280
Active Contributor
0 Kudos

You are savvy enough to find your way to this forum I imagine you are savvy enough to find your way to the xMII wiki.   If you know that a document that can help you exists and where it lives, why would you continue working on your requirement without taking the time and effort to find it?

HariCS23
Contributor
0 Kudos

Loop through your output table LDATA\Items and delimit your comma separated string using string functions. Convert to MII XML format by Loading data into 'document' action block  by the way explained by Seng.

Thanks

Hari

Former Member
0 Kudos

you have to transform xml file you have to XMII XML format. To do this, you can use Document and Row Action blocks (under SAP MII XML Output). See MII help file for more detail.

In short;

-you define your fields using Document actionblock.

-using Row action block, you can assign the value in the fields you defined in Document.

all the best