SAP Knowledge Base Article - Public

3781394 - Credit Management Master Data API: 400 "credit profile data already exists"

Symptom

  • POST to /CreditMgmtBusinessPartner returns 400 error: "value": "Credit profile data already exists for partner the id".
  • PATCH to /CreditMgmtBusinessPartner('the id') returns 404 error: "value": "Business partner the id does not participate in Credit Management.".
  • In some responses, 404 is accompanied by "UKM/077: Key not found".

Environment

  • Product: SAP S/4HANA Cloud Public Edition
  • Fiori-UI for Credit Management (Public Cloud)

Reproducing the Issue

  1. Send a POST request to /CreditMgmtBusinessPartner with profile fields (for example, CreditRiskClass, CreditCheckRule, CreditScoreAndLimitCalcRule) and include to_CreditMgmtAccountTP to create a segment; observe 400 "credit profile data already exists".
  2. Send a PATCH request to /CreditMgmtBusinessPartner('the id') to update profile fields; observe 404 "business partner the id does not participate in credit management" (and/or UKM/077 key not found).

Cause

  • A credit profile already exists for the business partner in credit management master data; posting the profile again results in a "profile already exists" error. Segment creation must be performed via the segment endpoint.

Resolution

  1. Do not POST the credit profile again when it already exists.
  2. Create the credit management account (segment) directly via the segment navigation:
  • Endpoint: /CreditMgmtBusinessPartner('{BusinessPartner}')/to_CreditMgmtAccountTP

  • Provide a request body with the required segment fields, for example:
  • CreditSegment
  • CreditSegmentCurrency
  • CreditLimitValidityEndDate
  • CreditLimitAmount (and other relevant attributes as needed)

Example payload:

  • POST url: /CreditMgmtBusinessPartner('{2100001}')/to_CreditMgmtAccountTP 
  • {
      "CreditSegment": "1000",
      "CreditLimitAmount": "10000",
      "CreditLimitValidityEndDate": "9999-12-31T00:00:00",
      "CreditLimitIsZero": false,
      "CreditSegmentCurrency": "TWD"
    }
  • Retry the POST to the segment endpoint and confirm that the credit segment is created successfully.

See Also

refer to: credit management master data api (public cloud) documentation

Keywords

credit management api, creditmgmtbusinesspartner, creditmanagementaccount, to_creditmgmtaccounttp, 400 error, 404 error, ukm/077, credit profile data already exists, business partner does not participate, master data already exists, post, patch, odata v2, credit segment, s/4hana cloud public edition , KBA , FIN-FIO-CCD-CR-2CL , Fiori-UI for Credit Management (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions