Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

identical set of records

Former Member
0 Kudos

hi,

i have an internal table, say 4 records. 2 sets of identical records. the first 2 records to be assigned to 1 plant whereas another 2 assigned to another plant.

how do i know the second 2 records is to assign to other plant.

it can be more than 2 sets of identical records and each set can be different number of records.

how can i achieve this.

thanks

fielda fieldb fieldc fieldd

123 abc vv cc

123 sdf ee qq

123 abc vv cc

123 sdf ee qq

1 ACCEPTED SOLUTION

Former Member
0 Kudos

sorry i am not enough clear about your requirement but

you can try like this.

data : v_plant(4) type n value '0999'.

sort itab by fielda fieldb fieldc fieldd.

loop at itab.

at new fieldd.

<it will trigger for first row and if any change is occured in fielda or fieldb or fieldc or fieldd so you can assign the value for plant variable and use it for the rows>

v_palnt = v_plant + 1.

endat.

<now in your itab assign the value >

itab-plant = v_plant.

modify itab.

endloop.

here it will assign the value 1000 plant for first set and 1001 for second set.

regards

shiba dutta

1 REPLY 1

Former Member
0 Kudos

sorry i am not enough clear about your requirement but

you can try like this.

data : v_plant(4) type n value '0999'.

sort itab by fielda fieldb fieldc fieldd.

loop at itab.

at new fieldd.

<it will trigger for first row and if any change is occured in fielda or fieldb or fieldc or fieldd so you can assign the value for plant variable and use it for the rows>

v_palnt = v_plant + 1.

endat.

<now in your itab assign the value >

itab-plant = v_plant.

modify itab.

endloop.

here it will assign the value 1000 plant for first set and 1001 for second set.

regards

shiba dutta