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 are the basic objects of the data dictionary?
what is difference between user exit, customer exit and badi?
Different types of luws. What are they?
Explain the disadvantage of using exec sql statement in abap?
Why lsmw does not support call transaction method? : abap bdc
Which FM do you use to find out who is reporting to whom
send coding to write a program to create customer quotation using BAPI 'BAPI_QUOTATION_CREATEFROMDATA2/BAPI_QUOTATION_CREATEFR OMDATA'
any one can tell me which is the tables can store in ddic plese dont say db02l,please give me different ways of resideing the tables ?
What is the use of the statement leave to list-processing?
Normally how many and what files get created when a transaction program is written? what is the XXXXXTOP program?
Hi my dear friends,Please give the answers for the following link http://www.saptechnical.com/InterviewQ/interviewQ.htm
How do you send files to the legacy systems from sap and vice versa? How does one know that the legacy files have come on to the sap server you are working on? : abap bdc
Hat are the different types of mode (run code) in call transaction method?
How to convert normal function module to bapi?
foreign key enforcement?