Retrieving Long Text for Document Line Item in SAP: A Step-by-Step Guide

Long texts in SAP allow users to store detailed information that exceeds typical field limits. In the context of Financial Document Line Items, these texts can be crucial for documenting additional details that standard fields cannot capture. In this guide, I will walk you through how to retrieve these long texts using SAP's READ_TEXT function module, covering the necessary parameters and process steps.

 

Meryem Gizem Ersen

gizem.ersen@revola.com.tr

SAP FICO Consultant, Revola Consulting

 

 

Definition

Long texts, or SAPscript texts, are extended text fields that allow users to store detailed information without typical database constraints.

 

Purpose

These flexible text fields enable users to attach formatted free text to various SAP objects, such as FI document line items, sales orders, and materials.

 

Long Text in FI Document Line Items:

 

 

 

 

 

 

 

Steps for Retrieving Long Text

The long texts associated with document line items are stored in two primary tables: STXH (Header) and STXL (Lines). To retrieve these texts, the READ_TEXT function module is employed. The following is a step-by-step guide for retrieving long text by identifying and using the appropriate parameters.

 

1. Identifying the Parameters from Table STXH: First, the STXH table must be used to identify the necessary parameters for the READ_TEXT function module. Specifically, the STXH-TDNAME field must be constructed by concatenating the company code, document number, fiscal year, and document item.

 

2. Executing the READ_TEXT Function Module: Long texts are retrieved from the database using the READ_TEXT function module. The function requires the input of four key parameters, which can be obtained from the STXH table. To execute the function module:

 

ID: Text ID(from STXH)

 

LANGUAGE: Language Key(from STXH)

 

NAME: Text Name(from STXH)

 

OBJECT: Text Object(from STXH)

 

3. Retrieving and Displaying the Long Text After executing the READ_TEXT function module, the long text associated with the document line item will be displayed on the screen. The four parameters previously identified must be correctly entered to ensure the proper retrieval of the text.

 

References

 

1.      SAP Help Portal.(n.d.). Long Text Fields – Tips. Retrieved from Long Text Fields - Tips | SAP Help Portal

 

2.      SAP Community. (2023). FI Document Line Item Long Text – Store in Which Table? Retrieved from https://community.sap.com/t5/application-development-discussions/fi-document-line-item-long-text-store-in-which-table/td-p/3341779