cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction repeater action not inserting all records of XML file

Former Member
0 Kudos

Hello,

I am new to xMII, as i have generated XML file from SAP to MII. Then while i trying to insert all XML item records into MII Database table. In my transaction, repeater action is not inserting all the records of XML. Its inserting last row of XML file.

Suppose if i have three items which have 5 fields

<tablenam>

<ITEM>

<field1>121<field1>

<field2>ert<field2>

<field3>drrt<field3>

<field4>feggt<field4>

<field5>1244<field5>

<ITEM/>

<ITEM>

<field1>122<field1>

<field2>hfhhs<field2>

<field3>ertergsdg<field3>

<field4>feggt<field4>

<field5>13244<field5>

<ITEM/>

<ITEM>

<field1>123<field1>

<field2>ert<field2>

<field3>drrt<field3>

<field4>feggt<field4>

<field5>1244<field5>

<ITEM/>

From above XML, its repeater inserting last item fields into the MII database table. But i want to insert all of them.

Can anyone help me regarding this issues.

Thanks,

Regards,

Praveen Reddy M

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Praveen,

For the example XML you have provided, One repeater and proper handling of output should do the job.

Provide the repeater XPath as "yourXML{/tablename/ITEM}". The repeater would run three times because there are three ITEM nodes.

The reason it is inserting only the last ITEM fields could be because, the results from the first and the second iteration are being overwritten by the last one. Check the logic after the repeater action block.

Regards,

Tufale Ashai

former_member246543
Participant
0 Kudos

Hi Pravin ,

Can you check where you have used the Sql Mapping? Is it inside the repeater or after the execution of repeater?

Configure the repeater upto the item node like this

Transaction.Test_OpXml{/tablenam/ITEM}

and yes it will take only one repeater .Previously i thought that the given xml is output of a repeater.sorry for the mistake.

Regards,

Sanjeev

Answers (4)

Answers (4)

agentry_src
Active Contributor
0 Kudos

Hi Praveen,

It sounds like you are inserting xml into a property repeatedly overwriting the previous entry, so that once the repeater gets to the last set of data, that is what remains.

Look inside your Link Editor and Instead of inserting xml, you need to set the link type to AppendXML (or depending on your property, perhaps AppendAfterXML). Do some testing to see which works best for you.

Regards,

Mike

Former Member
0 Kudos

Hi to All,

In the SQL query block below the repeater, i have mapped with the XML repeater's output item-fields with the Parameters of SQL query. It worked.

Thanks for all response and answers.

Kind Regards,

Praveen Reddy M

Former Member
0 Kudos

Hi Praveen,

Please use the Query Messages action (Message Services) to read the XML which you are getting from SAP and post it here for us to help you.

Regards,

Manish Jain

Former Member
0 Kudos

Hi Praveen ,

In the repeater XPath Expression give the path till /ITEM

For Example

JCOACTIONBLOCKNAME.Response{/BAPI_NAME/XXXX/tablenam/ITEM}

Something lik this.

You can Access the values after the repeater by giving the path

Repeat_1.Output{/ITEM/field1}

Here in this case i have considered Repeat_1 as the repeater action blocks name.

Thanks,

Selva

Former Member
0 Kudos

Thanks for quick response.

But the XML is generting from SAP through Message Listener, not from Jco interface.

And while i am mapping in repeater to SQL query action block, its showing three item lists and to which i need to map i didn't understand.

Whether i need to change XML format into MII XML format or how can i pass or map parameters to the query parameters.

Thanks,

Kind Regards,

Praveen Reddy M

Former Member
0 Kudos

No need to change XML to the MII format .You can map it directly to the repeater.

The 3 items you are seeing is because there are 3 items present in your XML i think.

If you select anything the path will be same.

Provide the whole XML which will help me to give you the exact path u need to put into the repeater XPath Expression

Regards,

Selva

former_member246543
Participant
0 Kudos

Hi Praveen,

Can you share the orignal xml file.

From what you have have written it seems that you may require 2 repeaters, One to repeat on all the Item and another to repeat on all the contents of every Item.

Regards,

Sanjeev