SAP Knowledge Base Article - Public

2769109 - Create Contract via API CreatedByUser

Symptom

You are using API_PURCHASECONTRACT_PROCESS_SRV to create contracts in the S/4Hana Public Cloud. In the payload, you are transferring a user ID in the 'CreatedByUser' field but when the Contract is created it shows the communication user of the API and not the 'CreatedByUser' passed in the payload.

Environment

SAP S/4HANA Cloud Public Edition All Versions

Reproducing the Issue

  1. Call API_PURCHASECONTRACT_PROCESS_SRV 
  2. In the payload transfer a user ID via field "CreatedByUser": "CB9980000000"
  3. Open APP 'Manage Purchase Contracts' note the 'Created By' field shows the Communication User and not the 'CreatedByUser' from the payload. 

Cause

The 'CreatedByUser' field of a Contract is technical administration data, which may be relevant for audit purposes. It therefore has to reflect the actual user that created the document. For this reason the system user is taken ahead of any user passed in the payload.

Resolution

Standard system behaviour

Keywords

EKKO-ERNAM, ERNAM, is_header-CREATEDBYUSER, sy-uname, CL_MM_PUR_CON_PROCESS_API, MAP_PAYLOAD_TO_API_HEADER, CreatedByUser. , KBA , MM-FIO-PUR-SQ-CON , Fiori UI for Manage Purchase Contracts , MM-PUR-OA-CON , Contract , Problem

Product

SAP S/4HANA Cloud Public Edition all versions ; SAP S/4HANA Cloud all versions