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.
Showing results for 
Search instead for 
Did you mean: 

In SAP how to check distinct values for the table, for the column(field)

Former Member
0 Kudos

Let say, the table LIPS having WERKS(plant), now we want to know distinct value(count) of the WERKS field.


Vadamalai A


Former Member
0 Kudos

Hi Vadamalai,

      You can find the possible values if any check table is maintained but not sure whether you can get the distinct values maintained inside LIPS ( for WERKS). 

     It seems to be the only option is execute all entries then do filter on the field WERKS. This might lead to performance issue.


Monishankar Chatterjee

Former Member
0 Kudos

Dont know whether programmatic solution is acceptible, but following might help:

select distinct werks

   into table lt_werks

   from lips

   where vbeln in s_vbeln.

DESCRIBE TABLE lt_werks lines lv_count.

write:/ lv_count.

0 Kudos


  Get all WERKS from LIPS into an internal table.

   SORT & DELETE ADJACENT DUPLICATES on internal table will gives distinct plants.