Skip to main content

Actions

The ballerinax/sap.s4hana.api_sd_sa_soldtopartydetn package exposes the following clients:

ClientPurpose
ClientProvides access to sold-to party determination records for sales scheduling agreements in SAP S/4HANA.

Client

Provides access to sold-to party determination records for sales scheduling agreements in SAP S/4HANA.

Configuration

FieldTypeDefaultDescription
authhttp:CredentialsConfigRequiredHTTP Basic Auth credentials containing username and password for the SAP inbound communication user.
httpVersionhttp:HttpVersionHTTP_2_0HTTP protocol version to use for requests.
http1SettingsClientHttp1Settings()HTTP/1.x client settings including keep-alive, chunking, and proxy configuration.
http2Settingshttp:ClientHttp2Settings()HTTP/2 client settings.
timeoutdecimal60Request timeout in seconds.
forwardedstring"disable"Forwarded header handling configuration.
poolConfighttp:PoolConfiguration()HTTP connection pool configuration.
cachehttp:CacheConfig()HTTP response caching configuration.
compressionhttp:CompressionCOMPRESSION_AUTOCompression setting for requests and responses.
circuitBreakerhttp:CircuitBreakerConfig()Circuit breaker configuration for fault tolerance.
retryConfighttp:RetryConfig()Retry configuration for failed requests.
responseLimitshttp:ResponseLimitConfigs()Response size limit configuration.
secureSockethttp:ClientSecureSocket()SSL/TLS configuration for secure connections.
proxyhttp:ProxyConfig()HTTP proxy server configuration.
validationbooleantrueEnable or disable response payload validation.

Initializing the client

import ballerinax/sap.s4hana.api_sd_sa_soldtopartydetn as soldToParty;

configurable string hostname = ?;
configurable string username = ?;
configurable string password = ?;

soldToParty:Client sapClient = check new (
{auth: {username, password}},
hostname
);

Operations

Sold-to party determination

listA_DelivSchedSoldToPartyDetns

Retrieves a collection of all delivery scheduling sold-to party determination records, with optional OData query parameters for filtering, sorting, and pagination.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoAdditional HTTP headers to include in the request.
queriesListA_DelivSchedSoldToPartyDetnsQueriesNoOData query options: $top, $skip, $filter, $orderby, $inlinecount, $select.

Returns: CollectionOfA_DelivSchedSoldToPartyDetnWrapper|error

Sample code:

soldToParty:CollectionOfA_DelivSchedSoldToPartyDetnWrapper result =
check sapClient->listA_DelivSchedSoldToPartyDetns(
queries = {"\$top": "10", "\$filter": "Supplier eq 'VENDOR001'", "\$select": "Supplier,PartnerDescription,SoldToParty"}
);

Sample response:

{
"d": {
"__count": "2",
"results": [
{
"Supplier": "VENDOR001",
"PartnerDescription": "Main Warehouse",
"UnloadingPointName": "Dock A",
"SoldToParty": "CUST1000"
},
{
"Supplier": "VENDOR001",
"PartnerDescription": "Secondary Depot",
"UnloadingPointName": "Dock B",
"SoldToParty": "CUST1001"
}
]
}
}
getA_DelivSchedSoldToPartyDetn

Retrieves a specific sold-to party determination record by its composite key consisting of Supplier, PartnerDescription, and UnloadingPointName.

Parameters:

NameTypeRequiredDescription
SupplierstringYesThe supplier number at the customer location (max 17 characters).
PartnerDescriptionstringYesThe customer-specific description of the business partner (max 30 characters).
UnloadingPointNamestringYesThe unloading point name at the customer site (max 25 characters).
headersmap<string|string[]>NoAdditional HTTP headers to include in the request.
queriesGetA_DelivSchedSoldToPartyDetnQueriesNoOData query options: $select to limit returned fields.

Returns: A_DelivSchedSoldToPartyDetnWrapper|error

Sample code:

soldToParty:A_DelivSchedSoldToPartyDetnWrapper result =
check sapClient->getA_DelivSchedSoldToPartyDetn(
"VENDOR001",
"Main Warehouse",
"Dock A"
);

Sample response:

{
"d": {
"Supplier": "VENDOR001",
"PartnerDescription": "Main Warehouse",
"UnloadingPointName": "Dock A",
"SoldToParty": "CUST1000"
}
}
performBatchOperation

Sends a grouped OData batch HTTP request to execute multiple operations in a single round-trip to the SAP S/4HANA server.

Parameters:

NameTypeRequiredDescription
requesthttp:RequestYesAn http:Request object containing the multipart batch body formatted according to OData batch request conventions.
headersmap<string|string[]>NoAdditional HTTP headers to include in the batch request.

Returns: http:Response|error

Sample code:

http:Request batchRequest = new;
batchRequest.setHeader("Content-Type", "multipart/mixed;boundary=batch_001");
batchRequest.setTextPayload(
"--batch_001\r\n" +
"Content-Type: application/http\r\n" +
"Content-Transfer-Encoding: binary\r\n\r\n" +
"GET A_DelivSchedSoldToPartyDetn HTTP/1.1\r\n\r\n" +
"--batch_001--"
);
http:Response batchResponse = check sapClient->performBatchOperation(batchRequest);

Sample response:

HTTP/1.1 200 OK
Content-Type: multipart/mixed; boundary=response_boundary

--response_boundary
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 200 OK
Content-Type: application/json

{"d":{"results":[{"Supplier":"VENDOR001","PartnerDescription":"Vendor 001","SoldToParty":"CUST001"}]}}
--response_boundary--