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

Hi

Former Member
0 Likes
636

Hi,

Where can we find the substitution material for the selected material?

kishi.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
603

You can get is like this.




data:  v_matnr type mara-matnr,
         v_matwa type kotd001-matwa.

      select single matwa into v_matwa
                   from kotd001
                      inner join kondd
                        on kotd001~knumh = kondd~knumh
                      inner join makt
                        on kondd~smatn = makt~matnr
                              where kotd001~kappl = 'V'
                                and kotd001~kschl = 'A001'
                                and kotd001~datbi = '99991231'
                                and kondd~smatn = v_matnr     "<-  Fill with  you material
                                and makt~spras = sy-langu.

write:/ v_matwa.

Regards,

Rich Heilman

Hi,

Where can we find the substitution material for the selected material?

kishi.

2 REPLIES 2
Read only

Former Member
0 Likes
603

When a material is substituted/determined using material determination method, the original material is stored by the system in the Material entered field MATWA in VBAP table.

You can query on VBAP and check if material entered MATWA is not equal to material number MATNR. Also check if the reason code for material susbstitution field SUGRD is non blank.

The quantity of course you can get from VBAP table.

See if this helps you,

Regards

Vasanth

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
604

You can get is like this.




data:  v_matnr type mara-matnr,
         v_matwa type kotd001-matwa.

      select single matwa into v_matwa
                   from kotd001
                      inner join kondd
                        on kotd001~knumh = kondd~knumh
                      inner join makt
                        on kondd~smatn = makt~matnr
                              where kotd001~kappl = 'V'
                                and kotd001~kschl = 'A001'
                                and kotd001~datbi = '99991231'
                                and kondd~smatn = v_matnr     "<-  Fill with  you material
                                and makt~spras = sy-langu.

write:/ v_matwa.

Regards,

Rich Heilman