How to find only duplicate records from table ?
Answer Posted / sunil kumar gautam
In my code it is consider that duplication is checked on
the basis of empcd field of emp table.
REPORT ZTESTDUP.
types:begin of ty_du,
EMPID type ZEMP_ASHU_SUNIL-EMPID ,
EMPCD type ZEMP_ASHU_SUNIL-EMPCD,
EMPNM type ZEMP_ASHU_SUNIL-EMPNM,
end of ty_du.
Data: IT_du type standard table of ty_du,
Wa_du type ty_du.
select * INTO CORRESPONDING FIELDS OF TABLE IT_DU
from ZEMP_ASHU_SUNIL.
data: i type I.
data:IT_final type table of ty_du,
wa_final type ty_du.
loop at IT_DU into WA_DU.
i = 0.
loop at IT_DU into WA_DU where empcd = WA_DU-
empcd.
i = i + 1.
endloop.
if i = 2.
wa_final-empid = WA_DU-empid.
wa_final-empcd = WA_DU-empcd.
wa_final-empnm = WA_DU-empnm.
append wa_final to it_final.
clear wa_final.
endif.
endloop.
In above code final internal table contains duplictae data.
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What does an exec sql statement do in abap?
When value table becomes check table?
What are the two ways for restricting the value range for a domain ?
Explain lsmw?
What are the advantages and disadvantages of using views in abap programming ?
What is the difference between synchronous and asynchronous update? : abap bdc
What is the sap abap?
Explain the Types of Select statements?
What are two methods of modifying sap standard tables?
Can you create an internal table dynamically?(at run time)
What is output determination?
there are 2 selection screens. material num in screen 200 and plant in screen 300. so how can you write in INITIALISATION event?
What is the syntex used to call a screen as dialog box (pop up)?
What are the different types of luws. What are they?
What is dialog module?