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: 

How to select rows from a table that have same value for a specific field?

0 Kudos
398

Hello,

I have a DB table in which there are BUKRS, LIFNR and DMBTR fields. I want to write a select statement that will pick any 10 records but out of those records all of them should have same BUKRS value.. lets say if CC01 is being picked then all 10 records should have same CC01 bukrs. How to achieve this?

3 REPLIES 3

293

Same ABAP doc of "SELECT - WHERE", but with table of contents on the left and link to latest ABAP version:

https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapwhere.htm

adityaIngale
Active Participant
0 Kudos
293

Hi kum28,

You can use

Select * from <DB_table_name> into table @data(lt_tab) where bukrs = 'CC01' up to 10 rows. 

Check below links for more details

https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapselect.htm