# Finished Roll and Carton Label Printing Program (Customer-Specific Barcode Labels)

> A custom form program that prints a barcode roll label for every fabric or carpet roll received from production and a carton label for every carton prepared for shipment. The label layout is chosen by the ordering customer; metres, m², weight, batch, quality grade and the customer's own article number are filled in automatically.

- Type: Program, Custom development, Form
- Module: PP
- Estimated effort: M (5–8 working days)
- Industry: Textile and Apparel
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/finished-roll-and-carton-label-printing-program/


## Why is the standard not enough?

MB90 prints standard labels from goods movements through output conditions, but the layout is tied to the movement type; it does not carry a different template per customer, the customer's material number, an m² conversion or a quality grade per roll. CO04N shop papers are meant for production and do not produce shipping labels. The custom program adds customer-based template selection, roll and carton levels and reprint control.

### Closest standard alternatives

- MB90: Prints labels from goods movements via output conditions; no customer-specific template, m² or quality grade.
- CO04N: Prints shop papers for production orders; does not produce roll or carton shipping labels.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| MSEG | Receipts posted to the production order: batch and metres (driving table) | Read | - | ECC + S/4 |
| AFPO | Order item: material and linked sales order | Read | AFPO-AUFNR = MSEG-AUFNR | ECC + S/4 |
| MCH1 | Batch (roll) and its classification object number | Read | MCH1-MATNR = MSEG-MATNR AND MCH1-CHARG = MSEG-CHARG | ECC + S/4 |
| AUSP | Batch characteristics: quality grade, gross and net weight | Read | AUSP-OBJEK = MCH1-CUOBJ_BM AND AUSP-KLART = '023' | ECC + S/4 |
| VBAK | Sold-to customer and customer purchase order number | Read | VBAK-VBELN = AFPO-KDAUF | ECC + S/4 |
| KNA1 | Customer name | Read | KNA1-KUNNR = VBAK-KUNNR | ECC + S/4 |
| KNMT | Customer's own material number and description | Read | KNMT-KUNNR = VBAK-KUNNR AND KNMT-MATNR = AFPO-MATNR | ECC + S/4 |
| MARA | Fabric width and its unit | Read | MARA-MATNR = AFPO-MATNR | ECC + S/4 |
| MARM | M2 and KG alternative unit factors | Read | MARM-MATNR = AFPO-MATNR | ECC + S/4 |

## BAPIs and functions used

- SSF_FUNCTION_MODULE_NAME: Finds the generated function name of the selected Smart Forms template
- FP_FUNCTION_MODULE_NAME: Finds the form function name if an Adobe Forms template is used

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_AUFNR | Production order | Range / multiple | AFPO-AUFNR | No |
| S_CHARG | Batch (roll number) | Range / multiple | MSEG-CHARG | No |
| S_BUDAT | Production receipt date | Range / multiple | MKPF-BUDAT | No |
| P_TYPE | Label type: roll / carton | Radio button | - | Yes |
| P_COPIES | Number of copies | Single value | - | No |
| P_DEST | Label printer | Single value | TSP03-PADEST | Yes |
| P_REPRT | Reprint labels already printed | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Production order | AFPO-AUFNR |
| Roll (batch) | MCH1-CHARG |
| Material | AFPO-MATNR |
| Customer | KNA1-NAME1 |
| Customer material no. | KNMT-KDMAT |
| Length (m) | MSEG-MENGE |
| Area (m²) | Calculated: Length (m) × width (MARA-BREIT converted to metres) |
| Label type | Calculated: Roll or carton |
| Template | Calculated: Form from the customer mapping; otherwise the default |
| Copies | Calculated: Number of copies printed |
| Status | Calculated: Printed, reprinted or error |

## How does the program work?

1. Labels are selected by production order, batch (roll number) or production receipt date; the receipts posted to the order (MSEG-AUFNR) with movement type 101 are read from MSEG and each batch becomes one roll label.
2. If the order is linked to a sales order (AFPO-KDAUF/KDPOS), the sold-to customer comes from VBAK, the name from KNA1 and the customer's material number and description from KNMT.
3. Template selection: customer and label type (roll/carton) are mapped to a form name in a settings table; without a mapping the company's default template is used.
4. The roll length comes from the receipt quantity (metres); the width is converted to metres from MARA-BREIT and its unit MEABM, and m² = metres × width. If alternative units (M2, KG) exist, the MARM factors are used. Gross/net weight and quality grade are read from the batch classification (AUSP via MCH1-CUOBJ_BM).
5. If carton labels are chosen, the roll batches of the same order are grouped per carton; the carton label carries the number of rolls, total metres and weight and the carton number as a GS1-128 or customer-defined barcode.
6. The form is called through SSF_FUNCTION_MODULE_NAME (Smart Forms) or FP_FUNCTION_MODULE_NAME (Adobe Forms); for thermal printers direct ZPL output can also be produced. Every print is logged and reprints are flagged separately.

## Authorization objects

- C_AFKO_AWK: Order display authorization by plant and order type
- S_SPO_DEV: Authorization to print on the selected label printer

## Frequently asked questions

### Does every customer need a separate label design?

No. Differences such as logo, field order and barcode type are handled with parameters on a shared template. For customers who require a completely different layout, a separate form is designed and added to the mapping table; each new customer template adds roughly 0.5–1 day to the estimate.

### Can a damaged label be printed again?

Yes. Select it by roll or carton number and print with the "reprint" flag. It appears as a reprint in the log, so you can trace how many labels were produced for the same roll.

### Does it work on S/4HANA?

Yes. On S/4HANA, MSEG can still be read as a compatibility view on MATDOC; batch classification and customer material data keep the same structure. It can also be used with Adobe Forms or output management.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=pp-product-packaging-label
