Skip to Content
avatar image
Former Member

IDOC to File multiple segments to one record

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 06, 2009 at 07:19 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 06, 2009 at 08:17 PM

    This worked perfectly 😊 thank you.

    Add comment
    10|10000 characters needed characters exceeded