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: 

Assigning customer material no for a material if it doesn't exist for it???

Former Member
0 Kudos

Hi all,

In VA01 I have a situation where for a particular material number if customer material no is not maintained an error message is displayed that this material doesn't have a customer material no.

Now after I get that error if user enters customer material no and saves it the sales order should be saved along with the customer material no successfully.......

Thanks & Regards

Jerry

2 REPLIES 2

Former Member
0 Kudos

Hi,

I am using user exit USEREXIT_CHECK_VBAP.

Regards

Jerry

0 Kudos

THis is what I have done,

I am coding this in MV45AZB's routine -

FORM USEREXIT_CUST_MATERIAL_READ USING US_KUNNR.

***   Read customer info record
      call function 'RV_CUSTOMER_MATERIAL_READ'
           exporting
                cmr_kdmat      = vbap-kdmat
                cmr_kunnr      = vbak-kunnr
                cmr_matnr      = vbap-matnr
                cmr_vkorg      = vbak-vkorg
                cmr_vtweg      = vbak-vtweg
                cmr_spart      = vbak-spart
           importing
                cmr_knmt       = zknmt
           exceptions
                knmt_not_found = 1.
      if sy-subrc <> 0.
        message id 'ZZ' type 'E' number '015'   "Cust.Mat not found
                with 'Item ='
                     vbap-posnr
                     'Material ='
                     vbap-matnr.
     else.
     vbap-kdmat = zknmt-vbap.   " I have declared an int. table zknmt of type knmt .
     endif.

Hope this helps.

-Shareen