Hi,
Try,
Include MV45AFZZ
FORM USEREXIT_PRICING_PREPARE_TKOMP.
Data: lv_cnt1 type i,
lv_cnt2 type i,
it_temp type table of komv.
CHECK sy-tcode = 'VA01'
AND VBAK-AUART = 'ZPS'
AND NOT xkomv[] IS INITIAL.
it_temp[] = xkomv[].
sort it_temp by kschl.
delete adjacent duplicates from it_temp comparing kschl.
lv_cnt1 = lines( it_temp ).
lv_cnt2 = lines( xkomv ).
if lv_cnt1 NE lv_cnt2.
message 'Duplicate entries exit' type 'E'.
endif.
Hope it helpful,
Regards,
Venkat.V