Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Any one please help this issue.

Former Member
0 Likes
482

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

1 ACCEPTED SOLUTION
Read only

former_member404244
Active Contributor
0 Likes
463

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

3 REPLIES 3
Read only

andreas_mann3
Active Contributor
0 Likes
463

you must read i_rec in a workarea before

A.

Read only

former_member404244
Active Contributor
0 Likes
464

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

Read only

Former Member
0 Likes
463

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.