cancel
Showing results for 
Search instead for 
Did you mean: 

Flat file to Idoc mapping

Former Member
0 Kudos

Hello all,

I have a flat file with 3 rows and want them to map to 1 idoc, with multiple line items in it (PORDCR101 with multiple line item segments).

Does anyone have a good example or document abourt this?

thanks,

Job

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Did you see this solution

/people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping

And this one too,

/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping

In the 2nd link you should be having one idoc instead of multiple.

Please let me if if it helped you,

Regards,

Anirban.

Former Member
0 Kudos

Sorry Anirban,

That didn't help, I'm doing graphical mapping and I have seen both articles, but thanks anyway.

regards,

Job

Former Member
0 Kudos

Hi,

Happens at times, but this one uses message mapping to post PORDCR and message type PORDCR04.

Please have a look.

/people/ravikumar.allampallam/blog/2005/03/03/creating-purchase-order-idoc-through-xi

Did it help this time?

Regards,

Anirban.

Former Member
0 Kudos

Sorry no,

I know how to post an idoc in an application point of view, my problem is to create the right structure with multiple items. If I have 1 item I can post the idoc.

thanks,

Job

Former Member
0 Kudos

--

Former Member
0 Kudos

Hi Job,

Do your want the source and target structures to resemble the structures below?

Source:-

<source_file>

-


<row_1>

-


<item_a>

-


<item_b>

-


<item_c>

-


</row_1>

-


<row_2>

-


<item_p>

-


<item_q>

-


<item_r>

-


</row_2>

-


<row_3>

-


<item_x>

-


<item_y>

-


<item_z>

-


</row_3>

</source_file>

Target:-

<target_idoc>

-


<item_a>

-


<item_b>

-


<item_c>

-


<item_p>

-


<item_q>

-


<item_r>

-


<item_x>

-


<item_y>

-


<item_z>

</target_idoc>

If so, then all you need to do is to use the node function: "remove context" for all the items under your rows. In other words,do the following mapping:-

*source_file mapped to target_idoc

*map each of the items under all the three rows in the following way:-

"source item" mapped to "remove context" (node function) mapped to (corresponding) "target item".

Also check the occurences for each of your variables in both source and target structures.

You can also go through the blog

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

in which remove context has been explained with example.

Regards

Sushumna

Former Member
0 Kudos

Hi Sushumna,

No I don't think so.

I have a flat file with in each row header and item information. This file needs to be mapped to Idoc PORDCR101. The problem is that when I map the rows to f.e. the item segment and the accounting segment, the structure of the Idoc is gone. The Idoc looks like this then:

Header, Item, Item, Item, Accounting segment, Accounting segment, Accounting segment. And it should be like:

Header, Item, Accounting, Item, Accounting.

So this is in short the difficulty.

Thanks,

job

Former Member
0 Kudos

Hi Job,

Looks like I haven't followed your question correctly.

I have done this kind of a scenario, but in order to help you..please post the structure of your source-file and the target-idoc.

Regards

Sushumna

Former Member
0 Kudos

Hi Sushuma,

here it is:

source-

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

<ns0:MT_Uddevalle xmlns:ns0="http://volvocars.ford.com/xi/AP/MPL">

<recordset>

<Row>

<Lifnr/>

<Belnr/>

<Parvw/>

<Menge/>

<Menee/>

<Vprei/>

<Ntgew/>

<Matnr/>

<Mat_ind/>

<ContractNumber/>

</Row>

</recordset>

</ns0:MT_Uddevalle>

target: idoc: PORDCR101

The problem is that the order of the idoc get disturbed.

3 times the item segment then 3 times the itemx segment and then 3 times the accounting segment. And of course it need to be 3 times the whole structure.

thanks,

Job

Former Member
0 Kudos

Hi Job,

Firstly, let me confirm what exactly you want to do:-

If you send a file with 3 such rows(as your row structure specifies), then you should be able to receive it in one idoc, under which each of these rows are shown as it is i.e as row1, then row2 and row3; and not separately as item, accounting, etc-right?

Now, please post how your idoc structure looks-if possible-a snapshot. Because, the solution depends upon your idoc's structure. If it resembles the file's strucure, then you dont have a problem-you can try graphical or even XSLT mapping, but if the structure has no row-concept, i.e. it is simply item, itemx, accounting-then you wont be able to map easily.

Also, I am not able to make out the different tags for item, itemx and accounting under the row stucture of your source file. Can you please illustrate.

Regards

Sushumna

Former Member
0 Kudos

Hi Sushumna ,

How do I get a snapshot in? the problem is solved, I thought the structure I used was not possible but it is.

Thanks again.

Job

former_member91687
Active Contributor
0 Kudos

Hi Job,

You can navigate thru these links to get more information:

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

http://help.sap.com/saphelp_nw04/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/ee/bf9640dc522f28e10000000a1550b0/frameset.htm

Regards,

Chandra