Retrieve Texts from a Sales Order
This sample shows how to get texts from sales orders using the function module RFC_READ_TEXT.
About
Sales orders can store different kinds of texts. The texts can be attached to the order header or the order items.
Use the SAP standard function module RFC_READ_TEXT to retrieve the texts. RFC_READ_TEXT requires the following table input (table TEXT_LINES) for each text you want to fetch:
- TDOBJECT is the name of the text object, e.g., VBBK for sales order header or VBBP for sales order item.
- TBNAME is the key, e.g., in case of VBBP it is the sales order number and the Sales order item number.
- TDID is the text ID that defines the text type, e.g., 0001 for Material sales text.
- TDSPRAS is the language key.
Look up Text Information in SAP
Follow the steps below to look up the correct text name, text object and text ID of a text in SAP:
- Open the sales order.
- Access item texts via More > Goto > Item > Texts or access header texts via More > Goto > Header > Texts.
- Click [Detail] (magnifying glass icon). The text editor opens.
- Navigate to Goto > Header. The window "Text Header" opens.
Tip
Use SAP transaction SE75 to look up all available text objects and the underlying text IDs.
Call RFC_READ_TEXT
The following sample code calls RFC_READ_TEXT to query the item text of a sales order:
Output:
Last update: January 9, 2024