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

selecting not matching fields

Former Member
0 Likes
429

hi experts,

i have selected matnr and normt from mara and kept in internal table i_mara,

i have selected matnr from z table in internal table i_docp,

i want to have a internal table

it should contain matnr from mara which is not matching with ztable matnr...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
391
data: begin of ls_data,
           matnr type matnr,
           normt type ???,
           zmatnr type matnr,
         end of ls_data,
         lt_data like table of ls_data.


SELECT mara~matnr mara~normt z~matnr as zmatnr
  into corresponding fields of table lt_data
  from mara left outer join z
  on mara~matnr = z~matnr
  where ....

delete lt_data where [not] zmatnr is initial.

Kind regards

André Witt

2 REPLIES 2
Read only

Former Member
0 Likes
392
data: begin of ls_data,
           matnr type matnr,
           normt type ???,
           zmatnr type matnr,
         end of ls_data,
         lt_data like table of ls_data.


SELECT mara~matnr mara~normt z~matnr as zmatnr
  into corresponding fields of table lt_data
  from mara left outer join z
  on mara~matnr = z~matnr
  where ....

delete lt_data where [not] zmatnr is initial.

Kind regards

André Witt

Read only

Former Member
0 Likes
391

hi...

use this code..



loop i_mara into wa_mara.

read table i_docp into wa_docp with key matnr = wa_mara-matnr.
 if sy-subrc eq 0.
   delete i_mara where matnr = wa_mara-matnr.
 endif.
endloop.

best regards

Marco