In today’s tutorial, I want to show you how to use the READ_TEXT function module to read SAP long text. Every text in SAP has its own ID and NAME, by passing these parameters into the READ_TEXT function, we can get all the text in the SAP long text object.
Here’s how to do it, for example we’ll be using long text from Sales Order.
1. Execute tcode VA02 and enter the Sales Order number.
2. Press enter to display the Sales Order data. Choose GoTo -> Header -> Texts
3. Double click the “Header Note” text and enter the long text in the text editor.
4. Click CTRL+S to save the Sales Order data.
5. Now that we need to get the “ID”, “NAME” and “OBJECT” of the text object to be used as the input parameters of READ_TEXT function module, to get this information, you can execute VA02 or VA03 and enter the Sales Order number again.
Choose GoTo -> Header -> Texts
6. Now double click inside the long text editor.
7. Choose Goto -> Header.
8. On the next window screen, you will see all the parameters required for the READ_TEXT function. (Name, Language, ID, Object)
9. Now let’s get the text using ABAP, open your ABAP editor (SE38), copy this code below.
10. Now execute the program (F8), you will see the long text from the header note text object.