cancel
Showing results for 
Search instead for 
Did you mean: 

Sample code to get row count based on two key fields

Former Member
0 Kudos
45

Hi All,

I have a requirement to get row count in DSO2 based on two kef fields as shown below, data is getting loaded from DSO1 to DSO2.

Keyfield1      keyfield2       count (new field)

aaaa               abc               1

aaaa               cde               2

bbbb               fgh                1

bbbb               ijk                 2

Please share me sample code based on this requirement. Thanks

Regards,

Manju

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186445
Active Contributor
0 Kudos

should be more or less like this. with the F1 help you can have more info on the different statements used.

count = 0

loop at itab

count = count + 1.

at new keyfield1.

count = 1.

endat

modify itab.

endloop.