cancel
Showing results for 
Search instead for 
Did you mean: 

Looping and Grouping at segment level

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

ho contact and do.

PriyankaAnagani
Active Contributor
0 Kudos

Hi Swarna,

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

Regards

Priyanka

Former Member
0 Kudos

I have more than 2 field values are changing, so all am concat'ed.

Also it is giving me a bit of confusion. Can you please explain it detail.

At field level how should I map?

Regards

Swarnalu.

Edited by: Swarna on Sep 23, 2011 3:23 PM

PriyankaAnagani
Active Contributor
0 Kudos

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