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
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| VBAKSales Document Header | Order header: customer, date, net value, currency (driving table) | Read | ECC + S/4 |
| VBAPSales Document Item | Order items: material, order quantity, price | Read | ECC + S/4 |
| VBEPSales Document: Schedule Line Data | Schedule lines: confirmed quantity and date | Read | ECC + S/4 |
| VBKDSales Document: Business Data | Payment and delivery terms, customer PO number | Read | ECC + S/4 |
| VBPASales Document: Partners | Contact person, payer and sales representative | Read | ECC + S/4 |
| ADR6E-Mail Addresses (Business Address Services) | Recipient's email address | Read | ECC + S/4 |
| KNA1Customer Master (General Section) | Customer name and language | Read | ECC + S/4 |
| KONVConditions (Transaction Data) | Price, discount and tax lines (ECC) | Read | ECC only |
| PRCD_ELEMENTSPricing Elements (Document Conditions) | Price, discount and tax lines (S/4HANA) | Read | S/4HANA only |
| T012KHouse Bank Accounts | Bank account printed on the proforma | Read | ECC + S/4 |
| NASTMessage Status | Output records and revision count | Read | ECC + S/4 |
| CDHDRChange Document Header | Order changes since the last sending | Read | ECC + 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
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_VKORG | Sales organization | Range / multiple | VBAK-VKORG | Yes | 1000 |
| S_VBELN | Sales order | Range / multiple | VBAK-VBELN | No | 10024518 |
| S_AUDAT | Order date | Range / multiple | VBAK-AUDAT | No | 10.11.2026 – 16.11.2026 |
| S_AUART | Order type | Range / multiple | VBAK-AUART | No | OR |
| R_CONF | Order confirmation | Radio button | — | No | X |
| R_PROF | Proforma invoice | Radio button | — | No | — |
| P_PREV | Preview only (do not send) | Checkbox | — | No | — |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Sales order | VBAK-VBELN |
| 2 | Document | Calculated Order confirmation or proforma invoice |
| 3 | Revision | Calculated Number of processed NAST records for this output type |
| 4 | Customer | VBAK-KUNNR |
| 5 | Customer name | KNA1-NAME1 |
| 6 | Recipient email | ADR6-SMTP_ADDR |
| 7 | Net value | VBAK-NETWR |
| 8 | Currency | VBAK-WAERK |
| 9 | Latest confirmed date | Calculated Maximum VBEP-EDATU (VBEP-BMENG > 0) |
| 10 | Status | Calculated Sent, previewed or error |
| 11 | Message | Calculated Return message of sending or form processing |
Sample result list
| Sales order | Document | Revision | Customer | Customer name | Recipient email | Net value | Currency | Latest confirmed date | Status | Message |
|---|---|---|---|---|---|---|---|---|---|---|
| 10024518 | Order confirmation | 1 | 300045 | Demo Retail Ltd. | [email protected] | 48,600 | EUR | 12/04/2026 | Sent | Confirmation sent in English |
| 10024518 | Proforma invoice | 1 | 300045 | Demo Retail Ltd. | [email protected] | 48,600 | EUR | 12/04/2026 | Sent | Bank details printed for prepayment |
| 10024560 | Order confirmation | 2 | 200118 | Örnek Tekstil A.Ş. | [email protected] | 214,300 | TRY | 11/28/2026 | Sent | Revision 2: date of item 30 changed |
| 10024571 | Order confirmation | 1 | 200455 | Ege Ev Tekstili Ltd. Şti. | 36,200 | TRY | Error | No contact person or email on the order |
How does the program work?
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
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 …
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 …
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 …
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.