Monday, January 12, 2015

find duplicate material from a sap table

select
           count(*) as c
           v~vhilm

      from likp as l inner join vekp as v on l~vbeln = v~vbeln_gen
      into corresponding fields of table t_likp
      where l~vkorg = v_plant
      and   l~lgnum = v_wh
      and   l~erdat in s_grdat
          group by
           v~vhilm.