Supply Chain Management Blogs by SAP
Expand your SAP SCM knowledge and stay informed about supply chain management technology and solutions with blog posts by SAP. Follow and stay connected.
Showing results for 
Search instead for 
Did you mean: 
Active Contributor

The SAP TM geo-map component can be used to display master data and business documents. Sometime the requirement exists in custom development projects to add custom objects to the map. This MKS describes how this can be done with minimal effort.

First of all an enhancement spot implementation class (for example ZCL_MAP_ENHANCE) is needed. This class must implement interface /SCMTMS/IF_EX_MAP_ENHANCE_VB21. Then the enhancement spot implementation can be setup under path IMG -> SAP Transportation Management -> Business Add-Ins (BAdIs) for Transportation Management -> Geographical Map -> Enhancement for Geographical Map -> BAdI: Enhancement for Geographical Map.

To add the custom object, an implementation in enhancement interface method ADJUST_NEW_OBJECTS can be done. This method is called whenever an object is added to the map. It is possible to adjust those spot and link like objects, but also to remove them or add totally new objects.

Example: You want to add an additional spot for each Freight Order representing the resource. The FO is added to the map and supplied to the enhancement method in table CT_LINK_OBJECTS. The FO stage key is the GUID. Adding the new spot needs structure if_vbi_service_provider=>spot_entry containing the following important fields:

GUID                   - Key (usually object key or stage key)

ID                        - Name

TYPE                   - Spot or Link

ROLES                - a table of roles indicating what kind of object it is -> determines for example the icon

DESCRIPTION    - a table of descriptions for tooltip, label, details

FLY_TO               - shall the map zoom to this object

SHOW_LABEL     - shall the label be displayed by default

POSITION           - Longitude and Latitude of spot

With the following code already a spot should be displayed:

METHOD /scmtms/if_map_enhance_vb21~adjust_new_objects.

     DATA: ls_spot        LIKE LINE OF ct_spot_objects,

               lv_role        TYPE vbi_object_role,

               ls_description TYPE vbi_s_object_descr_entry.

     ls_spot-guid = /sctm/cl_guid_convert=>get_guid_x16( ).

     ls_spot-id   = 'MY_TRUCK'.

     ls_spot-position-xpos = '2'.

     ls_spot-position-ypos = '3'.

     lv_role = if_vbi_geomap_const=>gc_object_role-truck.

     INSERT lv_role INTO TABLE ls_spot-roles.

*Add a description

     CLEAR ls_description.

     ls_description-category   = if_vbi_const=>gc_descr_category-tooltip.

     ls_description-field_name = 'Vehicle'.

     ls_description-value      = ls_spot-id.

     APPEND ls_description TO ls_spot-description.

     INSERT ls_spot INTO TABLE ct_spot_objects.


Map with custom truck spot (of course this can have a more realistic position)


  • Depending on the map component the enhancement shall be active, it can be a challenge to keep the object consistently on the map or remove it at the right point in time. This might require some internal object handling in the custom class.
  • Different icons: When not using the standard roles determining standard icons, it might be required to set the icon in /SCMTMS/IF_MAP_ENHANCE_VB21~ADJUST_SPOT_ICONS.
  • Adding object to the map without others: method ADJUST_NEW_OBJECTS is only called when new objects are added. If you want to show objects without this pre-requisite, either a roundtrip with a new object must be triggered that will be removed immediately and replaced by the custom objects, or a modification is required. (As soon as this comes up I might enhance the enhancement spot...)

A lot more to tell about the options to enhance the map...