Skip to Content

Set up geocoding service in hybris Marketing on prem

Dear Community,

I try to set up the automatic geocoding of customer address data to longitude / latitude in hybris marketing on prem with openstreetmap as geocoding service.

Connection to nominatim.openstreetmap.org is working – SM59 test returns 200 (OK), as explained on https://help.sap.com/saphelp_uiaddon20/helpdata/en/5d/ef8651437dfc53e10000000a44538d/frameset.htm “Allowing External Geo-Coding Service Calls”

Now I have to set up “Register Geocoding Prgram in the System” and “Assign relevant address field for geocoding” - right?

Which settings are correct for hybris marketing in order to get longitude / latitude to an interaction contact facet?

Is an additional installation or configuration required?

Thank you!
Best regards,
Peter

geocoder.png (82.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 10, 2017 at 11:45 PM

    Dear Peter,

    I think the fields refer to the field names in structure ADRC_STRUC, that is why the names also differ from the ones in the root/facet tables.

    What we did is call the (Google in our case) geocoding service in the contact update BAdI, and map the values from that call to the fields longiture/latitude. Since as you mentioned, we do not want to save the geolocation in a separatae table.

    Also, please try report GEOCODING_FIRST to see whether the geolocation gets determined correctly from an address.

    With regards,

    Akil

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 10, 2017 at 02:34 AM

    Dear Peter,

    Please see following when you want to use nominatim.openstreetmap.org for your geocode determination. They have explained in detail, and also provide you with the classes you need to implement:

    ZGEOCODE

    With regards,

    Akil

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 10, 2017 at 08:52 PM

    Dear Akil,

    thank you - I installed ZGEOCODE and a test with report GEOCODING_FIRST seems to be ok.

    But in SPRO "Assign Relevant Address Fields for Geocoding" there are fields, that we do not have in our customer facet table CUAND_CE_IC_FT_D e.g. we do not have CITY2, but we have POSTCODE1 which is not selectable (only POST_CODE1)

    Moreover accordint to ZGEOCODE results are saved in table GEOLOC. I think this table isn't used in hybris Marketing on prem.
    Shouldn't it be table CUAND_CE_IC_FT_D field LATITUDE and LONGITUDE ?

    Do we need an other geocoding service for hybris Marketing?

    thank you,
    Peter

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 11, 2017 at 05:16 AM

    Dear Akil,

    yes, geolocation gets determined correctly - GEOCODING_FIRST provides correct geocoordinate.

    Can you please provide an exempal where and how you call our geocoding service and save the result?
    So settings in SPRO “Register Geocoding Prgram in the System” and “Assign relevant address field for geocoding” are not used in your setup?

    Thank's once again,
    Best regards, Peter

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Dear Peter,

      In the CUAN_CONTACT_UPDATE BAdI, in the method IF_CUAN_CE_IC_UPDATE_SP7~IMP_IA_IC_UPDATE_IC_ROOT we added the code to update the longitude and longitude with the call as done in GEOCODING_FIRST (lines 69 to 108, though we might have made some small changes, like only calling this code when address information is present and geolocation information is not received). After which we hand over the longitude and latitude as below.

              READ TABLE lt_containers INTO ls_containers INDEX 1.
              lt_aesc = ls_containers-container.
      *       Get longitude and latitude.
              LOOP AT lt_aesc INTO ls_aesc.
                IF ls_aesc-field = 'LONGITUDE'.
                  ls_ia-longitude%ic = ls_aesc-value.
                ELSEIF ls_aesc-field = 'LATITUDE'.
                  ls_ia-latitude%ic = ls_aesc-value.
                ENDIF.
              ENDLOOP.