cancel
Showing results for 
Search instead for 
Did you mean: 

Use Same Customer-Material Record for Many Other Customers

james_olcott
Explorer
0 Kudos

Good afternoon Gurus, Senseis, and Soothe-sayers:

Many blessings on you all.

My client wants to apply the same customer-material record to many other KUNNRs.  So for example, say you create a Cust-Matl Info Record (VD51) KDMAT XXXXXX18578 corresponding to MATNR 401683 for KUNNR 33648.


Now they want to quickly extend this Info Record to multiple KUNNRs 33692, 33547, 33384, 33596, etc.  They do not use Customer Hierarchies.

The business example is that they sell products to Walmarts in New Jersey.  Then they add new Walmart KUNNRs for Pennsylvania.  Instead of laboriously creating new Cust-Matl Info Records for all the KUNNRs, how can the same record be quickly and easily extended or copied to other KUNNRs?

Would it be acceptable to copy such from table KNMT to excel, modify as necessary and then re-upload via WIN Shuttle or LSMW?

Accepted Solutions (1)

Accepted Solutions (1)

patrick_fichtner
Explorer
0 Kudos

Hi James,

we realized this requirement by implementing userexit_cust_material_read (MV45AFZB) in the sales document processing.

In this userexit you can change the customer number that is used by standard to read the CMIR.

In this userexit we check whether a CMIR exists for the entered Sold-To, if not we pass in the customer number of the highest node in the customer hierarchy. Thus we only need to maintain the CMIR for one customer, and it is automatically used for all other customers that are in the same hierarchy.

In your case you need to find a link between the different Walmart customers (e.g. KNVV-KVGR1 as you mentioned), then use the userexit to check whether a CMIR exists for one of them and if so pass this customer number...

So the question is whether you would like to have one CMIR and use it for a lot of customers (solution above) or you would like to have identical CMIRs for a lot of customers (posts before; think about the effort to change all of them when something changes, standard does not provide a mass change tool for CMIRs).

Hope this input helps...

Patrick

james_olcott
Explorer
0 Kudos

Hi Patrick:

This was a good answer -- please reconfirm that this would work if they don't use Customer Hierarchies here.

So if the initial KUNNR was not found, then a call could be made based on the KNVV-KVGR1 code to one other KUNNR and so pass all the C-M Info Records?

Jelena
Active Contributor
0 Kudos

Patrick, this might not work for EDI orders. In the EDI orders customer info record is used to map the IDoc values. I believe this happens before the order transaction even starts, so it's possible that this user exit won't be triggered. I'm not 100% sure though but if EDI is used it'd definitely be a concern.

As far as the original question goes - the answer really depends on the data volume and update frequency. LSMW would work for once in a blue moon but if it needs to be done frequently and/or by business users then you'd need a program.

patrick_fichtner
Explorer
0 Kudos

Hi James,

for the solution that I described I can confirm this.

Here are the details:

  • SAP provides a user exit in sales document processing to use another customer number to read the CMIR (also pointed out by MoazzaM: 626931 - FAQ: Customer material info record question 6
  • so let's say you have a lot of wal mart customers, and only for one of them you maintain CMIR. This CMIR should be valid for all of your wal mart customers
  • solution
    • in the user exit, read table KNMT for the combination SalesOrg / DistrChnl / SoldTo / material
    • if table entry found --> do nothing (standard will read the CMIR with the actual sold to number)
    • if no table entry is found then read all customers which have the same KNVV-KVGR1 as your actual sold to
    • loop over these customers and read table KNMT for the combination SalesOrg / DistrChnl / alternative SoldTo / material
    • once you find a table entry leave the loop and pass the alternative customer number to us_kunnr
    • --> standard uses the other customer number to read the CMIR

Please note:

  • as the CMIR is dependant on SalesOrg / DistrChnl all your WalMart customers need to be served from this SalesOrg / DsitrChnl, otherwise it will not work
  • also please check Jelenas comment for EDI orders..

Regards

Patrick

james_olcott
Explorer
0 Kudos

Hi Patrick and other senseis:

What if you wanted to do the same thing to an Inclusion List in table KOTG001?  Say, you have one customer Walmart and you have taken a lot of time to set up an Inclusion List for them.

Then you get a new Walmart customer and the same Inclusion List would apply to the new KUNNR.

Could a flavor of the same user exit be directed to table KOTG001 to extend the list by virtue of a new KVGR2?

Please consider this in in addition to using the user exit to access KNMT for sharing CMIRs.

patrick_fichtner
Explorer
0 Kudos

Hi James,

listing / exclusion uses the condition technique. So one approach could be to set up the access sequence using KVGR1 or any other field from the customer master that links the WalMart customers.

I suppose at the moment you use the customer number in the access sequence? Check if it would be ok to change that to e.g. KVGR1.

Please also check the USEREXIT_MOVE_FIELD_TO_KOMPG (MV45AFZA) and related notes:

863767 - FAQ: Listing/exclusion (question 9)

Regards

Patrick

james_olcott
Explorer
0 Kudos

Hi Patrick:

So I would set up a new custom customer group like KVGR2 (which be similar to, but not identical to the KVGR1 set up as above for CMIRs) and then create an access sequence like "Cust. Incl. Grp/Material?"

Yes, currently, we are using "Customer/Material" in the access sequence for Inclusions.

And then ask my ABAPer to use the USEREXIT_MOVE_FIELD_TO_KOMKG and USEREXIT_MOVE_FIELD_TO_KOMPG user exits to supply the structures with the values?

Probably the most fun from the functional side would be to add the KVGR2 to the field catalog.  I remember doing this once before and it could get a little sticky... 

patrick_fichtner
Explorer
0 Kudos

Hi James,

I wonder why you don't use KVGR1 as this is already the link for all the customers...?

Anyway, yes set up an access sequence "KVGR2 / Material" in the first step, as second step your existing access so if nothing is found in the 1st step it will try to find condition records for step 2.

Regarding the extension of the field catalog: check the documentation (icon in front of the SPRO activity) for SPRO --> Sales and Distribution --> System Modificatons --> Create New Fields (Using Condition Technique) --> New Fields for Listing / Exclusion

Everything is explained in detail...

Regards

Patrick

Answers (3)

Answers (3)

hualin_zhang
Participant
0 Kudos

Excellent answers from all.

moazzam_ali
Active Contributor
0 Kudos

Hi

LSMW is an option but again you have to do it manually so what is the benefit of it? LSMW is workable if there are hundreds of KUNNRs are added frequently. IF you are going to do this for only one or two KUNNRs when they are added then it doesn't sound logical. Right? In this case I'g suggest to create one with VD51.

If number of KUNNRs are too much then in my opinion you can schedule a job periodically. Take help of ABAPEr and make a Z program. This program should be able to fetch information from KNMT and upload using some BAPI or function module. This program can be executed manually or you can schedule it. It will save downloading time to excel sheet and then LSMW time.

See which option is suitable for you.

Thank$

james_olcott
Explorer
0 Kudos

Hi MoazzaM:

This was the direction I was looking for, Sir! 

Specifically, the best advice I have received so far points to some custom logic to be added to a Z-function module (RFC or BAPI) in order to read a new z-table maintaining the mapping between the base customer's Cust-Matl product codes, a customer group code (to organize the KUNNRs), and my client's MATNR. 


This was a solution that I have learned that implemented at Proctor & Gamble; however, it was based on an EDI user-exit to read the new ztable based on KNMT (with new customer group code, Cust-Matl code, and the client's MATNR code).  I don't think my client is using EDI for order input and I will need to check.


Any further elaboration from your side will earn mega-points!

moazzam_ali
Active Contributor
0 Kudos

Hi

I didn't understand why they used a Z table for it. In your requirement I don't think so you need some Z table. You just need to read information from KNMT and maintain these for new customers again in KNMT. Now how would the system know that for customers it has maintained info record and which customers are left? If for this purpose you want to maintain some Z table than it sounds logical. YOu can also maintain this in some field in customer master and program the system that whenever backgroud job runs and maintains customer material info record it updates that field in customer master. See which option is more feasible to you and then discuss with ABAPER.

Do let me know our findings and keep updating the thread please.

Thank$

james_olcott
Explorer
0 Kudos

Hi MoazzaM:

Thanks for your input.  I agree, I don't think a ztable will be necessary.  KNMT should work fine as long as a new zfield could be added -- like KNVV-KVRG1 for example which would be assigned to a group of customers sharing the same C-M Info Record set.

Two advantages:

One, when a new customer joins the club, their KNVV-KVGR1 could be assigned so that magically the entire C-M Info Record set would apply to their orders.

Secondly, there are frequently changes to be made to Info Records shared by all customers in the group.  Now the change can be made once, as opposed to currently, where it is necessary to manually run WIN Shuttle to update each KUNNR via VD52.

The trick here would be to get KNMT to accept an assignment of KVGR1/MATNR as opposed to KUNNR/MATNR.  Can the table functionality be thusly easily changed?  Or is it easier to simply create it fresh as a ztable?

moazzam_ali
Active Contributor
0 Kudos

Hi

Your idea is good and workable. I hope you know that system always checks customer material info record for customer (Sold to party) only however you can change this by using information described in below note. Read question 6 and take help from there.

626931 - FAQ: Customer material info record



Thank$

Former Member
0 Kudos

Hello James,

LSMW is one of the simplest way to achieve this. You can simply create a recording for all the required fields, create a upload file with different customers and just copy the values for remaining fields..you can also try "Maintain Fixed Values " option for maintaining values for fields except KUNNR. Hope this helps.