‎2006 Dec 13 8:56 AM
friends,
have an internal table with four rows like this..
MATNR QTY01 QTY02 QTY25
800000 50 20 10
i need to manipulate this internal table and populate another int. table like this,
matnr date qty
800000 01.12.06 50
800000 02.12.06 20
800000 25.12.06 10
that is, i should read qty01 (field name) and take the last two digits as the date of the current month and the qty. against that as the demand for that material on that date...how to do this? i need to read the first int. table column wise, and also read the int. table field? not able to get any idea..need your inputs...thanks all
‎2006 Dec 13 9:12 AM
Hi Sathish,
fieldsymbols: <fs> type any.
data: w_fieldname(10),
counter(2).
Loop at table1.
table2-matnr = table1-matnr.
w_fieldname = 'table1-QTY'.
do 3 times.
counter = counter + 1.
say for example if your table1 fields are matnr QTY1 QTy2
concatenate w_fieldname counter into w_fieldname.
say for example if your table1 fields are matnr QTY01 QTy02
concatenate w_fieldname '0' counter into w_fieldname.
Assign (w_fieldname) to <fs>.
Table2-QTy = <fs>.
Append table2.
enddo.
endloop.
This is useful if your first internal table fields are fixed . Still you can get a view how to use.
Reqard points if it is helpful.
Reagrds,
kiran i
‎2006 Dec 13 9:16 AM
‎2006 Dec 13 12:58 PM
Hi,
more or less symbolic code; adapt to your needs
data: num2 type numc2.
field-symbols: <qty> type any.
loop at itab.
do 31 times.
num2 = sy-index.
concatenate 'QTY' num2 into field.
assign component field of structure itab to <qty>.
check sy-subrc = 0.
itab2-matnr = itab-matnr.
itab2-date = sy-datum
itab2-date+6(2) = num2.
itab2-qty = <qty>.
collect itab2."if more than one record per month (?)
enddo.endloop.
Sorry, I got interrupter for some hours - don't know if already solved.
Regards,
Clemens
just formatted by:
Clemens Li