cancel
Showing results for 
Search instead for 
Did you mean: 

how to sort source file beforfe mapping

Former Member
0 Kudos

Dear all,

Its a file (fixed length) to Idoc(FIDCC1) scenario.

Source file has the following fields:

Date

Account

Cost Center

Debit Amount

Credit Amount

Etablissement

The mapping requirement is:

1. Per 'Etablissment' code, an Idoc(FIDCCP01) has to be generated.

2. Per IDOC, segment E1F1SEG has to be created for each line in flat file, for their respective etablissment code.

Per line in the flat file the difference between the debit and credit amount is the amount that has to be posted per segment (posted amount is always positive). If zero no segment is created

3. Date and Account fields would go into fields in segment E1FIKPF, this segment will not repeat, there'll be only one segement per idoc (like header data)

Now the issue is:

The source file is not sorted per etablissment code.

Etablissment can has value 001 in 1st and 3rd record and 002 in 2rd and 4th record. in this case, We need to create 2 idocs, 1 for code 001 and another for 002. Each IDOC should have 2 segments of E1FISEG, corresponsding to their etablissment code.

then for each idoc, the first record details should go to E1FIKPF segment of idoc.

I could create Idoc based on code, by the following mapping,

Etablissmentcode -> remove context -> sort -> split by value (value changed) -> collapse context -> IDOC

But i'm cluless as to how to go about with the logic of E1FISEG segment creation and populating other fields of E1FIKPF.

Please help me out. Is it achievable thruogh graphical mapping?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

Please use the below logic for mapping

1. for creating IDOC=

Etablissement>sort>splitbyvalue(value change)>collapse contextIDOC

2. to create as many segment as of number of line item

Etablissement>sort>splitbyvalue(value change)-segment

3. foe each element under the segment

Etablissement>sort bye key>splitbyvale(each value)--> corresponding account at IDOC

Account-->

hope this will solve you problem.

thanks

Navneet

Former Member
0 Kudos

Hi Navneet,

thanks for ur reply.

but as per ur logic, all the E1FISEG will be created in the first idoc itself, subsequent idocs will not have this segment created at all.

same with other fields and segments also

Regards,

Rashmi

Former Member
0 Kudos

hi,

can u please use "each value" instead of value change at spliByvalue.

Regards,

Navneet

Former Member
0 Kudos

Hi Navneet,

Your suggested solutions almost solved many of the mapping issues i was facing.

Thanks

Regards,

Rashmi

Answers (0)