This blog is about automating a utility in ECC which you can use to set up close-by store/plants. This utility can be accessed via txn wsd_cbp. One of the places this “Closeness” is used is in a FIORI app called “Product lookup”. For details on Product look up app, click here.
Setting up “Close by plants” is a very manual process and even if you have set it up once, there is a always a constant need to change it, especially if you are in a Retail environment with store opening and closing all the times.
There are two ways to automate this process.
- First, have a Google API so that you can do close by association based on Plant/store’s address (coordinates)
- Second, write an ABAP program to use one or more attributes from the plant/store master to create these associations.
Unfortunately first option requires extra investment, which was not approved in our implementation, so we ended up going the cheaper way of writing an ABAP program. Broadly, the logic we used was to look at stores/plant in a sales organization and then organize them based on a sales district.
- Create a table (copy of WSD_cbp) of all stores with same value of T001K-VKORG
- Delete stores where closed date is less then today’s
- For same value of T001K-VKORG populate PLANT = WR02D-LOCNR and Close_by = All the plants with same T001K-VKORG
- For same value of T001K-VKORG and T001W-BZIRK (district), set PRIORITY=001
- Repeat for all VKORG and BZIRK combinations
- Copy entries to WSD_CBP