Module sap.s4hana.api_del_doc_with_credit_block
ballerinax/sap.s4hana.api_del_doc_with_credit_block Ballerina library
Overview
SAP S/4HANA is a robust enterprise resource planning (ERP) solution, designed for large-scale enterprises by SAP SE. It covers core business processes such as finance, procurement, sales, and materials management, including delivery processing.
WSO2 SAP S/4HANA Delivery Document with Credit Block provides a way to interact with the Delivery Document with Credit Block - Read, Check, Release, Reject (A2X) API. The service allows to read delivery documents that are blocked by credit management and the reasons for rejection, and to check, release or reject the credit block of a delivery document.
Key Features
- Read delivery documents that are blocked by credit management
- Check, release or reject the credit block of a delivery document
- Read the sales document reasons for rejection
Setup guide
This connector uses Basic Authentication with an SAP S/4HANA Cloud communication user. Each S/4HANA API is
exposed through a communication scenario, so the user must be assigned to a communication arrangement for the
Sales Credit Management Integration (SAP_COM_0325) scenario before the connector can call it.
All the apps used below are in the Communication Management group of the SAP Fiori launchpad.

Step 1: Create a communication user
- Sign in to your SAP S/4HANA Cloud system as an administrator.
- Open the Maintain Communication Users app and choose New.
- Enter a user name and a description, set a password, and choose Create.
Note the user name and password. These are the credentials the connector uses.
Step 2: Create a communication system
-
Open the Communication Systems app and choose New.
-
Enter a system ID and a system name, and choose Create.

-
Under General > Technical Data, enter a host name and a Logical System (an uppercase ID of up to 10 characters, for example,
INTEGRATOR). Some scenarios refuse to activate when the logical system is empty. -
Under Users for Inbound Communication, add the communication user from Step 1 with the User Name and Password authentication method.

-
Choose Save.
Step 3: Create a communication arrangement
-
Open the Communication Arrangements app and choose New.
-
In the Scenario value help, search for Sales Credit Management Integration and select
SAP_COM_0325. This is the scenario that exposesAPI_DEL_DOC_WITH_CREDIT_BLOCK, the service this connector calls.
-
Enter a unique name for the arrangement and choose Create.

-
Select the communication system from Step 2. The communication user from Step 1 is filled in as the inbound user. If the scenario lists outbound services that the integration does not need, clear their Active check boxes so that no outbound user is required.

-
Choose Save.
Step 4: Note the hostname
Open the saved arrangement. The API-URL next to Own SAP Cloud System shows the hostname
(<unique id>-api.s4hana.cloud.sap).

You now have everything the connector needs:
- hostname - the API hostname, for example,
my123456-api.s4hana.cloud.sap - username - the communication user name
- password - the communication user password
Quickstart
To use the sap.s4hana.api_del_doc_with_credit_block connector in your Ballerina application, modify the .bal file as follows:
Step 1: Import the module
Import the sap.s4hana.api_del_doc_with_credit_block module.
import ballerinax/sap.s4hana.api_del_doc_with_credit_block as delDoc;
Step 2: Instantiate a new connector
Use the hostname and credentials to initiate a client.
configurable string hostname = ?; configurable string username = ?; configurable string password = ?; delDoc:Client delDocClient = check new ( { auth: { username, password } }, hostname );
Step 3: Invoke the connector operation
Now, utilize the available connector operations.
delDoc:CollectionOfA_CreditBlockedDeliveryDocWrapper listCreditBlockedDeliveryDocs = check delDocClient->listA_CreditBlockedDeliveryDocs();
Step 4: Run the Ballerina application
bal run
Import
import ballerinax/sap.s4hana.api_del_doc_with_credit_block;Other versions
1.0.0