04-09-2010 12:17 PM
Hi
i have written below code
CLEAR : wa_final.
LOOP AT it_final INTO wa1_final.
idx1 = sy-tabix.
at new LICNO.
CLEAR : vcount.
ENDAT.
vcount = vcount + 1.
wa1_final-NOM = wa_final-NOM.
modify it_final FROM wa1_final INDEX idx1.
ENDLOOP.
my requirement is
if i have 3 same "NICNO" then NOM should be displayed only once
EG :
NICNO NOM
1 M1
1
1
2 M2
3 M3
what is wrong in my above code ?
04-09-2010 12:28 PM
What does the work area wa_final contain? Also what is the use of the counter here? Does it have anything to do with the question here?
04-09-2010 12:22 PM
Hi,
Sort your table by LICNO first before looping into the table.
Regards,
Sunny Desai
04-09-2010 12:28 PM
What does the work area wa_final contain? Also what is the use of the counter here? Does it have anything to do with the question here?
04-09-2010 12:34 PM
Hi
Sorry
the code goes like this
CLEAR : wa_final.
LOOP AT it_final INTO wa_final.
idx1 = sy-tabix.
at new LICNO.
CLEAR : vcount.
ENDAT.
vcount = vcount + 1.
wa1_final-NOM = wa_final-NOM.
modify it_final FROM wa1_final INDEX idx1.
04-09-2010 12:39 PM
CLEAR : wa_final.
LOOP AT it_final INTO wa_final.
idx1 = sy-tabix.
at new LICNO.
CLEAR : vcount.
ENDAT.
vcount = vcount + 1.
if vcount gt 1
clear wa_final-NOM.
endif.
modify it_final FROM wa_final INDEX idx1.
ENDLOOP.
04-09-2010 12:33 PM
hI,
Plse check by moving the MODIFY statement before ENDAT.
Regards,
Rajeswari
04-09-2010 12:36 PM
Try Below code.
data : m_nom type nom.
CLEAR : wa_final.
m_nom = ' '.
LOOP AT it_final INTO wa1_final.
idx1 = sy-tabix.
move-corresponding wa1_final to wa_final.
if m_non = wa1_final-nom
wa_final-nom = ' '.
modify it_final from wa_final index idx1.
endif.
m_nom = wa1_final-nom.
endloop.
Regards
Vinod
Edited by: Vinod Kumar on Apr 9, 2010 5:06 PM