SAP Knowledge Base Article - Public

3096633 - How to create Position records with auto generated codes - OData API


You need to create Position records with auto generated codes through OData API. This means that you don't want to pass any code values in the Upsert payload, making SF create the codes by itself.

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


  • SAP SuccessFactors HXM Suite
    • OData API


You need to provide an Upsert payload as below:

    "effectiveStartDate": "/Date(1630454400000)/",
    "division": "DEV",
    "effectiveStatus": "A",
    "positionTitle": "0",
    "__metadata": {
        "type": "SFOData.Position",
        "uri": "Position"

You should not pass any values to "code" field.

Also in the "uri" field inside the __metadata brackets, you just need to provide "Position" value.

This will return the following response with the auto generated code:

        <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>

See Also

Position - SAP Help Portal


id, system, created, automatic, identifier, payload, json, xml, sf, number, digit , KBA , LOD-SF-INT-MDF , Metadata Framework API (MDF) , LOD-SF-INT-ODATA , OData API Framework , How To


SAP SuccessFactors HCM Core all versions