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: 

SD_Material_Determination

Former Member
0 Kudos

Hi

I tried this code in SE38, but it's giving

REPORT ZSA.

TABLES : QMEL, VBAP.

DATA: L_BVBPAKOM LIKE BVBPAKOM OCCURS 2 WITH HEADER LINE.

DATA: L_KONDDP_EXT LIKE KONDDP_EXT_SERVICE

OCCURS 2 WITH HEADER LINE.

DATA: L_BVBAKKOM LIKE BVBAKKOM.

DATA: L_MATNR LIKE QMEL-MATNR.

DATA: L_TVSU LIKE TVSU.

Move '000000000100003676' to VBAP-MATNR.

CALL FUNCTION 'SD_MATERIAL_DETERMINATION'

EXPORTING

  • I_KALSU =

I_MATNR = vbap-matnr

  • I_DATUM =

  • I_VWPOS =

  • I_POSNR_HP =

  • I_ARKTX =

I_BVBAKKOM = L_BVBAKKOM

IMPORTING

E_MATNR = L_MATNR

  • E_ARKTX =

E_TVSU = L_TVSU

TABLES

I_BVBPAKOM = L_BVBPAKOM

E_KONDDP_SERVICE = L_KONDDP_EXT

EXCEPTIONS

CALL_ERROR = 1

ERROR_MESSAGE = 2

OTHERS = 3.

write : / L_MATNR.

But it's not giving any output. help please.......

-subha

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Don't know if you can use that like this. It is dependent apond other imformation. You need to specify KALSU to get it passed the first check.

  IF I_MATNR    IS INITIAL OR
     ( I_KALSU    IS INITIAL AND
       I_BVBAKKOM IS INITIAL ).
    RAISE CALL_ERROR.
  ENDIF.

But then in the MATERIALFINDUNG_EXT form, it does this check.




  IF VBAK IS INITIAL.
    RAISE CALL_ERROR.
  ENDIF.

This is where it is stopping for me. There must be another function module which is filling this VBAK, that must be used with this function module. Not really sure.

Regards,

Rich Heilman

14 REPLIES 14

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Don't know if you can use that like this. It is dependent apond other imformation. You need to specify KALSU to get it passed the first check.

  IF I_MATNR    IS INITIAL OR
     ( I_KALSU    IS INITIAL AND
       I_BVBAKKOM IS INITIAL ).
    RAISE CALL_ERROR.
  ENDIF.

But then in the MATERIALFINDUNG_EXT form, it does this check.




  IF VBAK IS INITIAL.
    RAISE CALL_ERROR.
  ENDIF.

This is where it is stopping for me. There must be another function module which is filling this VBAK, that must be used with this function module. Not really sure.

Regards,

Rich Heilman

0 Kudos

Yes you are right. it's stopping me in First check itself....... Don't to know how to findout???????

-subha

0 Kudos

Hi,

Could you find anything? PLease tell me for which transaction this functionmodule SD_MATERIAL_DETERMINATION is calling. I checked but couldn't findout.....

Help needed please????????

-subha

0 Kudos

I think CALL FUNCTION 'SD_SALES_HEADER_MAINTAIN'

EXPORTING

FVBAKKOM = VBAKKOM

SUPPRESS_AVAILIBILITY_DIA = 'X'

SUPPRESS_TEXT_POPUP = 'X'

STATUS_BUFFER_REFRESH = SPACE

IMPORTING

EVBAK = VBAK

TABLES

FXVBPAKOM = XVBPAKOM.

this FM is filling value for VBAK. How can i hard input for this funcation or how can get values for structure VBAKKOM??????????

thanks,

Subashini

0 Kudos

What's the transaction run for SD_MATERIAL_DETERMINATION. I see program name as SAPLQM06 & include LQM06I50.

Help need?????????

thanks,

Subashini

0 Kudos

It is called by function module QM06_FM_TASK_RMA_ORDER_CREATE. I don't know where this function module is called. It could be called dynamically.

What exactly is it that you want to achieve.

Regards,

Rich Heilman

0 Kudos

I put this code

<b>If VBAP-MATNR = '000000000100003676'.

MESSAGE w000(ZEXAMPLE).* EXist

else.

MESSAGE W001(ZEXAMPLE).* Not Exist

endif. IN MV45AFZA</b>. TO check whether material substitution is available for the material then Message should display like this "Material SUBSTITUTION EXIST" suppose if material substitution is not available for material then I need to have this message 'Material substituion not EXIST" . I am trying to find out how can i know material having substitution or not?

For hardcoded materialnumber above i know Material substitution is Exist. So i gave condition like that.....

0 Kudos

Please guide me it's urgent need...........

Really appreciate the help.............

-subha

0 Kudos

Hi Subashini,

As I am looking in to the tables for material determination they are generally stored in

KOTD001

KOTD002

KOTD011

KOTD502

You can check your material against these tables based on MATWA = your material VKORG = Sales ORG for a valid dates.

If you find any entry means you have substitution for that mayerial. The use KOTD**-KNUMH and read table "KONDDP".

May be this will help you.

Lanka

0 Kudos

Can You please give me sample code???? That will very great help......

Thanks,

Subha

0 Kudos

Hi Subhashini,

Use this Pseudo code:

Select Single KNUMH from KOTD001 into V_KNUMH

where matwa = matnr(your material).

IF sy-subrc = 0.

Substitution found.

Else.

*--Check next table . Please check

Select Single KNUMH from KOTD002 into V_KNUMH

where matwa = matnr(your material)

and VKORG = Sales org

AND VTWEG = DIST, CHANNEL

if sy-subrc = 0.

substitution found.

else.

*--next table

Select Single KNUMH from KOTD011 into V_KNUMH

where matwa = matnr(your material)

and VKORG = Sales org .

AND SO ON..

I don't know how many determination tables used in you config..

Lanka

KOTD002

KOTD011

KOTD502

You can check your material against these tables based on MATWA = your material VKORG = Sales ORG for a valid dates.

If you find any entry means you have substitution for that mayerial. The use KOTD**-KNUMH and read table "KONDDP".

0 Kudos

Use PRODUCT_SUBSTITUTION.

0 Kudos

Hi,

I looked into tables KOTD001, 02 they don't have any data but KOTD011 having data So i put code like this Is it correct???????

TABLES : KOTD011.

select * from KOTD011 where matnr = VBAP-MATNR.

endselect.

If VBAP-MATNR = KOTD011-MATNR.

MESSAGE w000(ZEXAMPLE).

else.

MESSAGE W001(ZEXAMPLE).

endif.

-subha

0 Kudos

Hi Subhashini,

Please use function: PRODUCT_SUBSTITUTION as srini mentioned. this will work for you.

Lanka