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 ? | 4 Yes | 2 No |
Post New Answer View All Answers
Select up to 1 row and select single difference ?
Can we make use of flow logic control key words in abap/4 and vice-versa?
when run my program in se38 it was showing output, when i take background execution and giving printer details it was shoing out put. but in SP01 when i give the Spool Request Number it was showing not yet processed entire page why it happens i dont know please give me a solution.
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
Work most on which module: name a few tables?
What are the update types possible? : abap data dictionary
Explain what is a foreign key relationship? Explain this with the help of an example.
What is going life actually? What is the role of a functional consultant in it? : sap abap hr
Explain what is sap script? What is the purpose of sap script?
Can you give the Example for the structure of an ABAP program? REPORT... NODES: SPFLI, SFLIGHT. DATA:... INITIALIZATION. AT SELECTION-SCREEN. START-OF-SELECTION. GET SPFLI... GET SFLIGHT... GET SPFLI LATE. END-OF-SELECTION. FORM... ENDFORM.
What is the different between template and a table?
What are the disadvantages of logical databases?
What will happen when we use single buffered selected?
What are field symbols and field groups? Have you used component idx of structure clause with field groups?
What is difference between dialog program and a report?