LSMW Program for Long Text
By Imran, Mohammad on January 25, 2022 under LSMW
Uploading long text in SAP cannot be done using a standard LSMW or an IDoc, nor can it be easily handled by requesting an ABAP developer to create a custom ABAP program for integration with BODS to read and write long text in SAP. Long text in SAP is stored in a Word document format and is not directly available in any table, making it difficult to load using conventional methods.
In SAP, we can only find the linkage to these texts. For example, an object like the Material Master will have a TEXTID, which is stored in the STXH table when a long text is created for that material. This TEXTID is associated with the long text stored in the Word document. The TEXTID in the STXH table creates the connection between the SAP table and the Word document.
To read or write long text, we need to utilize the STXH table and its TEXTID. In this post, we will explore how to load long text using a special program in LSMW that converts data into the long text format suitable for loading into SAP ECC/S/4HANA.
Step 1
Create an LSMW project for the long text upload.
Step 2
Select the import method as Standard Batch/Direct Import:
- Object: 0001
- Method: 0001
- Program Name: /SAPDMC/SAP_LSMW_IMPORT_TEXTS (This is an inbuilt tool)
- Program Type: D
Step 3
Define the Source Structure.
Step 4
Define the Source Fields:
- H - Header
- I - Item
Step 5
Define the Source Relation.
Step 6
Define the Field Mapping and Conversion Rules:
- OBJECT = MATERIAL
- SPRAS = E
- TEXTFORMAT = *
Step 7
Define Fixed Values, Translations, and User-Defined Routines. This step can be skipped, as it is not required for this process.
Step 8
Specify the file.
Step 9
Assign the file.
Step 10
Display the Read Data.
Step 11
Display the Converted Data.
Step 12
Start the Direct Input Program.
Preparation of the Source File
Here is a sample file. BEST is the text ID, and STXH is the table that holds long text information. Put the material number in the TDNAME field, and you will get the details.
Conclusion
You have successfully uploaded the long text into SAP. If you need further assistance on this or any other topic related to data migration, feel free to connect with me.