Skip to Content
Product Information
Author's profile photo Michael Haase

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!

Best regards,

Michael

Assigned Tags

      13 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Torben Fogtmann Nielsen
      Torben Fogtmann Nielsen

      Hallo Hr. Hasse,

       

      theese locations would they adopt a GEO coding from the BP if it had any ?

       

      MFG

      Torben Fogtmann

      Author's profile photo Michael Haase
      Michael Haase
      Blog Post Author

      Hello Torben,

      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.

      Best regards,

      Michael

      Author's profile photo Torben Fogtmann Nielsen
      Torben Fogtmann Nielsen

      Hi,

      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...

       

      Torben

      Author's profile photo Michael Haase
      Michael Haase
      Blog Post Author

      Hi Torben,

      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.

      Best regards,

      Michael

      Author's profile photo Torben Fogtmann Nielsen
      Torben Fogtmann Nielsen

      Hi Michael,

      thx for the answer it seems to be like the ortec part in som way.

      and a nice post...

      Torben

      Author's profile photo Sivakumar Shanmugam
      Sivakumar Shanmugam

      Hi Michael,

       

      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?

       

      Example :

      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.

      Author's profile photo Michael Haase
      Michael Haase
      Blog Post Author

      Hello Sivakumar,

       

      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?

       

      Best regards,

      Michael

      Author's profile photo Sivakumar Shanmugam
      Sivakumar Shanmugam

      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.

      Author's profile photo Michael Haase
      Michael Haase
      Blog Post Author

      Hello Sivakumar,

      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?

      Best regards,

      Michael

      Author's profile photo Sivakumar Shanmugam
      Sivakumar Shanmugam

      Hi Michael,

      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?

      Thanks,

      Siva

       

      Author's profile photo Michael Haase
      Michael Haase
      Blog Post Author

      Hello Sivakumar,

      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.

      Best regards,

      Michael

      Author's profile photo Gaurav Jain
      Gaurav Jain

      Hi Micheal,

       

      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.

       

      Regards

      Gaurav

      Author's profile photo Michael Haase
      Michael Haase
      Blog Post Author

      Hello Gaurav,

       

      Of course, this is possible as for any report.

       

      Best regards,

      Michael