Skip to Content
avatar image
Former Member

Looping and Grouping at segment level

Hi Friends,

Scenario: JDBC to IDOC

PRODID	ORDERNUM	                     TRUCKNO	DISTANCE	          BANS         ABANS	BBANS         CRMSID

100001	230001		4578	540		10	00	10	IC1201
100001	230001		4578	500		20	00	30	IC1201
100001	230001		4578	520		20	00	40	IC1201
100001	230001		4578	510		30	00	50	IC1201
100001	230001		4578	570		40	00	60	IC1201
100001	230001		4578	560		50	00	10	IC1201	
100001	230001		4578	440		10	00	10	IC1203
100001	230001		4578	540		60	00	80	IC1203
100001	230001		4578	640		70	00	10	IC1203

100001	230001		4578	940		40	00	10	IC1208
100001	230001		4578	640		80	00	40	IC1208
100001	230001		4578	840		00	00	10	IC1208

100001	230001		4578	740		10	00	40	IC1205
100001	230001		4578	540		70	00	10	IC1205

Requirement:

I want to create an IDOC basing upon CRMSID. So, am able to create it using this below logic.

CRMSID --> RemoveContext --> SORT --> SplitByValue(ValueChange) --> CollapseContext --> IDOC

So, there are 4 IDOC's to be generated. But, each IDoc will have multiple segments to be generated since the other fields (DISTANCE BANS ABANS BBANS) data is changing.

Can some one provide exact grouping and looping for this as got stuck with this.

Thanks.

Swarna.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Sep 23, 2011 at 12:58 PM

    Hi Swarna,

    Did you try the logic that I've provided for your similar requirement previously.....?

    Is this can only be done through Java mapping?

    Regards

    Priyanka

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Swarna,

      For individual fields use the below logic... for example field BANS,

      formatByExample-splitByEachValue--TargetBANS

      FormatByExample:

      input1:resultOfSortByKey

      input2:CRMSIDremovecontext-sort--splitByValueChange

      SortByKey:

      input1:CRMSID--removecontext

      input2:SourceBANS--remove context

      Please try this logic and let me know on further clarification.

      Thanks

      Priyanka

  • avatar image
    Former Member
    Nov 16, 2011 at 12:08 PM

    ho contact and do.

    Add comment
    10|10000 characters needed characters exceeded