cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC to File multiple segments to one record

yurika_seko
Explorer
0 Kudos

Hello,

I have an xi scenerio where I am going from IDOC to flat file. I have an issue where a segment can occur multiple times and I want to take the last segment of that multiple occuring segment as my record to flatfile.

for example

EDI_DC

EMPLOYEE

EMPLOYEE_PERSONAL_INFO

EMPLOYEE_ADDRESS_INFO

EMPLOYEE_ADDRESS_INFO

EMPLOYEE_ADDRESS_INFO

EMPLOYEE_BENEFIT_INFO

.....

in the above example, i want to take the last occurance of the EMPLOYEE_ADDRESS_INFO in my message mapping without any logic around dates or statuses.

is there an easy way to do this?

thank you

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

use this logic;

source -> COUNT-
                          |--- EqualsS -> pass the source to target
source -> INDEX -

the logic is count function will give you the number of occurrences and Index will return the current occurrence.

Answers (1)

Answers (1)

yurika_seko
Explorer
0 Kudos

This worked perfectly thank you.