Please help me with below issue. I have SAP table dump and would like to rearrange the entire table based on a column C(Batch). Condition is that the batch in consecutive row cells are not duplicates(example C1<>C2,C2<>C3...etc.,) . You'r time and help is really appreciated. I'm struggling with this issue for long time and it takes up 40% of my work hours.Please help ..Thank you!
The logic: Start with C2
Check C2 = C3? if yes then move C3 down to C4 and move C4 up to C3 location then compare C2 = C4?repeat till C2 is not same as whatever is the current C3 value for iteration and it should repeat this for all rows till end.
Please feel free to use any other logic that works more efficiently than mine.
PS: No blank batch cells are present. 70% of data is unique batch.
**BEFORE:**
Plnt| Material | Batch (Column C)
1074 10130566 ABC123
1074 10130566 ABC123
1074 10130566 ABC123
1076 10196975 DEF456
1076 10196975 DEF456
1078 10196977 GHI789
1076 10196975 DEF456
1078 10196977 GHI789
1076 10196975 DEF456
**AFTER:**
Plnt| Material | Batch (Column C)
1074 10130566 ABC123
1076 10196975 DEF456
1074 10130566 ABC123
1076 10196975 DEF456
1074 10130566 ABC123
1078 10196977 GHI789
1076 10196975 DEF456
1078 10196977 GHI789
1076 10196975 DEF456
The logic: Start with C2
Check C2 = C3? if yes then move C3 down to C4 and move C4 up to C3 location then compare C2 = C4?repeat till C2 is not same as whatever is the current C3 value for iteration and it should repeat this for all rows till end.
Please feel free to use any other logic that works more efficiently than mine.
PS: No blank batch cells are present. 70% of data is unique batch.
**BEFORE:**
Plnt| Material | Batch (Column C)
1074 10130566 ABC123
1074 10130566 ABC123
1074 10130566 ABC123
1076 10196975 DEF456
1076 10196975 DEF456
1078 10196977 GHI789
1076 10196975 DEF456
1078 10196977 GHI789
1076 10196975 DEF456
**AFTER:**
Plnt| Material | Batch (Column C)
1074 10130566 ABC123
1076 10196975 DEF456
1074 10130566 ABC123
1076 10196975 DEF456
1074 10130566 ABC123
1078 10196977 GHI789
1076 10196975 DEF456
1078 10196977 GHI789
1076 10196975 DEF456
Last edited: