cancel
Showing results for 
Search instead for 
Did you mean: 

Map XML to Idoc

frank_thimm
Explorer
0 Kudos

Hi, I'm using SAP BC 4.7. I try to convert XML-File into an own Idoc.

The structure of XML-File is: one Header and N positions.

I've a problem to map the position recordlist from XML-File to the idoc.

In a LOOP-Step I map the positions in a recordlist, but in the Recordlist there is only the last record.

The flow looks the follwing:

map (Routing Rule Flow. Add your changes after this node.)

ftp

bytesToString

StringToDocument

documentToRecord

Map

BRANCH

Map

LOOP with two Map-Steps

Map

TransformHierarchyToFlat

Transport Service: OutboundProcess (Don't change the label(or name) of this node)

I tried to use out-array in the LOOP-Step, but it's created an Objectlist and I could not converted it to the Idoc.

Also I tried to use without out-array in the Loop-Step, but there ist only the last record in recordlist.

What can I do?

Thanks in advanced.

Frank

Accepted Solutions (1)

Accepted Solutions (1)

aashish_sinha
Active Contributor
0 Kudos

Hi,

I didn't understand this flow as you are using your logic. I just understand that you want to map the xml records to some IDoc which you are receiving using the routing rules you defiened in Administrator console.

Thats why your first step is that map and you are getting the thing there.

My concern is that, when you are looping over the xml records are you adding the values correctly to the resulting IDoc. I mean to say is that when you are mapping values from xml Record to IDoc , Is the values adding or its just over writing. Check this out will solve your problem

I guess its over writiing\.

Regards

Aashish Sinha

PS ; reward points if helpful

frank_thimm
Explorer
0 Kudos

Hi Aashish Sinha,

thank you for fast answering

sorry, that I am not clearly expressed.

I want to convert a XML-File into a Idoc structure an send it to SAP system.

I receive the XML-File by FTP. I tried some things and the way I wrote works.

I map the the position records into a recordlist reference. Then I loop over this recordlist an map all entries into a Idoc recordlist reference. This Idoc recordlist includes only the position part. After this I map these recordlist into the really Idoc structure.

How can I add the values correctly into the Idoc? I only map it.

If there is a easier way to map XML to Idoc, pls. let me know.

I'm just learning.

Thanks.

Frank

aashish_sinha
Active Contributor
0 Kudos

Hi,

>>I'm just learning

:).. Its relief now. ha ha.

OK. getting file from a SAP BC is ok, you used FTP and then you getting the xml file.

Now convert this xmlString to Document and try writing the whole document to your resulting structure as document and then convert it from document to recordlist and then append it to your empty IDoc structure.

The thing is that, you can directly use xmlString to make a documentlist. That is 2 step work. then loop over that document list and then write it to another or use this document list to convert to IDoc recordlist directly. I hope there must be some componets and then map to IDoc.

Hope this will help you.

Regards

Aashish Sinha

PS ; reward points if helpful

frank_thimm
Explorer
0 Kudos

sorry, Bad hair day

but where can I find XMLStringToDocument service?

And how can I add the records into Idoc without overwriting the entries in the target structure?

I think I need a step by step help.

many thanks.

Frank

frank_thimm
Explorer
0 Kudos

Hi,

Ive a new problem.

In the pipeline the Objectlist includes the following values:

0 [Lcom.wm.data.IData;@46fd59

1 [Lcom.wm.data.IData;@2275d8

2 [Lcom.wm.data.IData;@66cecc

How can I get Values from Objectlist into Idoc?

Thanks in advanced.

Frank

frank_thimm
Explorer
0 Kudos

Aashish Sinha, I'm so sorry.

Who can read is a clear advantage.

Now, I have convert to Idoc recordlist directly.

Many Thanks.

Frank

Answers (0)