Q
Problem solve Get help with specific problems with your technologies, process and projects.

Sort a table to find value for a field

I want to get the number of records in an internal table with a particular value for a field. Can it be done by using the "describe" statement?

I want to get the number of records in an internal table with a particular value for a field. Can it be done by using the "describe" statement?
There is no addition to describe that looks at a particular value. You could loop and count, obviously. Another alternative would be to sort the table according to the field of interest, find the index of the first record with the value, and the index of the last record with the value.

Then use APPEND LINES OF ... FROM idx1 TO idx2 TO itab2. You can then use DESCRIBE on itab2.

This was last published in February 2005

Dig Deeper on SAP ABAP

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchHRSoftware

Close