SAP Knowledge Base Article - Public

3099160 - Is it possible to change the API visibility of FOLocation fields?

Symptom

There are some fields in FOLocation entity that have "sap:visible" (visibility) equal to false. Some examples are addressCountry, addressCity, addressZipCode. Is it possible to change their visibility?

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

  • SAP SuccessFactors HXM Suite
    • OData API

Resolution

These not visible fields that start with "address" on FOLocation are derived from FOCorporateAddressDEFLT entity. These fields are not visible by design on FOLocation (this can't be changed), but their data can be viewed when navigating from FOLocation to FOCorporateAddressDEFLT, for example through this API call: odata/v2/FOLocation?$expand=addressNavDEFLT

If you are upserting data into FOLocation and provide a value to any of these fields, the Upsert should work properly. For example:

{
   "__metadata":{
      "uri":"FOLocation(externalCode='Seoul',startDate=datetime'1990-01-01T00:00:00')"
   },
   "status":"A",
   "endDate":"/Date(253402300799000)/",
   "timezone":"Asia/Seoul",
   "description":"Seoul, Korea",
   "name":"Seoul",
   "locationGroup":"APAC",
   "addressCountry": "KOR",
   "addressCity": "Gangnam-gu"
}

The response was:

<m:properties>
       <d:key>FOLocation/externalCode=Seoul,FOLocation/startDate=1990-01-01T00:00:00.000-05:00</d:key>
       <d:status>OK</d:status>
       <d:editStatus>UPSERTED</d:editStatus>
       <d:message m:null="true"></d:message>
       <d:index m:type="Edm.Int32">0</d:index>
       <d:httpCode m:type="Edm.Int32">200</d:httpCode>
       <d:inlineResults m:type="Bag(SFOData.UpsertResult)"></d:inlineResults>
</m:properties>

However when querying these fields afterwards, you need to navigate from FOLocation to FOCorporateAddressDEFLT. For example:

API request:
https://<api_url>/odata/v2/FOLocation?$select=externalCode,addressNavDEFLT/country,addressNavDEFLT/city&$expand=addressNavDEFLT&$filter=externalCode eq 'Seoul'&$format=json

API response:
{
      "__metadata": {
            "uri": "https://<api_url>/odata/v2/FOLocation(externalCode='Seoul',startDate=datetime'1990-01-01T00:00:00')",
            "type": "SFOData.FOLocation"
       },
       "externalCode": "Seoul",
       "addressNavDEFLT": {
            "__metadata": {
                  "uri": "https://<api_url>/odata/v2/FOCorporateAddressDEFLT(6321M)",
                  "type": "SFOData.FOCorporateAddressDEFLT"
            },
            "country": "KOR",
            "city": "Gangnam-gu"
       }
}

See Also

2951862 - FOLocation/companyFlx not visible to API

FOLocation - SAP Help Portal

Keywords

visible, read, both, edit, odata, api, corporate, address, Business, false, true, query, call , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , How To

Product

SAP SuccessFactors HCM all versions