Skip to Content
0
Former Member
Feb 18, 2009 at 07:04 AM

modify internal table

58 Views

Hi ,

I have a problem in MODIFY statement.

I have 2 internal statement.

1. It and 2. it_mseg.

The number of datas in it_mseg is greater than it.

But i want to loop it_mseg and modify the fields of it.

How can i do this.

my code like this

SELECT c~MBLNR

c~BUDAT

c~BKTXT

d~BWART

d~MATNR

d~KUNNR

d~ERFMG

d~MAT_KDAUF

d~MAT_KDPOS

FROM MKPF AS c INNER JOIN MSEG AS d ON cMBLNR = dMBLNR

INTO CORRESPONDING FIELDS OF TABLE IT1

WHERE c~BUDAT IN DATE

AND d~KUNNR IN CUST

AND d~MATNR IN MAT

AND ( dbwart = '501' or dbwart = '412').

select * from mseg into corresponding fields of table it_mseg

for all entries in it1

where mat_kdauf = it1-mat_kdauf

and bwart = '261' and sobkz = 'E'.

loop at it_mseg.

if IT1-bwart = '412'.

read table it_MSEG with key mat_kdauf = it1-mat_kdauf

matnr = it1-matnr.

IF SY-SUBRC = 0.

IT1-QUN = IT_MSEG-ERFMG.

CLEAR IT1-ERFMG.

ENDIF.

modify it1 index sy-tabix transporting qun.

ENDIF.

endloop.

but it not give me total it_mseg record.

Thanks in Advance.

Regards

Sam