Sales Invoice and Delivery Note Forms for Domestic, Export and Export-Registered Sales with Email Sending
Short answer: A custom form and output program that prints invoices and delivery notes with the right layout for each type of sale. Domestic, export and export-registered sales each get their own layout, language and annotation texts; the PDF is emailed to the customer's contact person and every sending can be traced in the output record.
- Estimated effort
- M · 7–10 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 system ships with sample forms for invoices and deliveries; they offer one generic layout and do not print a different heading, language, currency or annotation text depending on whether the sale is domestic, export or export-registered. VF31 and VL71 reprocess output in bulk but do not decide which layout to use, and the email address is usually taken only from the customer's main address. The custom solution picks the layout from the document data, prints the amount in words and a tax summary, and sends the PDF to the right person.
Who uses it? Billing teams, shipping and warehouse staff, export operations teams and customer service.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| VBRKBilling Document Header | Invoice header: billing type, date, currency, recipient country (driving table) | Read | ECC + S/4 |
| VBRPBilling Document: Item Data | Invoice items: material, quantity, net value, tax | Read | ECC + S/4 |
| LIKPDelivery Header | Delivery note header: goods issue date, ship-to, weight | Read | ECC + S/4 |
| LIPSDelivery Item Data | Delivery note items: material, batch, delivery quantity | Read | ECC + S/4 |
| VBPASales Document: Partners | Payer, ship-to and contact person with address numbers | Read | ECC + S/4 |
| ADR6E-Mail Addresses (Business Address Services) | Email address of the contact person or the customer | Read | ECC + S/4 |
| KNA1Customer Master (General Section) | Customer name, language and country | Read | ECC + S/4 |
| VBKDSales Document: Business Data | Incoterms and payment terms | Read | ECC + S/4 |
| KONVConditions (Transaction Data) | Price and tax lines (ECC) | Read | ECC only |
| PRCD_ELEMENTSPricing Elements (Document Conditions) | Price and tax lines (S/4HANA) | Read | S/4HANA only |
| NASTMessage Status | Output record and processing status | Read | ECC + S/4 |
| TNAPRProcessing Programs for Output | Link of the output type to program and form | 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.
BAPIs and functions used
- SSF_FUNCTION_MODULE_NAMEGet Smart Form Function Module Name. Finds the generated function name of the form when Smart Forms is used
- FP_FUNCTION_MODULE_NAMEGet Adobe Form Function Module Name. Finds the interface function of the form when Adobe Forms is used
- READ_TEXTRead Long Text. Reads document header and item texts
- SD_PRINT_TERMS_OF_PAYMENTFormat Terms of Payment for Printing. Prepares the payment terms as printable text
- SO_NEW_DOCUMENT_ATT_SEND_API1SAPoffice: Send New Document with Attachments. Sends the PDF as an email attachment
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_VKORG | Sales organization | Range / multiple | VBRK-VKORG | Yes | 1000 |
| S_FKDAT | Billing date | Range / multiple | VBRK-FKDAT | Yes | 01.11.2026 – 16.11.2026 |
| S_VBELN | Billing document | Range / multiple | VBRK-VBELN | No | 90031245 |
| S_FKART | Billing type | Range / multiple | VBRK-FKART | No | F2 |
| P_KSCHL | Output type | Single value | NAST-KSCHL | Yes | RD00 |
| P_LIKP | Also send the related delivery notes | Checkbox | — | No | X |
| P_PREV | Preview only (do not send) | Checkbox | — | No | — |
| P_PRINT | Print in addition to email | Checkbox | — | No | — |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Document | Calculated Billing document (VBRK-VBELN) or delivery (LIKP-VBELN) number |
| 2 | Document kind | Calculated Invoice or delivery note |
| 3 | Layout | Calculated Domestic, export or export-registered (rule in step 2) |
| 4 | Customer | VBRK-KUNAG |
| 5 | Customer name | KNA1-NAME1 |
| 6 | Recipient email | ADR6-SMTP_ADDR |
| 7 | Language | NAST-SPRAS |
| 8 | Net value | VBRK-NETWR |
| 9 | Currency | VBRK-WAERK |
| 10 | Status | Calculated Sent, previewed, printed only or error |
| 11 | Message | Calculated Return message of sending or form processing |
Sample result list
| Document | Document kind | Layout | Customer | Customer name | Recipient email | Language | Net value | Currency | Status | Message |
|---|---|---|---|---|---|---|---|---|---|---|
| 90031245 | Invoice | Domestic | 200118 | Örnek Tekstil A.Ş. | [email protected] | TR | 148,250 | TRY | Sent | PDF sent by email |
| 80045112 | Delivery note | Export | 300045 | Demo Retail Ltd. | [email protected] | EN | Sent | Delivery note sent in the English layout | ||
| 90031260 | Invoice | Export-registered | 200342 | Anadolu Dış Ticaret A.Ş. | [email protected] | TR | 512,400 | TRY | Sent | Legal annotation printed |
| 90031277 | Invoice | Export | 300051 | Nordic Home GmbH | DE | 23,800 | EUR | Printed only | No email address found; document sent to the printer |
How does the program work?
- Separate output types are defined for the invoice and the delivery note and linked to the custom output program and form in NACE (TNAPR). When the document is saved, standard output determination creates the NAST record.
- The layout is chosen from the document data: if the recipient’s country differs from the company code country, the export layout is used; if the billing type or customer group is flagged as an export-registered sale during installation, the export-registered layout is used; otherwise the domestic layout.
- VBRK/VBRP are read for the invoice and LIKP/LIPS for the delivery note. Payer, ship-to and recipient addresses come from VBPA and ADRC, delivery and payment terms from VBKD, price and tax lines from KONV (PRCD_ELEMENTS in S/4HANA); header and item texts are added with READ_TEXT.
- In the export layout the document is printed in the customer’s language and in the document currency, with incoterms and commodity codes. The export-registered layout prints the legal annotation and the details of the exporting buyer; the annotation text is checked against current regulation during installation. The amount in words and the VAT summary are calculated inside the form.
- The form is converted to PDF. The recipient email is taken from the contact person on the document (VBPA → ADR6), otherwise from the customer’s default email, and the PDF is sent with SO_NEW_DOCUMENT_ATT_SEND_API1; it can also be printed at the same time.
- The result is written to the NAST processing status. The mass resend screen runs the same steps for the selected documents and returns a result list per document.
Performance notes
Read the form data once per document instead of separate SELECTs per item; fetch addresses and texts once per document. In a mass resend, process documents in packages, issue COMMIT WORK after each package and run the program in the background for hundreds of documents.
Features
- Send the result by email The PDF goes to the contact person on the document, otherwise to the customer's default email.
- Test mode (check without posting) Each document's PDF can be previewed before a mass sending.
- Line-by-line result and error log
- Runs as a background job A job can retry unsent documents at the end of the day.
Authorization objects
- V_VBRK_FKABilling document display and output authorization by billing type
- V_VBRK_VKOBilling document authorization by sales organization
- V_LIKP_VSTDelivery authorization by shipping point
- S_OC_SENDAuthorization to send external email from SAP
Frequently asked questions
We use electronic invoicing; is this form still needed?
The legal electronic document is produced by your e-document solution. This form is used as the information copy sent to the customer, for recipients outside the e-document scope and for the delivery note copy printed in the warehouse; the layout can be aligned with the e-document view.
How is the layout to print determined?
The program compares the recipient's country with the company code country and checks the flag set during installation for the billing type or customer group. The rule is kept in one place, so adding a new type of sale does not require changing the form itself.
Can we send the same invoice to the customer again?
Yes. When you select the document in the mass resend screen and run it, a new output record is created and the PDF is sent again; the earlier sendings remain visible in NAST with date and user.
Related reports
Customer Account Statement and Balance Confirmation Email Program
A custom program that prepares a customer account statement as PDF, with opening balance, period movements, open items and closing balance, and sends …
Billing Documents Not Posted to Accounting Report
A custom ALV report that lists billing documents which exist in SD but have no accounting document yet, with the reason code, age and amount. At …
Scheduled Billing Job with Pre-Billing Checks and Hold List
A custom background job that bills goods-issued, unbilled deliveries at set times and runs customer-specific checks before billing. Deliveries that …
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.