Skip to Content
0
Former Member
Jan 14, 2008 at 06:06 AM

How to modify an internal table,if i am looping at another internal table.

20 Views

Hi

I need to modify an internal table as per my code below.But here the modify stmt doesnot work.Any pointers on how to do this would be highly appreciated.

Code:

LOOP AT tb_ebeln.

IF tb_ebeln-pstyp = '9'.

READ TABLE tb_ekbe WITH KEY ebeln = tb_ekbe-ebeln

ebelp = tb_ekbe-ebelp

vgabe = '2'

bwart = ' '.

IF sy-subrc = 0.

CLEAR wf_lfbnr1.

wf_lfbnr1 = tb_ekbe-lfbnr.

READ TABLE tb_ekbe WITH KEY ebeln = tb_ekbe-ebeln

ebelp = tb_ekbe-ebelp

vgabe = '1'

bwart = '101'

lfbnr = wf_lfbnr1.

IF sy-subrc = 0.

tb_ekbe-lfbnr = tb_ekbe-belnr.

MODIFY tb_ekbe TRANSPORTING lfbnr

WHERE lfbnr = tb_ekbe-belnr .

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.