cancel
Showing results for 
Search instead for 
Did you mean: 

File2IDoc: Mixed row (header and item) without item number

Former Member
0 Kudos

Hello,

I have to define a file2Idoc scenario for orders. The file is a CSV, the IDoc ORDER05.

The problem is the structure of the file, there is no prefix for header or item, the header and item is mixed in one row, without itemnumber. The only key field is the order number.

There are more than one order in a file, but it´s sorted by the order number.

Any idea?

In a select statement we would use the grouping-by clause.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Thomas,

In the CSV file lets consider the first line which contains the header and item.

Say if you are having the no of fields that corresponding to the header then you can put that many no of fields into your header structure and the rest you can move to the item structure.

This can be achieved only if in the file line item, there are 9 commas for the 10 fields for the header and then this can be extended for your item fields too..

Cheers

JK

Former Member
0 Kudos

Hi JK,

I know this possibility and used it in further project, but here the structure of the file is fixed. The customer do not want to change it.

The structure looks like this:

Client,BillToNo,ChipToNo,OrderNo,ProductNo,Quantity

There are several rows in one file for the same order, and no position number.

I think I have to read row by row, but then in the mappping I have to check when the order number is changing. In an ABAP internal table it´s easy, but how to do this in the graphical mapping?

Former Member
0 Kudos

I think I have to read row by row, but then in the

mapping I have to check when the order number is

changing. In an ABAP internal table it´s easy, but

how to do this in the graphical mapping?

Thomas,

You can use a two-step mapping; If you read the rows one-by-one then you can use the Node function "splitByValue" which allows you to insert a context change based on events (your event will be the existence of a new order no. in the input, for this check you can use a simple Java routine). After that you will have individual rows grouped by Order No. Then you need to pass this first output to the second mapping which will do the real mapping/apply business-logic you need to do.

Cheers,

Roberto

Former Member
0 Kudos

Hi Roberto,

thanks for your answer. I thought about such a way in one mapping, but didn´t know how to remember the values and map them in one step.

I will try this tomorrow. Do I need a BPM? I think it´s possible to run 2 mapping in the Interface Mapping.

former_member184154
Active Contributor
0 Kudos

No need for BPM.

You can put as many message mapping as you need in an interface mapping (the result of the previous mapping being the source of the following mapping).

To remember values use the <a href="http://help.sap.com/saphelp_nw04/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm">GlobalContainer</a> object in a UDF.

Alex

Answers (1)

Answers (1)

STALANKI
Active Contributor
0 Kudos

Use a generic file adapter configuration .Pick up the file and do a java mapping for generation intermediate structure and use message mapping to do one-one.your problem will be solved.

/people/sravya.talanki2/blog/2006/01/10/re-usable-frame-work-in-xi

/people/sravya.talanki2/blog/2005/08/16/configuring-generic-sender-file-cc-adapter

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

3 weblogs will be helpful for u.