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
In tm, if a group of employees gets 10 days of annual leave, what will be the time evaluation status? : sap abap hr
What are the commands used for interactive reports?
what is abstract classes
What is the procedure you followed to upload the data?
What do you mean by cluster tables in sap abap? Also explain what do you mean by table cluster? : abap data dictionary
What is static attribute
If I want to execute a bdc program only in background not in foreground is there any option for this? : abap bdc
what is difference between (internal table types)standard table and sorted table in sap abap....
What are Table control and tab strip control in dialog programming ?
What application areas are you comfortable in?
How can I make a differentiation between dependent and independent data? : abap hr
What are the abap/4 commands that link to a layout set?
what is 3 tire architecture and how does SAP utilizes this architecture. and how do netweaver came into picture?
Explain the disadvantages of abap query tool?
Does sap handle multiple languages?