SAP has made overall text administration in documents very flexible. In fact, if you look at just Purchase Orders which we will do in this article, there are several different types of texts that can be used. These include texts such as:
- Item Texts
- Info Record PO Texts – Maintained in the Info Records
- Material PO Texts – Maintained in the Material Master
- Delivery Texts
- Info Record Note
You can get additional information about SAP text administration on pages 356-361 of SAP Smart Forms a book I highly recommend from SAP Press.
Configuration of Purchase Order Texts
You can make changes to how Purchase Order Texts behave and setup the copy rules by going to the appropriate configuration area for the purchase orders.
Use transaction code SPRO: Customizing: Execute Project [SAP Reference IMG]
Menu Path: Materials Manangement –> Purchasing –> Purchase Order –> Texts for Purchase Orders –>
- Define Text Types for Header Texts
- Define Copying Rules for Header Texts
- Define Text Types for Item Texts
- Define Copying Rules for Item Texts
Then check the two options for text control to see if it is at the line item level or the header level. This information will tell you where the text in coming from.
The default is when you create a PO, the material PO text is copied from the contract if there is a contract.
SPRO: Materials Management –> Purchasing –> Messages –> Text for messages –> Define text for purchase order
You can go into config and define the copying rules for header texts by linking the vendor master to header text.
If you want text to be shown only for a specific vendor then you can do so by using the Vendor Master text.
XK02 – Extras –> Texts –> Purchase Order Text.
If you don’t want the Material Texts or Info Texts to be printed, set the “no material text indicator”. Then, only the Info Record indicator will be printed. If you don’t need the Info Record Text, then you have to delete in the Info Record only.
Purchase Order – Info Record Texts
Purchase order texts and info records can be created by vendor, material and purchasing organization. You can find Purchase Order – Info Record Texts by following these steps:
- Use transaction code ME13 – Display Info Record
- Enter a specific Vendor number and Material number
- Enter a Purchasing organization and execute the transaction
- Click on the [Texts] button
The Info record note and the Purchase order text are then displayed.
To find the Text Header information simply double-click on the text and select Goto –> Header from the menu. This will display the text header information which can be used in the READ_TEXT function module or in the Text Node of your SmartForm.
Accessing Purchase Order Texts in SmartForms
It is important to realize that all Text records are not stored transparently in tables like other data. Text records are stored within clusters in SAP.
You can access these texts in SAP when you create a include text node in your SmartForm. Once created you begin by selecting the Text Type: Include Text
The Text Key for an include text is made up of the following parts:
Text Name: &V_OBJNAME&
Text Object: EKPO
Text ID: F01 – Item text (See table below for other text types)
No error if no text exists: Check
The Text Name can be created for the header texts and the items texts using the following ABAP code entered directly in the SmartForm.
move ekko-ebeln to v_objname. "Header texts concatenate ekpo-ebeln ekpo-ebelp into v_objname. "Item texts
The following tables give the Text Object and Text ID for Purchase Order header and item level texts for lookup directly in the Purchase Order.
|Purchase Order Texts||Text Object||Text ID|
|Terms of Delivery||EKKO||F05|
|Terms of Payment||EKKO||F07|
|and so on…||EKKO||F08…|
|Purchase Order Texts||Text Object||Text ID|
|Info record PO text||EKPO||F02|
|Material PO text||EKPO||F03|
|Info record note||EKPO||F05|
Of course, this information is dependent upon the configuration in your system for Purchase Order Texts. See the above section on Configuration of Purchase Order Texts to see how your system is configured.
Accessing Text Records in ABAP
You can use the ABAP function module “READ_TEXT” to access Text records by passing the correct header information. You can see the text in the TDLINE.
If you go to SE37 – ABAP Function Modules and enter READ_TEXT you can press the Test/Execute button and enter real data into the import parameters and validate that your text can be accessed using this function module. You can then incorporate it into your ABAP program to access any SAP text that you need.
This is essentially what is done automatically for you in SmartForms when using the Text Type: Include Text.
Finding Header Information for Info Record Texts
You can find the header information for text records using the following steps.
- Click on the Text tab for either header or item texts
- Double-click on any header or item text in the Purchase Order
- Go to any existing text
- Use menu path Edit –> Text –> Long Text
- Select menu option Goto –> Header
The header information will be displayed and will contain the following field values
Text Name: Info Record Number 53000128641 090
Text ID: BT (Purchase order text)
Text Object: EINE (Texts, pur. info. pur.org.data)
Tables for Purchase Orders
EKKO – Purchasing Document Header
EKPO – Purchasing Document Item
EINA – Purchasing Info Record: General Data
EINA-INFNR (Info Record)
EINE – Purchasing Infor Record: Purchasing Organization Data
EINE-EKORG (Purchasing Organization)
EINE-WERKS (Purchasing Plant)
You can get a more detailed description of Text Administration in SAP by consulting the SAP Press book entitled “SAP Smart Forms” by Werner Hertleif and Chistoph Wachter.