Automatic creation of locations for business partners
Dear friends of SAP TM,
As mentioned in several blog posts before, it’s crucial for SAP TM to work with entities of master data object ‘Location’. This holds true for transport planning in regards to source/destination locations, and may be also intermediate locations are involved. If the source or destination of a transport is now a business partner like a customer or vendor, this implies that a respective location needs to be in place.
There are various ways in SAP S/4HANA to create locations for business partners, but in the following example we will see the most smoothest one.
Let’s assume the following customer has been created in transaction BP:
When saving the customer on creation, the following location of type 1021 (business partner) has been created automatically:
How come? This is because the following BAdI has been implemented:
You see also the respective documentation, giving you hints how an implementation should look like.
That means furthermore:
- Without any implementation of this BAdI, no location is created from transaction BP
- If the BAdI is implemented correctly, also relevant address updates on the business partner are propagated to its location
Important to mention is, that this refers only to the manual creation of a business partner in transaction BP. When for example a business partner is replicated with DRF, this BAdI has no effect and thus no location is created. In the DRF replication, the location either has to be replicated as well after the business partner. Or, the location can be created in the target system with report /SAPAPO/CREATE_LOCATION.
Some additional remarks:
- Locations for business partners are always created with location type 1021 in SAP S/4HANA. The location types for customers (1010) and vendors (1011) aren’t used anymore in SAP TM.
- Locations are only created for a uniquely defined standard address of a business partner.
I hope this helps you a bit in your projects! Please feel free to comment!
Hallo Hr. Hasse,
theese locations would they adopt a GEO coding from the BP if it had any ?
To be honest with you...I'm not sure whether there's any geocoding for the addresses of a business partner.
But at least the determination of geo coordinates is triggered for the location when it's created. So, when this is set up properly, the location has the standard address of the business partner and the respective geo coordinates.
thats also ok. Do you know if the functionality cant find an excat geocoding whether the location ID then is in 'incomplete' or how ?
I ask because this is how it works for Ortec's addon TMS system i SAP. Here the system will create a probability of the GEOCODE...
I guess you mean something like a field 'accuracy of geo codes', or in simple words 'how good does the geo code fit to the address'. Currently, we don't have any such field yet at the Location.
I'm not that deeply into the determination of geocoordinates, but I could imagine that something like this could be maintained in the strategy. There you can at least maintain a precision, meaning whether the geocode refers to the house number, midpoint of the street, city etc.
thx for the answer it seems to be like the ortec part in som way.
and a nice post...
We are implementing S4 HANA and TM , the main problem in our company is in sales order Ship to party number is different than TM location number which is BP number of the sip to party but in Sales order we have customer number of the BP. This case Sales team will talk customer number but TM team talk BP number of the ship to party number which is completely different. How can we over come this ? is there way we can put user exit in to the TM assign customer instead of BP during location assignment?
Sales order Sold to : 12
Sales order ship to : 1
BP for Ship to : 102
TM location : 102
What we need is in TM , we need to assign 1 instead of 102 which will be uniform of all the places in Sales and TM.
Which release of S/4HANA is it?
And what is this ship-to-address number 1? Is it an alternative address of the business partner? Maintained at the business partner? And how do you enter this ship-to-address number in the sales order?
Thanks for the reply Michael, Appreciated.
We use 1909 S4 HANA version
Ship to party address 1 and BP 102 are same address. In sales order we use ship to party number "1". The problem is Sales order ship to party number 1 but in TM destination location says 102 but both are same physical location. we need in TM and Sales order ship to party number should be same but now it is not.
TM creates the locations with the name of the BP per default. That's why the location is called '102'. If you require the name of the location to be different, this probably could be changed within a BAdI.
But if it's the same physical location this shouldn't matter?
Physically the location in TM and Ship to party are same. That is the reason we wanted to have same number across the board. SInce our Ship to party in sales order and TM location are same we wanted to have same number but now TM says "102" and Ship to party says "1". How can we achieve this ? Can we use any BADI to achieve to bring ship to party number '1" in TM?
Might be that there is a BAdI but I wouldn't change the name this way. If you normally search a location, you would search by the business partner number. I.e. in transaction /SCMTMS/LOC3 where we made such an enhancement as explained in this blog post: https://blogs.sap.com/2021/10/18/new-feature-in-sap-s-4hana-2021-fps0-find-locations-by-reference-object/
If you change it, it's much harder to find the location afterwards and you would lose transparency.
Therefore I would propose to stay with the business partner number as it's both the same physical location.
How about creating a batch job with this program: SAPAPO/CREATE_LOCATION. Is it possible? I am going to test this soon in my system.
Of course, this is possible as for any report.
Thanks for this blog.
The BAdI has been implemented and works perfectly fine indeed. Location gets created at BP creation and hence the mapping location/BP is set so any further changes are also updated automatically.
The only thing I find a bit disappointing is that it does not seem to work when BP is created from the Manage Business Partner Fiori App (F3163). BAdI does not get called.
Which is a pity because the app can be used to create BPs by copying existing ones, which is something users usually find very helpful and therefore tend to use a lot.
I suppose the limitation is the same as for DRF.