Application Development 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: 

Internal table Logic need

Former Member
0 Kudos

Hi ,

I have one Internal table it_marc contains the MATNR

and one more final internal table it_final. I want to read the all MATNR from IT_FINAL by using IT_MARC which contains the same MATNR. I mean all the MATNRs even dupliacates also.

regards,

Ajay

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

LOOP AT IT_MARC.
  
    LOOP AT IT_FINAL WHERE MATNR = IT_MARC-MATNR.
    ENDLOOP:

ENDLOOP.

Max

6 REPLIES 6

Former Member
0 Kudos

hi

to read all the matnr use

FOR ALL ENTERIES.

hope this might help.

anuj

Former Member
0 Kudos

Hi,

Use For all entries.

Select matnr from it_marc

into corresponding fields of table it_final

for all entries in it_marc[]

where matnr = it_marc[]-matnr.

Please give me ur need exactly, so that we can better understand ur que.

Reward if Helpful.

Jagadish.

Former Member
0 Kudos

Hi

LOOP AT IT_MARC.
  
    LOOP AT IT_FINAL WHERE MATNR = IT_MARC-MATNR.
    ENDLOOP:

ENDLOOP.

Max

Former Member
0 Kudos

Hi,

Check the following code:

Data: wa_marc like line of it_marc,

wa_final like line of it_final.

sort it_final by MATNR.

loop at it_marc into wa_marc.

Read table it_final into wa_final with key matnr = wa_marc-matnr Binary Search.

if sy-subrc eq 0.

*-- Do the required processing

endif

endloop.

Hope this helps!

Regards,

Pavithra

Former Member
0 Kudos

Hi , check this out !!

Loop at it_final.

read table it_marc with key matnr = it-final-matnr.
If sy-subrc = 0.
Move corresponding values
Endif.
Endloop.

Former Member
0 Kudos

Hi friend

use this one

Select matnr from mara

into table it_marc

for all entries in it_final

where matnr = it_final-matnr

loop at it_final.

read table it_marc with key matnr = i_final-matnr.

if sy-subrc EQ 0.

it_final-matnr = it_marc-matnr.

endif

endloop.

Reward points if helpfull.