My previous blog post deals with implementing batch search by customer/material in WM.
It should work while creating TOs in LT03, LT0S… but when you use LT0E, you can have many different customers in a delivery group, and customer number doesn’t get populated at all during the batch determination processing.
For this reason the previous user exit is not sufficient to make this work.
You don’t have at all a cusatomer number to start with!
Now, what is the idea… We want to find out for which delivery group we are creating a TO for.
Then, we will find at least one delivery from it, take a customer number and fill our batch determination key fields with it.
Limit: while this is a simple solution, it has some limitations.
In order for this to be accurate, you need to create delivery groups only for the customer with same requirements during batch search.
E.g. both customers need to have the same remaining shelf life reqirements (in days or percent).
Or whatever your strategy uses, whichever characteristics, they should be the same for these customers you group into delivery group.
Otherwise, it will still work but will select one customer characteristics values and will use it for all the customers.
OK, onto solution.
You need to read my previous post, do all that before this one.
You can find the post here: SAP WM batch search per customer/material
Then you can continue further:
In our user exit (include ZXVBZU11) we should write some more code…
field-symbols: <zt311> like t311.
v_t311 like t311.
value = ‘(SAPML03T)T311’.
assign (value) to <zt311>.
v_t311 = <zt311>.
if c_komkh–kunnr EQ space OR c_komkh–kunnr IS INITIAL.
tables: likp, vbsk, vbss.
select single * from vbss where sammg EQ v_t311–refnr.
select single * from likp where vbeln EQ vbss–vbeln.
c_komkh–kunnr = likp–kunnr.
c_komkh–kndnr = c_komkh–kunnr.
c_komkh–knrze = c_komkh–kunnr.
c_komkh–kunre = c_komkh–kunnr.
c_komkh–kunwe = c_komkh–kunnr.
c_bdcom–kunnr = c_komkh–kunnr.
c_bdcom–kund1 = c_komkh–kunnr.
After activation, user exit does it’s job and enables batch determination per customer/material even for delivery groups using LT0E!
Very handy for companies that have a lot of customers using same or nearly same requirements (like minimal remaining shelf life etc.).
We’re done with this one, seems easy but what here seems like a dozen of lines of code, transferred to quite a bit research and trial/errors in user exits and other aspects of SAP DEV.
Hopefully someone will make use of this.