Skip to Content
avatar image
Former Member

Create Individual Idocs Based on Parent and Child Segment type

Hi Experts,

I have a scenario IDOC to FILE ,  Split Single IDOC into Multiple IDOC's based on parent and child Segment Type

For example If 3 child segments are same and 1 segment is different under parent segment then 3 same child segments are clubbed and create single idoc under parent segments and 1 different child should create in individual idoc under parent segment.


Note : Same logic should work for N number of Parent Segments and Child Segments.

Outbound:

ZIdocName

Control Record

Data Record

Parent Segment A

   Child Segment 1

   Child Segment 1

   Child Segment 1

   Child Segment 2

Parent segment  B

   Child Segment 3

Status Record

I should get output like below

Inbound:

ZIdocName

Control Record

Data Record

Parent segment A

  Child Segment 1

  Child Segment 1

  Child Segment 1

Status Record

ZIdocName

Control Record

Data Record

Parent segment A

  Child Segment 2

Status Record

ZIdocName

Control Record

Data Record

Parent Segment B

  Child Segment 3

Status Record

Please suggest me step by step process to achieve this task.

Thanks.

Ram

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 01, 2014 at 06:03 PM

    Hello,

    Segment won't hold any value, so filter criteria should be there on some field wich exist in Parent node and chile node?

    Paste ur XML?

    Try this(Assuming u have some fields in parent/child segment on which u want to define filter criteria):

    Parent Field--UseOneAsMany----RC----

                                      ------------------Concat ----splitbyvalue(value change)--collapse context --- ZIdoc

    Child field-- RC----------

    Child field--RC--splitbyvalue(valuechange)--CC -Splitbyvalue(each value) -- ParentSegment

    Child field--RC--splitbyvalue(valuechange)--- ChildSegment

    RC -> Remove Context

    CC - Collapse Context

    Note - i haven't tested ur mapping, so make sure to adjust context in mapping

    Thanks

    Amit Srivastava

    Message was edited by: Amit Srivastava

    Add comment
    10|10000 characters needed characters exceeded