I had the task to insert additional vacation days to the TimeAccount of some employees. To do this, you have to insert some new entries in the related TimeAccountDetail entity.
But to me, it was unclear, what I have to provide as externalCode. Obviously, TimeAccount_externalCode required the externalCode of the TimeAccount, which the entry should belong to. But I was expecting that the TimeAccountDetailexternalCode should be created, when UPSERTing the entry. Somehow the documentation is missing some explanation here… But in the note 2243841 I found the missing hint:
While using API calls, Successfactors system would not generate unique external Code for TimeAccountDetail API. You will have to explicitly provide external code which should be unique.
Ok, so simply provide a random externalCode. Following my UPSERT Request:
### The related TimeAccount, where the entry should belong to. Can be fetched via another API call
@TimeAccount_externalCode=aac183cdc57242cb9f7454131f0da069
### Create a random TimeAccountDetail externalCode
@externalCode=70b54990b44440fab4c5084c971cc744
### Insert balances
GET {{$dotenv sf_api_url}}/odata/v2/upsert
Authorization: Basic {{$dotenv sf_api_auth_base64}}
Accept: application/json
Content-Type: application/json
{
"__metadata" : {
"uri" : "http://my-sf-demo-api-server/odata/v2/TimeAccountDetail(TimeAccount_externalCode='{{TimeAccount_externalCode}}',externalCode='{{externalCode}}')",
"type" : "SFOData.TimeAccountDetail"
},
"TimeAccount_externalCode" : "{{TimeAccount_externalCode}}",
"externalCode" : "{{externalCode}}",
"bookingUnit" : "DAYS",
"bookingType" : "MANUAL_ADJUSTMENT",
"bookingDate" : "\/Date(1747872000000)\/",
"bookingAmount" : "1",
"comment" : "Urlaub"
}
But what ever I tried as externalCode, it always failed…
We generally do not suggest to use Upsert operation for TimeAccountDetail OData API due to external code limitation.
This confused me even more, but as the note is from 2016, I thought it could be outdated, and the official API documentation is correct. But it seems the opposite is right…. When trying a normal POST instead of an UPSERT, it immediately worked.
### The related TimeAccount, where the entry should belong to. Can be fetched via another API call
@TimeAccount_externalCode=aac183cdc57242cb9f7454131f0da069
### Create a random TimeAccountDetail externalCode
@externalCode=70b54990b44440fab4c5084c971cc744
### Insert balances
POST {{$dotenv sf_api_url}}/odata/v2/TimeAccountDetail
Authorization: Basic {{$dotenv sf_api_auth_base64}}
Accept: application/json
Content-Type: application/json
{
"TimeAccount_externalCode" : "{{TimeAccount_externalCode}}",
"externalCode" : "{{externalCode}}",
"bookingUnit" : "DAYS",
"bookingType" : "MANUAL_ADJUSTMENT",
"bookingDate" : "\/Date(1747872000000)\/",
"bookingAmount" : "1",
"comment" : "Urlaub"
}
Not sure if I did something wrong when using UPSERT, but why should I even use an UPSERT, if I can simply use a normal POST request. Once again, poor SAP documentation has cost me a lot of my lifetime…
You can use the SAP_WAPI_CREATE_WORKLIST function module to display all workitems that are currently in a user’s inbox. This is very useful, as you cannot use the “on behalf of” function in MyInbox.
Brief overview of how to find all notes contained in the installed SPs during a system patch.
First, look up the new SP level for a specific component. For example, if the old SP level was 0026 and the patch it is 0028, you need to check the notes for SP 0027 and 0028.
Meine Favoriten importieren. (Man kann übrigens einfach Favoriten über das Kommandofeld hinzufügen via %_GCADDF, technisch liegen die Favoriten in der Tabelle SMEN_BUFFC)
Unter Zusätze → Einstellungen (Umschalt + F9) die Einstellungen öffnen und “Technische Namen anzeigen” anhaken
Unter Optionen das Theme von Belize auf Blue Crystal abändern und eine Systemfarbe einstellen
sowie Schlüssel in Dropdown-Listen anzeigen
In der SE11 über Hilfsmittel → Benutzerdefinierte Einstellungen → Data Browser → Ausgabenliste die ALV-Grid-Darstellung aktivieren
In der SE80 über Hilfsmittel → ABAP Editor → Pretty Printer die folgenden Einstellungen setzen