# Sales Invoice and Delivery Note Forms for Domestic, Export and Export-Registered Sales with Email Sending

> 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.

- Type: Program, Custom development, Form
- Module: SD
- Estimated effort: M (7–10 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/sales-invoice-and-delivery-note-forms/


## 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.

### Closest standard alternatives

- VF31: Reprocesses billing output in bulk; does not choose a layout by type of sale or email the contact person.
- VL71: Processes delivery output in bulk; the delivery note is printed with the standard sample form.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| VBRK | Invoice header: billing type, date, currency, recipient country (driving table) | Read | - | ECC + S/4 |
| VBRP | Invoice items: material, quantity, net value, tax | Read | VBRP-VBELN = VBRK-VBELN | ECC + S/4 |
| LIKP | Delivery note header: goods issue date, ship-to, weight | Read | LIKP-VBELN = VBRP-VGBEL | ECC + S/4 |
| LIPS | Delivery note items: material, batch, delivery quantity | Read | LIPS-VBELN = LIKP-VBELN | ECC + S/4 |
| VBPA | Payer, ship-to and contact person with address numbers | Read | VBPA-VBELN = VBRK-VBELN | ECC + S/4 |
| ADR6 | Email address of the contact person or the customer | Read | ADR6-ADDRNUMBER = VBPA-ADRNR | ECC + S/4 |
| KNA1 | Customer name, language and country | Read | KNA1-KUNNR = VBRK-KUNAG | ECC + S/4 |
| VBKD | Incoterms and payment terms | Read | VBKD-VBELN = VBRP-AUBEL | ECC + S/4 |
| KONV | Price and tax lines (ECC) | Read | KONV-KNUMV = VBRK-KNUMV | ECC only |
| PRCD_ELEMENTS | Price and tax lines (S/4HANA) | Read | PRCD_ELEMENTS-KNUMV = VBRK-KNUMV | S/4HANA only |
| NAST | Output record and processing status | Read | NAST-OBJKY = VBRK-VBELN | ECC + S/4 |
| TNAPR | Link of the output type to program and form | Read | TNAPR-KSCHL = NAST-KSCHL | ECC + S/4 |

## BAPIs and functions used

- SSF_FUNCTION_MODULE_NAME: Finds the generated function name of the form when Smart Forms is used
- FP_FUNCTION_MODULE_NAME: Finds the interface function of the form when Adobe Forms is used
- READ_TEXT: Reads document header and item texts
- SD_PRINT_TERMS_OF_PAYMENT: Prepares the payment terms as printable text
- SO_NEW_DOCUMENT_ATT_SEND_API1: Sends the PDF as an email attachment

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_VKORG | Sales organization | Range / multiple | VBRK-VKORG | Yes |
| S_FKDAT | Billing date | Range / multiple | VBRK-FKDAT | Yes |
| S_VBELN | Billing document | Range / multiple | VBRK-VBELN | No |
| S_FKART | Billing type | Range / multiple | VBRK-FKART | No |
| P_KSCHL | Output type | Single value | NAST-KSCHL | Yes |
| P_LIKP | Also send the related delivery notes | Checkbox | - | No |
| P_PREV | Preview only (do not send) | Checkbox | - | No |
| P_PRINT | Print in addition to email | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Document | Calculated: Billing document (VBRK-VBELN) or delivery (LIKP-VBELN) number |
| Document kind | Calculated: Invoice or delivery note |
| Layout | Calculated: Domestic, export or export-registered (rule in step 2) |
| Customer | VBRK-KUNAG |
| Customer name | KNA1-NAME1 |
| Recipient email | ADR6-SMTP_ADDR |
| Language | NAST-SPRAS |
| Net value | VBRK-NETWR |
| Currency | VBRK-WAERK |
| Status | Calculated: Sent, previewed, printed only or error |
| Message | Calculated: Return message of sending or form processing |

## How does the program work?

1. 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.
2. 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.
3. 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.
4. 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.
5. 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.
6. 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.

## Authorization objects

- V_VBRK_FKA: Billing document display and output authorization by billing type
- V_VBRK_VKO: Billing document authorization by sales organization
- V_LIKP_VST: Delivery authorization by shipping point
- S_OC_SEND: Authorization 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.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=sd-invoice-delivery-note-forms
