11-14-2006 12:48 PM
hi
my internal table is like this
sale oder kunnr name1 city
1321564 1188 najhgd city1
1324154 1199 hgfgdhf city2
but i want to change like this
1321564 1188 najhgd
1321564 1188 city1
1324154 1199 hgfgdhf
1324154 1199 city2
how to do this .....
thanks in advance
kumar
11-14-2006 12:55 PM
Hi rajini,
if you want it in a new internal table, than
append 1 time with name1 = name1 and 1 time with name1 = city
(2 appends!!).
If you want it only at an output:
loop at itab.
write: / itab-sale, itab-kunnr, itab-name1.
write: / itab-sale, itab-kunnr, itab-city.
endloop.
Hope it helps.
Regards, Dieter
11-14-2006 12:53 PM
declare another itab2 with sale oder kunnr name1 as the fields.
sort itab1.
loop at itab1.
itab2-sale_order = itab1-sale_order.
itab2-kunnr = itab1-kunnr.
itab2-name1 = itab1-name1.
append itab2.
itab2-name1 = itab1-city2.
append itab2.
clear itab2.
endloop.
* Now Itab2 will ahve the data you need...
~Suresh
11-14-2006 12:55 PM
Hi rajini,
if you want it in a new internal table, than
append 1 time with name1 = name1 and 1 time with name1 = city
(2 appends!!).
If you want it only at an output:
loop at itab.
write: / itab-sale, itab-kunnr, itab-name1.
write: / itab-sale, itab-kunnr, itab-city.
endloop.
Hope it helps.
Regards, Dieter
11-14-2006 12:55 PM
loop at itab into wa_itab.
wa_itab1-vbeln = wa_itab-vbeln.
wa_itab2-vbeln = wa_itab-vbeln.
wa_itab1-kunnr = wa_itab-kunnr.
wa_itab2-kunnr = wa_itab-kunnr.
wa_itab1-name1 = wa_itab-name1.
wa_itab2-name1 = wa_itab-city.
append wa_itab1 to itab2.
append wa_itab2 to itab2.
endloop.
Itabe2 will have your req format.
11-14-2006 12:56 PM
<b>Hi code like this
data: itab which cointains
sale oder kunnr name1 city
And Data: itab1 which cointains
saleoder kunnr and name/city(50) type char.
Then
Loop at itab.
move saleoder to itab1-saleoder.
move kunnr to itab1-kunnr .
move name1 to itab1-name1.
append itab1.
move saleoder to itab1-saleoder.
move kunnr to itab1-kunnr .
move city to itab1-city.
append itab1.
endloop.
Regs
Manas Ranjan Panda</b>
Message was edited by:
MANAS PANDA
11-14-2006 12:56 PM
itab ---> your old table
saleorder
kunnr
name1
city
itab2 --> new table
saleorder
kunnr
text
sort itab.
Loop at itab.
clear itab2.
move-coressponding itab to itab2.
move itab-name1 to itab2-text.
append itab2.
clear itab2.
move-coressponding itab to itab2.
move itab-city to itab2-text.
append itab2.
Endloop.
11-14-2006 12:57 PM
hi,
try this.
sort itab1.
loop at itab1.
itab2-sale_order = itab1-sale_order.
itab2-kunnr = itab1-kunnr.
itab2-name1 = itab1-name1.
append itab2.
itab2-name1 = itab1-city2.
append itab2.
clear itab2.
endloop.
rgsd
anver
11-14-2006 12:58 PM
hi Rajini,
sort itab by field1 field2 field3 field4.
loop at itab into x_tab.
x_tab-field1 = itab-field1.
x_tab-field2 = itab-field2.
x_tab-field3 = itab-field3.
append x_tab to itab_new.
x_tab-field3 = itab-field4.
append x_tab to itab_new.
clear x_tab.
endloop.
Hope this helps.
Regards,
richa
11-14-2006 12:59 PM
Hi,
Try with this ...
loop at itab1. ( your initial internal table)
itab2-vbeln = itab1-vbeln.
itab2-kunnr = itab1-kunnr.
itab2-name = itab1-name1.
append itab2.
itab2-name = itab1-city.
append itab2.
clear itab2.
endloop.
-
Santhosh