bodsexpert
bodsexpert

LSMW Program for Longtext

By Imran, Mohammad January 25, 2022 under LSMW


Long text upload in SAP cannot be done using a normal LSWM or an IDoc or you may ask an ABAPer who can develope an ABAP program which you can integrate with BODS to read and write lontext in SAP.
Long text in SAP gets stored in a word document and cannot be found anywhere in the table which makes it very difficult to load using a normal program. We can find only the linkage of the texts, for example - an object called Material Master will have a TEXTID which gets stored in STXH table when a long text for that material is created, that TEXTID will be associated with longtext stored in word document. So this TEXTID makes the linkage between STXH table and word document. Inorder to read or write the Long Text we need to make use of STXH table and its TEXTID
In this post we are going to see how we can load Long text using a special program available in LSMW which converts data into the long text formart to load into the SAP ECC/S4HANA.


Step 1

Create an LSMW project for long text upload

LSMW

Step 2

Select import method as Standard Batch/Direct Import
Object: 0001
Method: 0001
Program Name: /SAPDMC/SAP_LSMW_IMPORT_TEXTS (This is inbuilt tool)
Program Type: D

LSMW

Step 3

Define Source Structure

LSMW

Step 4

Define Source Fields
H - Header
I - Item

LSMW

Step 5

Define Source Relation

LSMW

Step 6

Define Field Mapping and Conversion Rules

OBJECT = MATERIAL
SPRAS = E
TEXTFORMAT = *
LSMW

Step 7

Define Fixed Values, Translations, User-Defined Routines. Skip this step as this is not needed.

Step 8

Specify file.

LSMW

Step 9

Assign file.

LSMW

Step 10

Display Read Data

LSMW

Step 11

Display Converted Data

LSMW

Step 12

Start Direct Input Program

LSMW

Prepration of source file

Sample file. BEST is text id, STXH is the table which holds long text informations. Put the material number in TDNAME field, you will get the details.

LSMW
LSMW

Conclusion

You have successfully uploaded long text in SAP. if you need more help on this or any other topic related to data migration, do connect with me.