cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC-FILE mapping

Former Member
0 Kudos

Hi all,

I'm doing a file-idoc scenario and this is my out structure:

0000300027,xxxxxxxxxxxxxxxxxxxx,SOLD_TO,SHIP_TO,BILL_TO,0000300027,0000300016,0000300016

But I want the structure in 3 different rows like:

0000300027,xxxxxxxxxxxxxxxxxxxx,SOLD_TO,0000300027

0000300027,xxxxxxxxxxxxxxxxxxxx,SHIP_TO,0000300016

0000300027,xxxxxxxxxxxxxxxxxxxx,BILL_TO,0000300016

so is there a way to do it with FCC or with the mapping?

Thanks,

Srini

Edited by: Srinivas Davuluri on Jul 3, 2008 12:55 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Your output is with field seperator as ",".

You can take whole as Single String and then with UDF you can break it as per new rows in Result List

The logic will be to add new ROW after 4 Commas.

Thanks

swarup

Former Member
0 Kudos

Swarup,

I sorry let me re-phrase my question its actually IDOC-File.

--

Srini

Former Member
0 Kudos

I have done the mapping and thats my output flat file structure, but there been changes with the spec so I had to change the desired o/p accordingly. I want to know if I have to do it in FCC or mapping side and how?

former_member181962
Active Contributor
0 Kudos

Hi Srinivas,

It is very difficult to convert your current output to your required out put.

I would rather suggest you to create a new target structure

if your old structure is something like this

Root 1:1

--Record 0:unbounded

-


field1

-


field2

-


field3

-


field4

-


field5

-


field6

-


field7

-


field8

-


field9

change it to:

Root 1:1

--Record 0:unbounded

-


field1

-


field2

-


field3

-


field4

IN the message mapping map the record node to the The segment that has the partner data in the IDOC.

The fields should be appropriately mapped .

Finally you can use the content conversion in adapter.

Regards,

Ravi

Former Member
0 Kudos

Ya, but was just wondering if I could do it with FCC. Anyways thanks for the quick rply, I will post if any errors.

Thanks,

Srini

Former Member
0 Kudos

Ravi,

I can still have the same DT right just have to map record node to the the segment that has the partner data in the IDOC. I have also duplicated 2 of the target fields to get that particular o/p previously, all I have to do is remove the duplication right.

Any suggestions on my approach.

--

Srini

justin_santhanam
Active Contributor
0 Kudos

Srini,

Is it possible for you to give the current target structure? I'm sure it's possible through mapping and then in Content conversion.

raj.

Former Member
0 Kudos

Raj,

This is how I changed the target structure to,

MT

-DT

---Recordset (0..unbounded)

-


field1

-


field2

-


field3

-


field4

-


field5

---Record (0..unbounded)

-


partner field1 (SHIP_TO, SOLD_TO, BILL_TO)

-


partner field2 (100,200,100)

I want the output in this way:

field1,field2,field3,field4,field5,SHIP_TO,100

field1,field2,field3,field4,field5,SOLD_TO,200

field1,field2,field3,field4,field5,BILL_TO,100

Thanks,

Srini

Edited by: Srinivas Davuluri on Jul 6, 2008 7:18 PM

former_member194786
Active Contributor
0 Kudos

Hi Srinivas,

Use the node function useOneAsMany for your target nodes fields field1,field2,field3,field4,field5. Thus it will produce these fields for each value of partner field1or partner field2. Then you will have your target structure like you have mentioned above:

MT

-DT

---Recordset (0..unbounded)

-


field1

-


field2

-


field3

-


field4

-


field5

---Record (0..unbounded)

-


partner field1 (SHIP_TO, SOLD_TO, BILL_TO)

-


partner field2 (100,200,100)

Try it and let us know.

Regards,

Sanjeev.

Former Member
0 Kudos

Hi,

My target looks like this with some sample test data:

MT

-DT

---Recordset (0..unbounded)

-


field1

-


field2

-


field3

-


field4

-


field5

---Record (0..unbounded)

-


field1 (SHIP_TO)

-


field2 (100)

---Record (0..unbounded)

-


field1 (SOLD_TO)

-


field2 (200)

---Record (0..unbounded)

-


field1 (BILL_TO)

-


field2 (100)

This my source structure with the same sample data:

<DEBMAS06> (1..1)

---<IDOC> (1..1)

-


<E1KNA1M> (1..1)

-


<f1>field1</f1> (0..1)

-


<f2>field2</f2> (0..1)

-


<f3>field3</f3> (0..1)

-


<f4>field4</f4> (0..1)

-


<f5>field5</f5> (0..1)

-


<E1KNVVM> (0..unbounded)

-


<E1KNVPM> (0..unbounded)

-


<field1>SHIP_TO</field1> (0..1)

-


<field2>100</field2> (0..1)

-


</E1KNVPM>

-


<E1KNVPM>

-


<field1>SOLD_TO</field1>

-


<field2>200</field2>

-


</E1KNVPM>

-


<E1KNVPM>

-


<field1>BILL_TO</field1>

-


<field2>100</field2>

-


</E1KNVPM>

-


</E1KNVVM>

-


</E1KNA1M>

---</IDOC>

</DEBMAS06>

Even if I use the node function useOneAsMany I'm not able to produce result like this:

MT

-DT

---Recordset (0..unbounded)

-


field1

-


field2

-


field3

-


field4

-


field5

---Record (0..unbounded)

-


field1 (SHIP_TO)

-


field2 (100)

---Recordset (0..unbounded)

-


field1

-


field2

-


field3

-


field4

-


field5

---Record (0..unbounded)

-


field1 (SOLD_TO)

-


field2 (200)

---Recordset (0..unbounded)

-


field1

-


field2

-


field3

-


field4

-


field5

---Record (0..unbounded)

-


field1 (BILL_TO)

-


field2 (100)

Can you guys suggest what are the 3 input fields to the node function useOneAsMany and the context.

Thanks,

Srini

Edited by: Srinivas Davuluri on Jul 8, 2008 11:20 AM

former_member194786
Active Contributor
0 Kudos

Hi Srinivas,

<<<<Can you guys suggest what are the 3 input fields to the node function useOneAsMany and the context.>>>>>

For the useOneAsMany the 3 inputs are as following:

1) Here you will have to provide the field which you want to repeat n number of times.

2) Here you will provide the field based upon which you will determine how many times your 1st field should replicate itself.

3) Here you will provide the field based upon which the 1st field should replicate.

The 2nd and the 3rd fields can be same or different.

For more info refer this:

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

Regards,

Sanjeev.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

You can get the data in a single string or every field on a new line as you prefer. And then make use of useOneAsMany function in the message mapping.

See the below link for a workaround to convert flat file to nested structures -

[Convert Flat File to Deeply Nested XML Structures|http://www.riyaz.net/blog/index.php/2008/05/20/xipi-convert-flat-file-to-deeply-nested-xml-structures-using-only-graphical-mapping/]

Regards,

Riyaz

Former Member
0 Kudos

Hello,

You have to map IDoc Segment E1EDKA1.

Your qualifer for

Sold-To = AG,

Ship-To = WE ,

Bill-To = RE

Thanks & Regards,

Surya

former_member181962
Active Contributor
0 Kudos

Hi Srinivas,

YOur target structure should be declared as the 2nd structure that you have defined.

YOu mapping has tobe modified accordingly.

Regards,

Ravi Kanth Talagana