‎2006 Jul 14 11:32 AM
Hi all! Plz go through this!! Hope you understood this
material no item no description
1 10 abc
1 80 cde
1 35 fgh
1 50 ijk
1 95 lmn
2 52 xyz
Now for the same material we have to concatenate the description only for the least 3 of the item no(10,35,50) how to write a code for this?
Plz send me to emadduri@gmail.com
‎2006 Jul 14 11:39 AM
hi Madhuri,
first collect the least item numbers in to variables and then proceed with concatenation ...
i.e,
sort itab-item ascending.
collect the first 3 values in to variables and use
concatenate statement.
Regards,
Santosh
‎2006 Jul 14 11:40 AM
hi
data: text(200) type c.
sort i_tab by item.
loop at i_tab.
if sy-tabix = 0.
move i_tab-desc to text.
elseif sy-tabix < 3.
concatenate i_tab-desc text
into text
seperated by sapce.
endif.
endloop.
‎2006 Jul 14 11:41 AM
sort itab by matnr item.
loop at itab.
lv_tabix = sy-tabix.
at new matnr.
read itab index lv_tabix.
loop at itab where matnr = itab-matnr.
if count < 3.
count = count + 1.
concatenate desc itab-desc into desc separated by space.
else.
clear count.
clear desc.
exit.
endif.
itab_new-matnr = itab-matnr.
itab_new-desc = desc.
append itab_new.
clear itab_new.
endloop.
endat.
endloop.
Regards,
Ravi
‎2006 Jul 14 11:52 AM
Hi,
sort itab by mat_no item_no.
loop at itab.
at new mat_no.
count = 1.
if wa_temp is not initial.
append wa_temp into Itab_new.
endif.
endat.
if count le 3.
wa_temp-mat_no = itab-mat_no.
concatenate wa_temp-desc itab-desc
into wa_temp-desc
seperated by space.
endif.
endloop.