2007 Nov 02 7:42 AM
I have one internal table called itab. i have a standard table type of i_rec. The standard table declared like below,
DATA: i_rec TYPE STANDARD TABLE OF ty_rec,
i _rec having the fields of matnr, date, qty1,qty2,qty3.
itab having matnr and qty.
i_rec and itab having some records, My problem is i want to replace i_rec-qty1 with itab-qty. can any one give the soln...
loop at itab where matnr = i_rec-product .
endloop.
if i using the above statment its giving the error like i<b>_rec is a table without header line so no component called produc</b>t. But ty_rec having the field product. how to solve this plz help me.
Mohana
2007 Nov 02 7:55 AM
Hi,
Try like this
loop at i_rec into wa_rec .
read table itab with key matnr = wa_rec-product .
if sy-subrc eq 0.
wa_rec-qty1 = itab-qty.
modify i_rec from wa_rec.
endif.
endloop.
Reward if hlpful.
Regards,
Nagaraj
I have one internal table called itab. i have a standard table type of i_rec. The standard table declared like below,
DATA: i_rec TYPE STANDARD TABLE OF ty_rec,
i _rec having the fields of matnr, date, qty1,qty2,qty3.
itab having matnr and qty.
i_rec and itab having some records, My problem is i want to replace i_rec-qty1 with itab-qty. can any one give the soln...
loop at itab where matnr = i_rec-product .
endloop.
if i using the above statment its giving the error like i<b>_rec is a table without header line so no component called produc</b>t. But ty_rec having the field product. how to solve this plz help me.
Mohana
2007 Nov 02 7:44 AM
2007 Nov 02 7:55 AM
Hi,
Try like this
loop at i_rec into wa_rec .
read table itab with key matnr = wa_rec-product .
if sy-subrc eq 0.
wa_rec-qty1 = itab-qty.
modify i_rec from wa_rec.
endif.
endloop.
Reward if hlpful.
Regards,
Nagaraj
2007 Nov 02 7:56 AM
HI,
Declare a workarea for i_rec.
DATA:wa_rec type ty_rec.
Now use read steatement...
loop at itab.
read table i_rec into wa_rec with key product = itab-matnr.
if sy-subrc eq 0.
then replace the QTY.
and modify the internal table.
endif.
endloop.
Thanks,CSR.
*****Please reward if helpful.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |