cancel
Showing results for 
Search instead for 
Did you mean: 

Customer Material Info Record-for partner function IA

safeer_rahman2
Contributor
0 Kudos

Folks,

We would be using the Customer Hierarchy standard functionality found in transaction VDH1N, partner function type 1A, and customer account group 0012. We would also like to use this hierarchy to drive "Customer-Material Info Records".

To my knowledge, when creating a standard sales order, SAP functionality uses the sold-to party (SP) to retrieve the Customer-Material Info Records and does not consider at hierarchy partner function 1A.

Can you please advise me if this can be changed, through standard configuration settings, to have the sales order retrieve cust-material info records for partner function 1A as well as the sold-to party SP?

Thanks

Safeer Rahman

Accepted Solutions (1)

Accepted Solutions (1)

marcin_milczynski
Contributor
0 Kudos

Hi Shibi,

Is not possible in standard. You can use user-exit form USEREXIT_CUST_MATERIAL_READ in include MV45AFZB to change the customer number used by the system for customer-material info records determination. In standard the sold-to number is always used for this purpose.

Regards,

Marcin

safeer_rahman2
Contributor
0 Kudos

Hi Marcin,

Thanks for your reply...

Meaning, in standard ,there is no way to fetch the custmoer material record in the sales order other than through Sold-to-party ?

I tried maintaining the CMIR records for Partner functions 1A and SH (assigned to the sold to). But its not getting picked up in the sales order.

Just need to re ensure that there is no way of retreiving it via any other partner functions.(through standard settings)

Thanks,

Safeer Rahman

marcin_milczynski
Contributor
0 Kudos

Hi,

It is not possible in standard. The customer for CMIR determination is in standard always taken from KUAGV structure, which represents sold-to data. You can check with ABAPer form RV_CUSTOMER_MATERIAL_READ in include FV45PF0R_RV_CUSTOMER_MATERIAL_. In the logic the customer number DA_KUNNR is taken from customer number of sol-to from structure KUAGV.

DA_KUNNR = KUAGV-KUNNR.
* Userexit
  PERFORM USEREXIT_CUST_MATERIAL_READ(SAPMV45A) USING DA_KUNNR.

* Bei Kopieren wird bei nicht gefundenem Infosatz nicht nachgelesen
  CH_SUBRC = 0.
  CALL FUNCTION 'RV_CUSTOMER_MATERIAL_READ'
       EXPORTING
            CMR_KDMAT      = VBAP-KDMAT
            CMR_KUNNR      = DA_KUNNR
            CMR_MATNR      = VBAP-MATNR
            CMR_VKORG      = VBAK-VKORG
            CMR_VTWEG      = VBAK-VTWEG
            CMR_SPART      = VBAK-SPART
       IMPORTING
            CMR_KNMT       = KNMT
       EXCEPTIONS
            KNMT_NOT_FOUND = 1.

Regards,

Marcin

safeer_rahman2
Contributor
0 Kudos

Thanks a lot for your inputs.

Just adding a point that I have found an SAP note 626931 which mention clearly that the CMIR is always referred to the Sold to party and We can use user-exit form USEREXIT_CUST_MATERIAL_READ in include MV45AFZB to change the customer number used by the system for customer-material info records determination

Thanks,

Safeer Rahman

sunilspillai
Explorer
0 Kudos

HI Marcin,

As mentioned above, have added an enhancement point in USEREXIT_CUST_MATERIAL_READ in MV45AFZB to fetch CMIR based on Ship to Party.

In Va01 it is correctly fetching  the CMIR record based on Ship to party.

But if in VA02, at line item level, the ship to party is changed, then the CMIR is not Redetermined. In debug mode we have seen that the user exit is called but enhancement is not triggered.

At the same time, if we change the sold to party at header level, then the CMIR is redetermined, again through our enhancement point in the user exit.

Can you help us in this case.

FORM USEREXIT_CUST_MATERIAL_READ USING US_KUNNR.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form USEREXIT_CUST_MATERIAL_READ, Start                                                                                                           A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT ZSD_SHIPTOPARTY_CMIR.    "active version
*
 
  READ TABLE xvbpa WITH KEY vbeln = xvbap-vbeln
                                 posnr = xvbap-posnr
                                 parvw = 'WE'.
     IF SY-subrc = 0.
       US_KUNNR = XVBPA-KUNNR.
       ENDIF.
ENDENHANCEMENT.
*$*$-End:   (1)---------------------------------------------------------------------------------$*$*

* US_KUNNR = xxxx-zzfield1.

ENDFORM.

Answers (1)

Answers (1)

safeer_rahman2
Contributor
0 Kudos

Hello folks,

Can you please help me how can i acheive the above with standard settings...?

Thanks,

Safeer Rahman