SD Program Custom development Form

Sales Order Confirmation and Proforma Invoice Output with Automatic Email

Short answer: A custom form program that prepares the order confirmation and, when needed, the proforma invoice as PDF the moment the sales order is saved and emails them to the customer's contact person. The confirmation shows the confirmed quantity and date per item, the proforma shows bank details and a validity date, and a new confirmation with a revision number goes out when the order changes.

Estimated effort
M · 5–8 working days
System
ECC and S/4HANA
Tables
12
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

Why is the standard not enough?

The standard order confirmation output is a generic sample form; the confirmed date per item, the customer's language and revision information do not appear in the required format. In the standard, a proforma invoice is obtained by creating a separate proforma billing document with VF01; this is an extra step and must be repeated when the order changes. The custom solution produces both documents directly from the order and sends them automatically to the right person.

Who uses it? Customer service and order entry teams, export sales teams and finance teams following prepayment sales.

Closest standard alternatives

  • VA02 Change Sales Order. Triggers output manually from the order; uses the standard sample form and the customer's main address.
  • VF01 Create Billing Document. Creates a proforma billing document; a separate step that must be repeated when the order changes.

Tables used

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

TableRoleAccessSystem
VBAKSales Document HeaderOrder header: customer, date, net value, currency (driving table)ReadECC + S/4
VBAPSales Document ItemOrder items: material, order quantity, priceReadECC + S/4
VBEPSales Document: Schedule Line DataSchedule lines: confirmed quantity and dateReadECC + S/4
VBKDSales Document: Business DataPayment and delivery terms, customer PO numberReadECC + S/4
VBPASales Document: PartnersContact person, payer and sales representativeReadECC + S/4
ADR6E-Mail Addresses (Business Address Services)Recipient's email addressReadECC + S/4
KNA1Customer Master (General Section)Customer name and languageReadECC + S/4
KONVConditions (Transaction Data)Price, discount and tax lines (ECC)ReadECC only
PRCD_ELEMENTSPricing Elements (Document Conditions)Price, discount and tax lines (S/4HANA)ReadS/4HANA only
T012KHouse Bank AccountsBank account printed on the proformaReadECC + S/4
NASTMessage StatusOutput records and revision countReadECC + S/4
CDHDRChange Document HeaderOrder changes since the last sendingReadECC + S/4

S/4HANA notes

  • KONV → PRCD_ELEMENTS: In S/4HANA document conditions are stored in PRCD_ELEMENTS; custom code reading KONV must be adapted.
  • T012K: In S/4HANA reads of T012K go through the compatibility view V_T012K_BAM; bank accounts are maintained in Bank Account Management (BAM).

BAPIs and functions used

  • SSF_FUNCTION_MODULE_NAMEGet Smart Form Function Module Name. Finds the form function when Smart Forms is used
  • FP_FUNCTION_MODULE_NAMEGet Adobe Form Function Module Name. Finds the form interface when Adobe Forms is used
  • SD_PRINT_TERMS_OF_PAYMENTFormat Terms of Payment for Printing. Prepares the payment terms as printable text
  • READ_TEXTRead Long Text. Reads order header and item texts
  • SO_NEW_DOCUMENT_ATT_SEND_API1SAPoffice: Send New Document with Attachments. Sends the confirmation and proforma as PDF attachments

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_VKORGSales organizationRange / multipleVBAK-VKORGYes1000
S_VBELNSales orderRange / multipleVBAK-VBELNNo10024518
S_AUDATOrder dateRange / multipleVBAK-AUDATNo10.11.2026 – 16.11.2026
S_AUARTOrder typeRange / multipleVBAK-AUARTNoOR
R_CONFOrder confirmationRadio button—NoX
R_PROFProforma invoiceRadio button—No—
P_PREVPreview only (do not send)Checkbox—No—

Result list columns

#ColumnSource
1Sales orderVBAK-VBELN
2DocumentCalculated Order confirmation or proforma invoice
3RevisionCalculated Number of processed NAST records for this output type
4CustomerVBAK-KUNNR
5Customer nameKNA1-NAME1
6Recipient emailADR6-SMTP_ADDR
7Net valueVBAK-NETWR
8CurrencyVBAK-WAERK
9Latest confirmed dateCalculated Maximum VBEP-EDATU (VBEP-BMENG > 0)
10StatusCalculated Sent, previewed or error
11MessageCalculated Return message of sending or form processing

Sample result list

Sales orderDocumentRevisionCustomerCustomer nameRecipient emailNet valueCurrencyLatest confirmed dateStatusMessage
10024518Order confirmation1300045Demo Retail Ltd.[email protected]48,600EUR12/04/2026SentConfirmation sent in English
10024518Proforma invoice1300045Demo Retail Ltd.[email protected]48,600EUR12/04/2026SentBank details printed for prepayment
10024560Order confirmation2200118Örnek Tekstil A.Ş.[email protected]214,300TRY11/28/2026SentRevision 2: date of item 30 changed
10024571Order confirmation1200455Ege Ev Tekstili Ltd. Şti.36,200TRYErrorNo contact person or email on the order
A view built with fictional sample data; not real system data.

How does the program work?

  1. Two output types (order confirmation and proforma) are defined for the order and linked to the custom program in NACE. An output determination condition is added so that the proforma is only determined for orders with prepayment terms or export orders.
  2. Order data comes from VBAK/VBAP, confirmed quantity and date from the schedule lines (VBEP: BMENG, EDATU), price and tax lines from KONV (PRCD_ELEMENTS in S/4HANA), and payment and delivery terms from VBKD.
  3. The proforma is calculated from the order without creating a billing document: net amount, VAT, grand total, amount in words, validity date and the company’s bank account for the currency (T012K) are printed.
  4. When the order is changed the output is created again; the revision number is the count of processed NAST records of that output type. Items changed since the last sending are found in the change documents (CDHDR) and marked on the form.
  5. The PDF is sent to the customer’s contact person on the order (VBPA → ADR6) with SO_NEW_DOCUMENT_ATT_SEND_API1; the sales representative gets a copy.
  6. The mass resend screen produces the confirmation or proforma again for the selected orders and returns a result list.

Performance notes

Read CDHDR only for the order concerned and after the last sending date to find changed items. If output is sent immediately, do the email sending in a separate step after output processing rather than in the update task, so that saving the order does not slow down.

Features

  • Send the result by email The confirmation is sent the moment the order is saved or by a short-interval job.
  • Test mode (check without posting) The PDF can be previewed before sending.
  • Line-by-line result and error log

Authorization objects

  • V_VBAK_VKOOrder display and output authorization by sales organization
  • V_VBAK_AATAuthorization by order type
  • S_OC_SENDAuthorization to send external email from SAP

Frequently asked questions

Is a billing document created for the proforma?

No. Proforma amounts are calculated directly from the order, so no extra document appears in the billing flow. If the proforma must be a numbered document, it can be set up to work with the standard proforma billing type.

Is the customer informed when the delivery date changes?

Yes. When the confirmed date or quantity changes, output is determined again and a new confirmation with a higher revision number is sent; the changed items are marked on the form.

Are the documents printed in the customer's language?

The document language comes from the output record, which by default is the customer's communication language. Form texts are kept translated for each language, and date and amount formats follow the language.

Related reports

SD Report Custom ALV report

Backorders and Unconfirmed Sales Order Items Report

A custom ALV report that shows, for open sales orders, how much of the requested quantity is not confirmed, the value of that quantity, how many days …

VBAK · VBAP · VBEP · 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: Sales Order Confirmation and Proforma Invoice Output with Automatic Email