cancel
Showing results for 
Search instead for 
Did you mean: 

Flat File to IDOC Scenario

Former Member
0 Kudos

I am working on the following scenario:

Flat CSV orders file to a Orders IDOC.

The input file has data like

a,b,c,d,e,f,g,h...

a,b,c,d,e,f,g,h...

......

......

We need to generate ONE IDOC per file. The complexity lies in the mapping.

The segments generated in the IDOC and the number of times they are generated all depends on the values of a,b and c and the segment fields are mapped to values either from the file or mapped to some constants or are figured out based on some logic depending upon what value a,b or c has and what range of values c has.

Overall, quite a complex mapping.

The way I am trying to work is:

1. Create Outbound MI ABC based on the File Structure:

<Record> 0 to unbounded

<a></a> 1..1

<b></b> 1..1

<c></c> 1..1

....

2. Do file content conversion in Sender File adapter.

3. Import the Orders02 idoc in the IR.

4.Create a message mapping with ABC as source and Orcers02 IDOC as target.

5. Now with mapping, I am trying to use createif for every IDOC segment node. The logic is to create this node if the condition is true ( i.e a=somevalue else do not create).I am definig UDF for evaluating these conditions.

6. Then I map the fields of the generated segment node to either the values from the source or some values generated by UDFs based on some criteria.

I am still in the mapping phase and I just wanted to know if this was a correct approach to acheive this. So far, I am mapping one node and when I check in the output it works okay.

My question is :

1. I would end up using lots of UDFs for every input record and for every record of input, each UDF will be called again and again.

2. Does anyone know of any better approach to achieve this?

3. If a segment appears more than one time, let us say generate segment E1TDK01 if a=1, and a could be 1 in multiple records that means generating multiple E1TDK01 segments, is there anything that needs to be taken care of? I see in the target structure that this segment can occur 0 to 99 times, so will this segment be generated 5 times if my file had a=1 in 5 records?

Please help me understand this and any pointers to existing weblogs will also be appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try this and this should resolve your issue:

1. Import IDOC into repository

2. After import, download the wsdl of the imported IDOc into your file system

3. Open the wsdl and insert code at the IDOC tag ===> minOccurs=0, maxOccurs=unbounded (Pl follow correct syntax, I may not be right on syntax)

4. save the file

5. imported the modified wsdl into repository and use this one in the message mapping

6. In message mapping, messages tab change the occurances to 0 to Unbounded for the modified wsdl IDOC

7. Do the same thing in interface mapping

Hope this helps.

TNV