bodsexpert
bodsexpert

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.

LSMW

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
LSMW

Step 3

Define the Source Structure.

LSMW

Step 4

Define the Source Fields:

  • H - Header
  • I - Item
LSMW

Step 5

Define the Source Relation.

LSMW

Step 6

Define the Field Mapping and Conversion Rules:

  • OBJECT = MATERIAL
  • SPRAS = E
  • TEXTFORMAT = *
LSMW

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.

LSMW

Step 9

Assign the file.

LSMW

Step 10

Display the Read Data.

LSMW

Step 11

Display the Converted Data.

LSMW

Step 12

Start the Direct Input Program.

LSMW

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.

LSMW
LSMW

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.