cancel
Showing results for 
Search instead for 
Did you mean: 

FIle to IDOC Scenario

former_member593220
Participant
0 Kudos

Hi All,

Greetings..!

I have a scenario file to Idoc, where PI is getting a .CSV file with multiple records of employee hours. Here my requirement is, if .CSV file contains say for example one record is there which is having 1 Header and 3 Line Items in the file. Now PI need to create 3 Idocs with the same Header segment in all the three Idocs but with three different Item segments.

File input                             Idoc output need to create as


1st record                             1st  IDOC

Header 1                               Header 1

Item 1                                   Item 1

Item 2                                   2nd IDOC

Item 3                                   Header 1

                                            Item 2

                                            3rd IDOC

                                            Header 1

                                            Item 3

So please suggest me how I can achieve this in mapping.

Thanks a lot in advance..!

--

With Warm Regards

Raj

Accepted Solutions (1)

Accepted Solutions (1)

Harish
Active Contributor
0 Kudos

Hi Raj,

you can achieve this with graphical mapping. map IDOC node with item and change the idoc XSD as given in below wiki and blog

File to Multiple IDOC Splitting without BPM - Process Integration - SCN Wiki

regards,

Harish

former_member593220
Participant
0 Kudos

Hi Harish,

Thanks for your reply.

I have already done my mapping to create multiple Idoc like the same you are specified in the document.

But here my requirement is, if ITEM node are multiple the IDOC's should crate based on the no of ITEM's (nodes) with the same Header for all the IDOC's.

For instance.. I am getting a file from FTP, which will will contains no of Records. Here I will consider first record in that file. Say for example 1st record contains a Header node and ITEM are 3.

Then now as per my requirement I need to create 3 IDOC's as the no of ITEM's are 3 but with same Header in all these 3 IDOC's. If there are 5 ITEMs we need need to crate 5 IDOC's with respective to the particulate record.

So can you please tell me how I can achieve this and how I need to map the nodes to populate in this way..

Thanks in advance..!

--

Regards

Raj

former_member312864
Active Participant
0 Kudos

Hi,

You can achive this by using useOneAsMany node function.

map item node to iDoc --> it will create idocs based on number of items

use useOneAsMany node function on each header fields to required target fields

map item node to item of target

Regards,

former_member593220
Participant
0 Kudos

Hi Parida,

Thank you.

I have changed the occurrences of IDOC to 0..Unbounded, Header and ITEm to 1..1.

Do I need to change the occurrences for these three node.?

Can you please tell me what inputs I have to give for useOnesAsMany function to create individual Header fileds.? Also Do you want me to map the Header segment direct mapping with File Header.?

--

With Warm Regards

Srinivas

former_member312864
Active Participant
0 Kudos

useOneAsMany will take 3 input argument

first -- header field need to be repeated

second -- how many times you want to repeat header filed (you can pass item node)

third -- it maintains the context so you can pass any item node also

Yes you can map header segment direct map to file header

Regards.

former_member593220
Participant
0 Kudos

Hi Parida,

Thanks a lot.. it works fine.

--

Regards

Raj

Answers (0)