SAP Knowledge Base Article - Public

2677399 - Upsert with links not linking the Navigation Entity correctly

Symptom

While performing a Successfactors OData v2 UPSERT operation, the link fields are not updated correctly when multiple entities are present.

Reproducing the Issue

 Perform an UPSERT with payload having similar structure to the below example. Refer the highlighted link entries have different ids and different entities for each User. In the example you will see 3 Users with distinct links.

  1. User(userId=50000409) [link {manager(userId=NO_MANAGER)}{matrixManager(userId=100)}
  2. User(userId=50000411) [link {manager(userId=200)}
  3. User(userId=50000447) [link {manager(userId=300)}
<?xml version="1.0" encoding="UTF-8"?>
<User>
  <User>
    <link>
      <manager>
        <User>
          <userId>NO_MANAGER</userId>
        </User>
      </manager>
      <matrixManager>
        <User>
          <userId>100</userId>
        </User>
      </matrixManager>
    </link>
    <status>active</status>
    <userId>50000409</userId>
    <username>DFGDFGADFS</username>
    <firstName>robinmanager</firstName>
    <department />
  </User>
  <User>
    <link>
      <manager>
        <User>
          <userId>200</userId>
        </User>
      </manager>
    </link>
    <status>active</status>
    <userId>50000411</userId>
    <username>SANDERPROSI</username>
    <firstName>Sander</firstName>
    <department />
  </User>
  <User>
    <link>
      <manager>
        <User>
          <userId>300</userId>
        </User>
      </manager>
    </link>
    <status>active</status>
    <userId>50000447</userId>
    <username>RTITI</username>
    <firstName>frambach</firstName>
  </User>
</User>

Cause

The present adapters implementation does not provide a mechanism to correlate different links value with multiple entries. In Upsert operation, you can link every entity to the same navigation entity with the same key parameters, using <link>. You cannot link to different navigation entity.

Resolution

 Successfactors OData V2 adapters provides UPSERT in Batch. Below example outlines the expected Batch request payload for the prior example. Kindly note each User entry is placed in a separate <batchChangeSet>.Refer help documentation for details on the feature. Using Model Wizard you can generate the XSD for the below XML scheme.

<?xml version="1.0" encoding="UTF-8"?>
<batchParts>
  <batchChangeSet>
    <batchChangeSetPart>
      <method>UPSERT</method>
      <User>
        <User>
          <userId>50000409</userId>
          <firstName>robinmanager</firstName>
          <status>active</status>
          <username>DFGDFGADFS</username>
          <link>
            <matrixManager>
              <User>
                <userId>100</userId>
              </User>
            </matrixManager>
            <manager>
              <User>
                <userId>NO_MANAGER</userId>
              </User>
            </manager>
          </link>
        </User>
      </User>
    </batchChangeSetPart>
  </batchChangeSet>
  <batchChangeSet>
    <batchChangeSetPart>
      <method>UPSERT</method>
      <User>
        <User>
          <userId>50000411</userId>
          <firstName>Sander</firstName>
          <status>active</status>
          <username>SANDERPROSI</username>
          <link>
            <manager>
              <User>
                <userId>200</userId>
              </User>
            </manager>
          </link>
        </User>
      </User>
    </batchChangeSetPart>
  </batchChangeSet>
  <batchChangeSet>
    <batchChangeSetPart>
      <method>UPSERT</method>
      <User>
        <User>
          <userId>50000447</userId>
          <firstName>frambach</firstName>
          <status>active</status>
          <username>RTITI</username>
          <link>
            <manager>
              <User>
                <userId>300</userId>
              </User>
            </manager>
          </link>
        </User>
      </User>
    </batchChangeSetPart>
  </batchChangeSet>
</batchParts>

Keywords

SAP, CPI, HCI, Upsert, OData V2, Navigation Link, SuccessFactors , KBA , LOD-HCI-PI-GB , Generation & Build Framework , Problem

Product

SAP SuccessFactors HCM Core 1805