How to connect SAP Visual Business to the xMap2 (REST)?

This space is dedicated to SAP users - administrators and programmers who want to integrate PTV Developer (native), the PTV xServers or the SAP Hana Spatial Services (HSS). Topics which require specific SAP based knowhow or which deal with SAP based mechanisms will be collected here.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 3014
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to connect SAP Visual Business to the xMap2 (REST)?

Post by Bernd Welter »

Hi there,

today I was in a call with an xServer "rookie" who just starts with the APIs. He asked me how to create a mapping interface based on Visual Business but unfortunately I am not familiar with SAP in detail. He showed this SAP page and the PTV based document which is based on xMap1.

He expected me to tell him a simple REST URL scheme such as
but I am not sure whether this scheme is what he would need. Can anyone guide us through this?

Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
MISTERX
Posts: 59
Joined: Mon Jun 02, 2014 11:50 am

Re: How to connect SAP Visual Business to the xMap2 (REST)?

Post by MISTERX »

Hi Bernd!

You're very close to the correct URL for REST via xMap2 (xMap1 will only accept WMS as described in SCN) in SAP VBI:
PROFILE might be silkysand, e.g.
TOKEN is the required authentication at PTV-xServer-Internet
LAYERS might be
  • labels
    background
    transport
    PTV_PreferredRoutes
    PTV_TruckAttributes
Most simple request:
Map with TruckAttributes and RestrictionZones:
How to deal with map-tiles:
https://xserver2-europe-eu-test.cloud.p ... g%7C_____1

Please take into consideration that Customizing in SAP requires LOD (aka Level-Of-Detail) instead of z!
Attachments
Settings in SAP for xMap2 On-Premises
Settings in SAP for xMap2 On-Premises
Mr. X
  • Integration PTV <> SAP
  • Senior Consultant

________________________________________________

Optimism is only a lack of data!
saravana.subbiah
Posts: 3
Joined: Tue Jul 28, 2020 4:09 am

Re: How to connect SAP Visual Business to the xMap2 (REST)?

Post by saravana.subbiah »

Hi Bernd/MISTERX,

Thanks for replying,

@MISTERX, Could you please provide your inputs for the following questions?

1. For an On Premise (Local Server) installation of PTV, Do we need to pass the "xtok" parameter as a part of the "REST API URL"? (I assume this is not needed, Please correct me if am wrong)

2. Will the below proposed URL work for SAP TM application as well where an Interactive map is usually rendered for performing Freight planning and for viewing actual routes between different geo-coordinates?

http://[FQDN]/services/rest/XMap/tile/{LOD}/{X}/{Y}?storedProfile=silkysand

I assume values for {LOD} ,{X} and {Y} are determined dynamically by SAP when it generates a call to PTV server. Kindly let us know if we need to specify default values for these parameters in the Map configuration step?

Note: Again this question is for an On Premise (Local Server) installation.

3.If the local installation has a "Https" connection with the server can we replace "Http" connection with "Https" in the Rest API URL?

Thanks and Regards,
Saravana S
User avatar
MISTERX
Posts: 59
Joined: Mon Jun 02, 2014 11:50 am

Re: How to connect SAP Visual Business to the xMap2 (REST)?

Post by MISTERX »

Dear Saravana,

you are welcome!

Concerning your questions:

#1 You got it right: On-Premises-xServers do not need xtok (aka token).

#2 Yes, SAP TM provides a map-container in the planning cockpit and will work as well with xMap2 via REST and the values for {LOD}, {X} und {Y} will be determined dynamically by SAP.

#3 On-Premises-xServer (aka local installation) run normally with HTTP, only. From my point of view, there are no reasons to work with HTTPS. But anyhow, there is no difference in the request-URL besides with or without S (aka Secure).
Mr. X
  • Integration PTV <> SAP
  • Senior Consultant

________________________________________________

Optimism is only a lack of data!
saravana.subbiah
Posts: 3
Joined: Tue Jul 28, 2020 4:09 am

Re: How to connect SAP Visual Business to the xMap2 (REST)?

Post by saravana.subbiah »

Hi,

We updated the SAP Map configuration as per your suggestion, We are now able to render the PTV map in the SAP TM Application.

Note: The "Https" prefix had worked for us.

Thanks for your timely support!

Thanks and Regards,
Saravana S
User avatar
MISTERX
Posts: 59
Joined: Mon Jun 02, 2014 11:50 am

Re: How to connect SAP Visual Business to the xMap2 (REST)?

Post by MISTERX »

To whom it may concern!

Just to shorten the way to the first map in any application, I'd like to give some hints:

There is no need to install an xServer2 locally (On-Premises). The PTV xServer internet is ready to be of service.

To get a free trial "xtok" for testing PTV xServer internet (60 days validity):
https://www.ptvgroup.com/en/solutions/p ... /test-now/

The thread (in this forum)
xServer2: : setup a basic Auth
contains some meaningful information about the "xtok":
https://xserver.ptvgroup.com/forum/view ... =43&t=1120
Mr. X
  • Integration PTV <> SAP
  • Senior Consultant

________________________________________________

Optimism is only a lack of data!
Post Reply