Application Development and Automation 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: 
Read only

Find the frequency of a data and display the count in a column

0 Kudos
969

Hi, I am very new to ABAP and programming in general. I need to find the number of occurrences of the data in a column. In this report, there should be a new column which would give the count of the sales document number. Like sales No. 40 occurs twice the column should give 2 as the count corresponding to it. 2 next to 45 and 1 next to 46 and so on.

Any help will be appreciated. Thank you.

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
835

Make it simple.

Create a second table, with Sales Document / Count.

Copy your table in this new table, put 1 into the count column.

Use the statement COLLECT it will do the sum for you

3 REPLIES 3
Read only

FredericGirod
Active Contributor
836

Make it simple.

Create a second table, with Sales Document / Count.

Copy your table in this new table, put 1 into the count column.

Use the statement COLLECT it will do the sum for you

Read only

matt
Active Contributor
835

Try to think of a process that you could use to achieve the result if you only had a pencil and piece of paper. Then write a program that does that.

That's essentially all programming is. (Apart from learning syntax and stuff...).

Read only

Sandra_Rossi
Active Contributor
0 Kudos
835

I second Matthew. If you don't have the slightest idea about how to start, I think you should first take ABAP Basics training. Optionally a training for algorithms.