cancel
Showing results for 
Search instead for 
Did you mean: 

Create Individual Idocs Based on Parent and Child Segment type

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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