SD Program Custom development Interface

Dealer (B2B) Order Portal Integration with SAP Sales Orders

Short answer: A custom integration between the dealer order portal and SAP. Orders from the portal are checked and turned into sales orders automatically; the order number, confirmed quantity and date are returned to the portal. The portal queries the dealer-specific price, open orders and account balance from SAP in real time, so the price list is not kept in two places.

Estimated effort
L · 12–18 working days
System
ECC and S/4HANA
Tables
9
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

Why is the standard not enough?

In the standard, external orders can be received via EDI/IDoc (and reprocessed with BD87), but this needs an EDI partner setup and a converter for each dealer, and most dealers do not use EDI. ECC has no ready service that offers the dealer price, balance and order status queries a portal needs. S/4HANA has released sales order APIs, but duplicate checks, dealer-specific responses and error handling still have to be designed. As a result portal orders are often retyped in VA01.

Who uses it? Dealer channel sales teams, order entry and customer service, portal and integration teams.

Closest standard alternatives

  • VA01 Create Sales Order. Enters orders manually; portal orders have to be retyped.
  • BD87 Status Monitor for ALE Messages. Reprocesses orders received via EDI/IDoc; requires an EDI setup for each dealer.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
VBAKSales Document HeaderSales order header createdWriteECC + S/4
VBAPSales Document ItemOrder items createdWriteECC + S/4
VBKDSales Document: Business DataDuplicate check by portal order number (customer PO number)Read / writeECC + S/4
VBEPSales Document: Schedule Line DataConfirmed quantity and date (response to the portal)ReadECC + S/4
KNVVCustomer Master Sales DataDealer's sales area dataReadECC + S/4
KNVPCustomer Master Partner FunctionsDealer's ship-to partnersReadECC + S/4
KNA1Customer Master (General Section)Dealer name and order blockReadECC + S/4
MVKESales Data for MaterialSales status of the materialReadECC + S/4
BALHDRApplication Log HeaderProcessing log of each portal messageWriteECC + S/4

BAPIs and functions used

  • BAPI_SALESORDER_CREATEFROMDAT2Create Sales Order. Creates the sales order from the portal order
  • BAPI_SALESORDER_SIMULATESimulate Sales Order. Calculates the dealer-specific price and confirmation date for the portal
  • BAPI_SALESORDER_GETSTATUSDisplay Sales Order Status. Returns the open order status to the portal
  • BAPI_AR_ACC_GETKEYDATEBALANCECustomer Account Balance at Key Date. Returns the dealer's account balance
  • BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Commits the order

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
P_AUARTOrder type for portal ordersSingle valueVBAK-AUARTYesOR
S_KUNNRDealer (monitor screen)Range / multipleVBAK-KUNNRNo200510
S_ERDATMessage date (monitor screen)Range / multipleVBAK-ERDATNo16.11.2026
P_ERRShow failed messages onlyCheckbox—NoX

Input file columns

The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.

#ColumnTarget fieldRequired
1Portal order numberVBKD-BSTKDYes
2DealerVBAK-KUNNRYes
3Ship-toVBPA-KUNNRNo
4MaterialVBAP-MATNRYes
5QuantityVBAP-KWMENGYes
6UnitVBAP-VRKMENo
7Requested delivery dateVBEP-EDATUNo

Sample upload file

1Portal order number *Dealer *Ship-toMaterial *Quantity *UnitRequested delivery date
2B2B-2026-118734200510200511FG-104024ST11/25/2026
3B2B-2026-118734200510200511FG-221010ST11/25/2026
4B2B-2026-118790200534200534FG-104060ST11/28/2026
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1Message timeCalculated Date and time the message was received (BALHDR)
2Portal order numberVBKD-BSTKD
3DealerVBAK-KUNNR
4SAP orderVBAK-VBELN
5Net valueVBAK-NETWR
6CurrencyVBAK-WAERK
7ConfirmationCalculated Fully, partly or not confirmed (VBEP-BMENG)
8StatusCalculated Created, awaiting approval, duplicate or error
9MessageCalculated First error or information message from the BAPI return table

Sample result list

Message timePortal order numberDealerSAP orderNet valueCurrencyConfirmationStatusMessage
2026-11-16 09:14B2B-2026-1187342005101002458030,480TRYFullyCreatedOrder saved
2026-11-16 10:02B2B-2026-1187902005341002458352,200TRYPartlyAwaiting approvalCredit limit exceeded; order blocked
2026-11-16 10:05B2B-2026-118790200534DuplicateThis portal order number was already received as 10024583
2026-11-16 11:37B2B-2026-118812200588ErrorMaterial FG-3300 is not released for sale
A view built with fictional sample data; not real system data.

How does the program work?

  1. The portal sends the order to a REST/JSON service: dealer code, portal order number, ship-to, items and requested delivery date. The service user is authorized for this service only.
  2. Checks: the dealer is defined in the sales area (KNVV) and has no order block (KNA1-AUFSD), the ship-to is a partner of the dealer (KNVP), the material is released for sale (MVKE-VMSTA), and the same portal order number has not been received for this dealer before (VBKD-BSTKD).
  3. The order is created with BAPI_SALESORDER_CREATEFROMDAT2 in the order type defined for the portal; the portal order number is written as the customer PO number. Pricing, campaigns and credit check run in standard order processing.
  4. Response: SAP order number, confirmed quantity and date per item (VBEP) and net value. If the order was saved incomplete or with a credit block, the portal receives an “awaiting approval” status; errors are returned with their message texts.
  5. Query services: price simulation via BAPI_SALESORDER_SIMULATE, open order status via BAPI_SALESORDER_GETSTATUS and account balance via BAPI_AR_ACC_GETKEYDATEBALANCE.
  6. Each message is written to the application log (BALHDR) with its result. A monitor screen shows failed messages; after the data is corrected the message can be reprocessed.

Performance notes

Do not simulate the whole catalogue item by item for price queries; let the portal make one simulation call for the items in the basket. Run the duplicate check with an indexed read on VBKD-BSTKD. At peak hours queue order creation, but keep the query services synchronous.

Features

  • Line-by-line result and error log Every portal message is kept in the application log with its result.
  • ALV list (sort, filter, subtotals)
  • Runs as a background job Queued orders and status updates are processed by a short-interval job.
  • Download failed lines as a separate file

Authorization objects

  • V_VBAK_AATAuthorization to create orders of the portal order type
  • V_VBAK_VKOSales order authorization by sales organization
  • S_SERVICEAuthorization for the service user to call the portal service only

Frequently asked questions

Which portal technology does it work with?

It works with any portal that can make REST/JSON calls. On the SAP side the service and message structure are agreed with the portal team during installation; if middleware is used, the service is placed behind it.

How does the portal price stay the same as the SAP price?

The portal takes the price from a simulation of SAP pricing rather than from its own list. Condition records, discounts and campaigns are therefore kept in one place and the price does not change when the order is created.

What happens to the order of a dealer over its credit limit?

The order is created in SAP but stays blocked by the standard credit check; the portal shows it as "awaiting approval". When the credit team releases the block, a status update goes to the portal.

Related reports

SD Report Custom ALV report

Credit-Blocked Sales Orders by Value and Age Report

A custom ALV report that groups credit-blocked sales orders per credit account and shows the blocked order value, the age of the oldest block, the …

VBUK · VBAK · VBAP · VBUP

SD Report Custom ALV report

Incomplete Sales Orders with Missing Fields Report

A custom ALV report that lists sales orders with an incompletion log, one line per missing field, with the field name, the affected item, the order …

VBAK · VBUK · VBUV · DD03L

SD Program Custom Mass upload

Mass Sales Order Creation from Excel Program

A custom program that creates sales orders in bulk from the rows of an order file sent by the customer. It groups rows into orders by customer PO …

VBAK · VBAP · VBEP · VBKD

Let us build this program for your system

Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.

Related report: Dealer (B2B) Order Portal Integration with SAP Sales Orders