LSMW to load sales text with more than 132 characters

Hi,
I use an LSMW Direct input Object 0001, Method 0001, Program name
/SAPDMC/SAP_LSMW_IMPORT_TEXTS.
The number of characters TEXTLINE in my source fields is defined as 132 Characters, which is the same as /SAPDMC/LTXTL-TEXTLINE the definition of the structure field. We have to load a lot of materials (> 1000) with sales text which have about 50% more then 132 characters.
I couldn't find a solution to my problem yet. I want to copy paste the text as it is stored in the text file, e.g. a text with more then 132 characters and the words are wrapped, should be stored in the sales text on the same way.

Currently I am able to load the text <= 132 perfect, the text > 132 I offer them as multiple lines and truncated to whole words (<=132), are stored as well, but the second line starts with a new line (carriage return) and that is repeated every next line.

Example of text to be stored in the material sales text:

"This text is just an example of how this text will be treated by SAP as I deliver this text line per line. As you can see there is no carriage return (hard return) in this text."

The length is 177, I will now store the field TEXT-LINE with 2 lines (records) in the text file as follows

Line 1 ( < 132 characters)
"This text is just an example of how this text will be treated by SAP as I deliver this text line per line. As you can see there is"

Line 2
" no carriage return (hard return) in this text."

The result in SAP is:

"This text is just an example of how this text will be treated by SAP as
I deliver this text line per line. As you can see there is"
" no carriage return (hard return) in this text."

Of course this isn't acceptable, the question now is, is this a known problem and if can it be solved somehow and are there any other options?
Further info:

Regard Kees

Duration: 
1 month

Comments

1
Jimbo's picture

Hi Kees,

I've run into something like this before, but I do not know if it is a good solution for your problem with carriage returns. I solved my problem by creating a simple MM02 recording, that takes the material number and one line of sales text in reverse order and loads them backwards.

When the Sales Text screen came up, the fist action was pressing enter and moving down all existing lines. The second action was to put a line of text on the topmost row and, because they were loaded in reverse order, the first line ended up at the top of the text.

This was a decade ago and I never had to load long texts again. This solution might not work now and, chances are, does not solve your problem.

I'm not on a project right now and my test server is SAP CRM based, so I have no access to an ECC environment to use for testing or development right now. A little research on the topic turned up links explaining the functions SAVE_TEXT and BAPI_MATERIAL_SAVEDATA.

With a little testing, it should be possible to make one of these functions load the Sales Texts properly. Here's an article explaining how to how to use LSMW as a wrapper for BAPIs.

Best regards,
Jim

https://archive.sap.com/discussions/thread/1425183
https://blogs.sap.com/2013/08/20/how-to-upload-long-text-into-sap-using-...