Monday Knowledge Snippet (MKS) – 23 Detailed Routes on Geo-Map
To celebrate the first TM 9.0 live customer, today’s knowledge snippet deals with detailed routes on our SAP TM geo-map component SAP Visual Business. The customer uses the component to track its vehicles, what seems to be one of the most underestimated use cases for our solution.
By default, connections between locations are displayed with a straight arrow on the geo-map. First of all, this makes it easier to oversee a displayed scene potentially having very many connection. Secondly it is quicker.
As the screenshot shows, it is possible to switch to a detailed route mode. When selecting this, the geo-map calls a backend service responsible to get the detailed routes and in case it is successfull, changes the scene.
To enable this function, a GIS service must be connected. This can be enabled in the geo-map customizing:
Here, you can enter a georouting strategy using a process controller strategy.
And now comes the tricky part: Within this strategy you need a method that calls a GIS service delivering for start and destination coordinates and some additional attributes like speeds a table of route points. Some of the services even respond with a detailed way description in textual form.
How the input / output mapping is done can be checked in method /SCMB/CL_GEOROUTING_CONNECTOR->GET_STANDARD_ROUTE. Here you find the standard SAP coding for calling the outdated IGS – GIS integration. But at least it is useful as an example for your own implementation. The final route must be passed back to standard in attribute <fs_geo_request>-route_points for each request.
So here is what needs to be done:
1. Create own process controller strategy with a single method.
2. Within this method implement the call to your GIS service
3. Set your strategy in the geo-map customizing as georoute strategy
4. Test it!
A few things in addition:
– Currently there is no buffering, which can slow down the geo-map quite a bit. So really carefully handle multiple connections at the same time! Or maybe implement your own buffering in your GIS connector.
– It is important to carefully handle coordinate formats! SAP uses here the GPS format. So if your route appears to be somewhere in the nowhere, this is the first thing to check.
– The accuracy of the displayed route depends on the number of supplied route points. In case you see a route with just a few stages, the service might only supply information at coordinates where roads are changed. This is insufficient for the detailed route on the geo-map. On the other hand, if you have coordinates ever 10 centimeters, the data volume might be too high.
– Switching between quickest and shortest route for example is not supported in standard and must be implemented in the own coding.
– In general this function is not limited to street transports, but can also be used for ocean.
So still a bit to do to get it running, but cool feature.
Here is the LinkedIn discussion: http://www.linkedin.com/groups/Monday-Knowledge-Snippet-MKS-23-3107838.S.191991371
That looks awesome!
Hello Marcus,
I read your article but I see that there is a class for nokia makes calculating routes CL_VBC_GEOCODING_NAVTEQ-IF_VBC_GEOCODING_SERVICE ~ CALCULATE_ROUTE, I wonder how I can make the integration of georutes with nokia or if you know anything about it.
I read about making a web service and now I read that it can be done with / SCMB/CL_GEOROUTING_CONNECTOR-> GET_STANDARD_ROUTE but I'm confused which is the best option.
Regards
Well, that just shows that it can be done in mutliple different ways. SAP TM comes with a framework enabling to connect to almost any GIS service using almost any technology. But we do not deliver any coding to any vendor.
The class CL_VBC_GEOCODING_NAVTEQ you have mention is provided by the SAP Visual Business colleagues. It could in principle be used within a SAP TM to connect to NAVTEQ (NOKIA HERE now). In this case the coding you need to write just includes a call to this class passing the input and handling the result.
/ SCMB/CL_GEOROUTING_CONNECTOR-> GET_STANDARD_ROUTE is the call to the outdated IGS GIS connection, which we do not recommend to use any longer. It is still supported as there might be customers having this installed.
In other words means for this case can be CL_VBC_GEOCODING_NAVTEQ-IF_VBC_GEOCODING_SERVICE ~ CALCULATE_ROUTE my controller method?
or I need to create a new class that is my process controller and configure the input and output to catch de result of the class CL_VBC_GEOCODING_NAVTEQ as mention?
No, CL_VBC_GEOCODING_NAVTEQ-IF_VBC_GEOCODING_SERVICE ~ CALCULATE_ROUTE can't be itself the process controller method. It must be called within your method.
Ok, thank you Marcus. I'll try this 🙂 .
One additional remark: It is always important to verify that such a method really fulfills all requirements regarding performance and result quality. For example the SAP TM GIS integration framework is fully mass enabled, what is especially important for the distance and route determination part. Splitting these mass calls into single calls is a very bad idea. In such a case it would better to implement the call on your own specific to the GIS service structure.
Hi Jane, did you manage to get the class CL_VBC_GEOCODING_NAVTEQ called in / SCMB/CL_GEOROUTING_CONNECTOR-> GET_STANDARD_ROUTE ?
Thanks,
Rodion
Hi Rodion,
Yes, I implemented my own connector SCMB/CL_GEOROUTING_CONNECTOR-> GET_STANDARD_ROUTE
and own NAVTEQ class to CALCULATE ROUTES.
Regards.
Hi Jane, Im configuring a HERE GIS for SAP TM and I have some troubles to do that; do you have some example of the connector class that you did?. Thanks!
Hi Carlos,
I would suggest to make a new SCN post with your question. Maybe I can give you some hints.
I have experience with Nokia Here Integration, however I am not allowed to post any coding due to Interlectual Property.
Best regards,
Rajiv
Rajiv, i would need some help with HERE integration in TM. Let me know how I can contact you.
Thanks,
Edi
Jane, any insights to how you did that? A guide or something similar would be awesome. 🙂
Hi Marcus,
I have a question, Do you know, why it shows a blue area pointing to the origin of the map, when I choose Freight Order like display Profile?
I would like to see only the green line that is the direction of the route.
Regards
Well, as the Geo-Routing is custom code I would check there how the geo-route points look for that route. The screenshot points kind of into the direction that a wrong map object type is set (area instead of link) or maybe wrong route points.
Hello Marcus,
The above image is displayed before selecting detailed routes. When I choose detailed routes the result is similar, lines to origin. Yesterday, I compare with the Client PC and it looks great. I'm the only with this problem 🙁 , maybe one component or driver is not compatible, but its ok for me for the moment 🙂 .
Regards
Hello Marcus,
Is it possible to change the color of the detailed routes?
I like to use a different color to yellow.
Regards
Sure, implement the TM Geographical Map Enhancement Spot and there is the option to adjust colors.
Hi Marcus i followed the steps and my map was changed but i think the fly route continues in screen with detailed route what could i did wrong?
before
after
Hi, are you able to solve this problem? Could you Please let me know the solution?
thanks in advance.
I am a new user and explorer of SAP Supply Chain capacity and this is like music to my ears
Hello,
however by default the connections between locations on the map are displayed with a straight arrow, some customers want to see the detailed routes right away.
To achieve this, you may implement BADI /SCMTMS/EX_MAP_ENHANCE, method /SCMTMS/IF_MAP_ENHANCE_VB21~ADJUST_NEW_OBJECTS, where you call your GIS provider. Route points to be added to CT_LINK_OBJECTS[]-ROUTE_POINTS.
Hi Marcus,
I hope you are well.
I have implemented the above. When I debug I see a message 3 georoutes deterimined. But when the response goes to the HANA front end, it gives a message 0 georoutes determined. I was wondering if you have any idea something like this would happen?
Best regards,
Seamus