Skip to Content

This blog shall explain how to load long text with LSMW direct input method.

It does not really matter if the long text belongs to material master or vendor master, customer master or even to transactional data like contracts or bill of materials.

Long text to any object is stored in the SAP’s long text tables STXH (header) and STXL.(lines)

Most objects do not have any indicator that tells about existing long text, It is just a piece of code that is executed when you go to the text screens and retrieves the text from STXH and STXL table if present.  Hence inserting text with the correct key into these tables will automatically make this text available when you e.g. go MM02 Material master change transaction into the purchase order text view.

Our business case here is to add purchase order long text to material masters that got migrated earlier.

The source file is prepared in Excel and has just 3 columns: old material number, purchase order long text and line number

Text_Step0.JPG

I do not explain any single LSMW step in this blog in deep detail as I described it in in my other blogs:

LSMW Material master by BAPI method – Part 1

LSMW Material master by BAPI method – Part 2

So i am just focusing here on the difference to these other blogs and the specifics with the direct input method and how do deal with long text.

I am continuing in my existing project SCN, with subproject MATERIAL and create a new object called MM_PO_TEXT

LSMW Step 1 Maintain object attributes

Set the radio button to Standard/Direct Input Import Method

Then move the cursor into the Object field and use F4 to find the object for Long texts

Do the same for the Method.

The Program name and the program type will then be defaulted by SAP itself.

The icon with the glasses allows you to display the source code of this program (I have used twice in lifetime, but only to answer a question in the forum, I never needed it for myself, especially not to execute this LSMW method)

Text_Step1.JPG

LSMW Step 2 Maintain Source Structures

My source file is just a flat file without deeper structure, so only one entry in this step needed. I name my structure LONGTEXT

Text_Step2.JPG

LSMW Step 3 Source Fields

Now I am adding the fields to this structure. As I have only a few fields I am doing it using the table icon.

Defining the fields in the same sequence as they appear in my source file

Define them as character fields, with a field length like it was in the legacy system,

The length of the old material number does not matter in this case as the  material number itself was never that long in the legacy system.

The attentive reader will see that I just entered 2 fields in the source field definitions while my source file has 3 fields.

Reason: I am lazy. To be honest I do not make use of the content of the line number field in this upload program.

I only require this line number in the Excel file as an objective evidence for the sequence of lines in case there are multiple lines.

Text_Step3.JPG

LSMW Step 4 Maintain Structure Relations

The target structure is automatically proposed based on the chosen import method in LSMW step 1.

I assign my source structure to both structures, header and row.

Text_Step4.JPG

LSMW Step 5 Maintain Field Mapping and Conversion Rules

To keep my program flexible for any language that need to be loaded (per source file one language)

I am adding a selection parameter in the __GLOBAL_DATA__ section.

Just double click the light blue field with the name  __GLOBAL_DATA__ to get into the code editor

Enter here a statement   PARAMETER: PSPRAS like MAKT-SPRAS

PSPRAS is my field name and with the LIKE MAKT-SPRAS I tell the program that it shall be like the language field from MAKT table.

Further I add a data declaration for 2 other fields:

W_SKIP TYPE i. this is an integer number field that I want to use to count the records I cannot convert

and

W_SKIP_FLAG type C VALUE ‘ ‘  which describes a character field with no initial content. I will use this to trigger the event to skip the transaction.

Text_Step5_1.JPG

In the header structure I assign a constant “MATERIAL” to the object field, and a constant “BEST” to the ID field

(You can obtain these values if you go into the text view of existing data and click there the text editor icon. After you are taken to the text editor chose from menu Goto > header and you will see the key fields and its content)

The NAME field shall get the new material number. But my source file has only the old material number.

Hence I need to add coding to determine the material number based on the old number.

As you know, the old material number is stored in the basic data view of material master. Go into the material master Press F1 in that field and then the icon for technical field help and you can see the field name and the table.

With this information we can create the coding to get the material number.

First I add a data declaration to define a workarea. which will receive the found data.I could have done this already in the __GLOBAL_DATA__ section, but it can be done everywhere in the source.

Then a select statement to find a record in table MARA that matches with my old material number.

If a record is found, then the material number is moved to the target field /SAPDMC/LTXTH-NAME

If not found, then I write a message into the conversion log to know which old material number could not be converted. And I move a Y (for YES) into my help field w_skip_flag: This is as well for safety reasons. The direct input will not check if your material exists. It will just post what you deliver, regardless if correct or nonsense. So you can create a lot of ghost texts if you do not care enough. Hence you need to control it yourself.


SELECT  single  * FROM  MARA into WA_MARA

       WHERE  BISMT  = longtext-old_number.

if sy-subrc = 0. “record found

  /SAPDMC/LTXTH-NAME = WA_MARA-MATNR.

else.

  WRITE:/ longtext-old_number , ‘not in MARA-BISMT’.

  w_skip_flag = ‘Y’.

endif.

LTXTH.PNG

Next is the language field which needs some attention. You remember, I had defined a selection parameter for the language to be flexible and to use the same LSMW object for whatever language that will be loaded.

I start again with a data declaration for a workarea for the language, because I need to check that I do not enter nonsense into the language parameter field.

So I verify the entered language if it is available in the language table T002.

If the entered language cannot be found, then I skip the record from being loaded. Which is then the case for all records as the language parameter is only entered once. And in that case I write as well a small message into the conversion log.

Text_Step5_3.JPG

Now look what I have done at the __END_OF_RECORD__   processing time.

I changed the default “transfer_record” into “on_change_transfer_record”

This little change controls that the header record is only written when the material number changes (material number is the only variable in the header structure)

This means I write just one header record while I write several rows.

In the structure for the row I only assign my long text line. SAP is processing the source file from the first record in sequence to the last record, thus I do not need the line number from my source file.

Text_Step5_4.JPG

Now to the final manipulations. in the processing time __END_OF_TRANSACTION__ I check my help field. This help field has the value ‘Y’ in case the material number could not be found for the given old material number, hence I have to skip this transaction from posting.

And at the __END_OF_PROCESSING__ I write the numbers of skipped records to the conversion log.

/wp-content/uploads/2012/12/longtext_corre_177887.jpg

which will then look like in this screenshot:

Text_Step9_1.JPG

LSMW Step 6 Maintain fixed values, Translations , user defined routines

Not necessary for this business case

LSMW Step 7 – Specify files

Save the Excel source file as Unicode Text. Then specify this text file in step 7.

Text_Step7.JPG

LSMW Step 8 – Assign Files

As there is only one source structure and one source file, SAP does the proposal and you only need to click save

LSMW Step 9 – Read Data

SAP generates the read program, you can execute it for the entire file or just for a selection of records.

SAP will give you a summary of read records and read transactions.

Compare it with your source file to be certain that everything was read.

LSMW Step 10 – Display read data

Important step to check that you data was correct read and that it was transferred to the fields defined in step 3.

From the overview click a line to get to its detail view..

Text_Step10.JPG

LSMW Step 11 – Convert Data

In the conversion step you can execute the conversion for all records that where read from your source file, or just for a selection for a test case.

Here you can see the parameter PSPRAS for the language, that I defined in step 5 Mapping rules.

Text_Step9.JPG

LSMW Step 12 – Display converted data

In this screenshot of the converted data you can see that the new material number is assigned.

The yellow lines represent the header, and the blue lines the text lines.

So you see that we have 2 materials with just one long text line followed by a material with 6 lines

Text_Step12.JPG

LSMW Step 13 – Execute Direct Input

In this step you execute, post the data to your SAP system.

SAP defaults all data. you only need to click execute

text_step13.JPG

The long text upload is really done in a few seconds for many hundred records, don’t be surprised, nothing wrong.

When finished SAP gives you this summary:

text_step14.JPG

Loading long text means that SAP does REPLACE existing text with the same key.

Even the old text has many hundred lines and the new text just one, all lines of old text are deleted and then the new text written.

To report this post you need to login first.

69 Comments

You must be Logged on to comment or reply to a post.

  1. Peter Pallen

    Hi Jurgen,

    Thanks for the great posts on using LSMW.

    I have one question, when you are running an LSMW using say direct input, how does one efficiently download the error log to be able to had this over in say excel to users?

    The methods that I have found till now are not that great as they contain allot of redundant data which the user does not need an even might confuse them.

    Interesting in hearing your view on this.

    (0) 
    1. Jürgen L Post author

      Can you give me an example, I never had errors with direct input method, I can in the moment only explain how I do it with batch input and IDOC

      (0) 
      1. Peter Pallen

        Let’s say the users have provided a file for loading the material master data, however they have made some wrong entries in the warehouse view, they entered a non existing storage type. When you try to load this one is getting an error showing up after the execution of the LSMW. Now when this happens one wants to provide these errors to the users to have them make corrections in the upload files.

        Or another example is that when we look at your example you are writing an error when the old material number is not existing. let’s say that we print our the material number as part of the error description and one wants to download this error data to provide to the users.

        (0) 
        1. Jürgen L Post author

          I actually try to avoid all kind of errors in the records that I post.

          For that I actually check my converted data against the customizing. (this is one of hidden options in LSMW which you have to activate via personal menu)

          Further I add then coding in step 5 to do this check directly in the conversion so that I can list the error together we the key fields that are needed to find this record in legacy system or in the extract

          the conversion log can be downloaded with %PC in the command field.

          Of course it can happen that I still see some errors while posting (in Quality system) , and the errors shown in the SAP logs are not really user friendly, and do in most cases not have a relation to the extract or to the actual record to be posted, because this error does not tell the material number etc. 

          In such cases I try to  get the needed info from the tables, and prepare the list in Excel, which is often very time consuming. e.g. in case of IDOC errors I need to get the data together from EDIDS and EDID4 table, In Case of Batch Input I take the error long and enrich it with data from APQD table.

          I think I create another blog to show this, as it is not really self explaining if you look at those tables

          (0) 
          1. Peter Pallen

            Thanks for the quick answer and providing the info on how you handle this.

            I have used the check against customizing a few times in the past but will now for certain use this each time.

            (0) 
  2. Hynek Petrak
    Hi Juergen, great guide. However I believe there is a small BUG in the epilog, which is causing that the conversion steps skip not just the lines with error, but also the line right after, which might be correct. I believe the code should look like:

    IF w_skip_flag = 'Y'.
      CLEAR w_skip_flag.
      add 1 to w_skip.
      skip_transaction.
    endif.
    transfer_transaction.

    I.e. to call transfer_transaction right after skip_transaction. The trasfer_transaction resets an internal flag set by skip_transaction, which would otherwise affect the next record.

    (0) 
    1. Jürgen L Post author

      Thank you very much Hynek Petrak for finding this error.

      It is unfortunately not the first time that I made this mistake. I had spent some hours with debugging some years ago, so I actually knew about this problem.

      No idea, why I typed it wrong again in this example, just checked my production version and it is like your suggestion.

      I exhanged the screen shot.

      (0) 
  3. Bravish Bawaney
    Hi Jürgen L,

    This post was really helpfull.

    I have followed all the steps mentioned but getting en error message ‘Invalid Text Object (Check Table TTXOB )’.

    Other two links were the steps explained in details are not working.

    (0) 
    1. Jürgen L Post author

      Thanks Bravish Bawaney for telling me that the links were broken.

      I just fixed all links, you should be able to find it now.

      Just in case you have difficulties, click my user name, your are taken to my user record, there click the content tab. Make sure that the focus is on “Authored” which can be seen on the left, then filter by blogs in the middle. so you get to all my blogs

      (0) 
  4. Nick C.

    Jurgen, thanks for sharing this information.

    I am running into a scenario whereby I am updating the long text, but it is not viewable in the transaction.  If I use the FM READ_TEXT I can see the long text for the object, but it is not visible in the transaction.

    I have read that the LT indicator in the relevant table must be updated (PLMK in this case), but I am not sure where the update should take place.  Do you have any idea on the code that should be used to make such an update, and in which section of the field mapping it should be placed?

    Thanks,

    Nick

    (0) 
  5. Sudd y

    Hello Jurgen,

    Thanks for this blog. Very much helpful.

    I have two queries.

    First is Requirement is upload same material with multiple languages in single file.

    Second is If language is given in input file. System truncates and takes first character during conversion. For example PL i.e. Polish is mentioned in input file. But system take first character i.e. P meant for Porturgese during conversion of data. PO text written with language Portugese instead of Polish.

    The same single character field is appearing in MM02 purchase order text view on clicking new button for PO text. Whether two character language can be given as input.

    Can you please clarify

    Thanks…Suddy

    (0) 
    1. Jürgen L Post author

      no problem to load multiple languages for the same material in a single file.

      In this example I used a parameter to define a single language.

      If you add the language to your source file and take care about that in field mapping too then it will work.

      the Direct Input expects the internal language as a single character. Please check table T002  to see which single character corresponds to the 2digit language.

      (0) 
      1. Sudd y

        Thanks for your reply.

        I have mapped SPRAS

        Test file created with single material and different languages

        MATNR    SPRAS    TXLINE

        000000001025250049    CS    Material test 1-CS

        000000001025250049    FR    Material test 1-FR

        During conversion, Language field is considered blank (i.e. / mentioned in converted data). Also Only one header line appears. How to create header line for combination of Material number and SPRAS. As of now created for only material number change. For above example, two header lines should appear one for CS and another for FR.

        Please advice

        (0) 
  6. SAP MM1

    Hi Jürgen L,

    Great work as always. I am having the same problem as Nick C had. FM Read_Text is picking up right changes in the material PO text but when i go to MM03-Purchasing Text, it is not updated there. Still the old text. We are not using QM module so I guess PLMK-LTEXTEKZ should not be an issue here?

    Thanks in advance for your support,

    Salman

    (0) 
    1. Jürgen L Post author

      PLMK-LTEXTEKZ has nothing to do with PO text, hence no issue in your case.

      But your problem is bigger, you created an inconsistency. you stored text in STXH and STXL which cannot be found by the standard programs when displaying the material master. this means you did not replace existing text, you just added new text with a different key. this is usually the case if your material number is not in the expected format. Direct input does not check the  material number it does what the name says: direct input of data into a table.

      of course such text can be found with FM read_text when you use the same key that you used for the input.  But this key is certainly different to the key that is used from your material master.

      (0) 
      1. SAP MM1

        Thanks for your quick response. You got it right. Probelm was with the MATNR field.

        I actually did not  copy100% of your program but made a few changes. I used MATNR instead of old material number and did not use any additional logics for Material numbers, multi languages or errors as you used. My upload file had 2 columns MATNR and Long text.

        Like wise, in my field mapping and conversion rules header, I have Object as MATERIAL (Constant), Name as MATNR (Move from upload file), ID is BEST, SPRAS is E (English).

        In long text (rows) I have Tex line to be moved from the file. Program now seems to work fine. As you rightly mentioned, MATNR should be exactly what as TEXT is  in table STXL otherwise this program will create a new entry.

        Thanks again,

        Salman

        (0) 
  7. Ramires Meneses

    Amazing post, Jürgen. Thank you very much.

    I’ve done some changes to use in my case. I’ve extended some materials using MM17 but as expected the Sales Text wasn’t extend as well. I’ve built a LSMW using your post as a example, but without using your configuration for global purpose.

    Objetct = MVKE

    ID = 0001

    SPRAS = P (for Portuguese)

    My text file had two columns (MATNR and TLINE), I’ve run the LSMW withou any errors, but got result at the material itself.

    Any clue?

    One more question, how can I set different text for different Distribution Channels? I’ve tried to concatenate the MATNR with Org. and Dist. Channel, but got no result.

    (0) 
    1. Jürgen L Post author

      The material number field is 18 long. It depends on your customizing whether you use Lexicographic numbers or normal numbers. In normal numbers you have leading zeros and all 18 digits are used.

      With lexicographic numbers, the numbers are left aligned like Characters and then you have spaces from the last number to the 18th digit.

      Based on your ABAP skills you can take care either with a little ABAP in the LSMW, or you need to prepare your source file accordingly.

      I have lexicographic numbers and I put the name together in this way:

      concatenate xxx-MATERIAL  xxx-VKORG xxx-VTWEG  into yyy-NAME RESPECTING BLANKS.

      If you want load for several sales organizations and divisions then you either prepare the source file or you define parameters for sales org and division like I did it above for the language, and then you run the same source file for each sales org/division combination that you enter manually  in the conversion step.

      (0) 
      1. Ramires Meneses

        Looking at the table STXL I’ve found that the NAME, in my case, is 24 char long, with 12 zeros followed by the MATNR/VKORG/VTWEG.

        Now it worked, thank you very much.

        (0) 
  8. Jürgen L Post author

    I am not sure what I can do more than I already did with this blog. At least I cannot help without knowing details

    (0) 
  9. Deepthi Busanelly

    Hi Jurgen,

    Do you know how we can use this to update infotype texts in HR? They seem to be stored in a different way in cluster tables. Was wondering of you have some clues.

    Thanks,
    Deepthi

    (0) 
    1. Jürgen L Post author

      I have no experience with HR systems, do not know if they are differently organized.

      But I saw discussions in HR forum where the above way was suggested and even a discussion where the poster replied that he used this way to load the texts successfully

      (0) 
  10. Jose SAPMM

    can u tell me that is it possible in lsmw with batch input recording that one material upload with multiple plants and several storage location at a time 

    (0) 
  11. Arihant Jain

    Hi Jurgen,

    Could you help me with step 5, i have attached a screen shot,how to proceed after this, i am not getting code editorLSMW.PNG

    (0) 
  12. Cynthia Lafleur

    Hi Jurgen,

    Thank you for this blog, as I am currently trying to load longtext into the basic view of material master. However I am getting an error at the convert step that says that field “longtext-old_number” is unknown.  it is neither in one of the specified tables nor defined by a “Data Statement.

    I have followed step by step your blog and my source has the same name as yours.  I tried even in capital letter to see if this could be the problem but got the same error.  Are you able to help me?

    tks in advance.

    (0) 
    1. Jürgen L Post author

      The field is defined in step 3.

      So you either have a different structure name or a different field name in step 3 or have a type somewhere in step 5.

      when you are in step five then click the check button and SAP should show you the program code with the wrong statement.

      (0) 
  13. Vivek S

    simply to understand the logic of long text , really it’s so much amazing stuff. Thank you for sharing your knowledge to SCN community user like me.

    Regards,

    Vivek

    (0) 
  14. Emöke Györfi

    hi Jürgen!

    I always find your postings very helpful, thank you for this one as well!

    I have created an LSMW with direct input for extending material masters, for a ‘partial’ migration (rollout from a finance backbone version to fully integrated ERP version of our system). It seems to work well, however I was puzzled to find that whereas the MM60 list displays my LSMW execution date and my user as ‘last changed on’ and ‘last changed by’, in the material master there is no change document. In the direct input method I used MM01 and then even MM02 to adjust some of the material masters. I found for none of these material a change document directly from the material master.

    Is this normal behaviour of the system? I found no note correcting this issue. Our system is on EHP7.

    Thank you!

    Emöke

    (0) 
    1. Jürgen L Post author

      I just tested it in my system (EHP606) and cannot confirm what you saw.

      If I load longtext like explained in the blog then I will not see change documents in the material master, I will not be listed as user for last change in table MARA and as well not see a new last change date in that table. MM60 still shows the old user who made the last change in the material master.

      I am doing direct input into table STXH and STXL with above method, it is quick especially because it does not update anything else than those two tables.

      The last change with user and date to the long text can be seen in the long text header.

      (0) 
      1. Emöke Györfi

        Thank you – now I understand that LSMW with direct input also just updates directly the tables without chnage documents (I thought it would). I have checked again and in my case it does indeed update as described. I will accept this as it is.

        One further question: would you propose a better/more suitable) solution than LSMW with direct input method for the case described (extending existing materials in a plant+company code for accounting, storage location, costing, warehouse management and occasionally sales views)? Do you see a risk here as it is direct input? Thank you!

        (0) 
        1. Jürgen L Post author

          I talked above about long text direct input, the direct input for material master can actually write change documents, see the screenshot in LSMW using Direct Input method

          Each program is different, so are all the direct input programs. You have to read their docu and also find OSS notes with more info if you are going to use it.  It is an old method and preferred from some consultants for performance reasons. I try to stay away from it because not all checks are done by the system which are usually done in a online transactions, so you have to care about these checks yourself to avoid bad data in the target system. I prefer the newer BAPI methods, but they have their gaps too.

          There are many aspects that have to be considered when selecting the import method, e.g. how you get the data to be migrated. If I get a text file with an IDOC structure then I can’t use the direct input since I can’t map the structures in LSMW, would need to invest a lot time to prepare the source in a way that I can work with it, while I could easily use the IDOC import method in that case.

          If I have somebody in the team who is only used to batch input, then he is probably faster and feels safe with the migration if he continuous  that way, while he would need much more time if I demand a BAPI method from him. (I actually wouldn’t have chosen him  if he is not comfortable with any migration method)

          (0) 
  15. Donny Noya

    Hi Jurgen,

    You say that loading text means replace the old text, so if we upload two lines of data which have same id then they replace the first one with the second one right?

    is it possible for me to upload text with so many lines with same id without replacing the old text?

    for example, i have this text:

    This is just text

    Just ignore this text

    i want upload this text to purchase order header text, but in PO only appear “just ignore this text” instead of this:

    “This is just text

    Just ignore this text”

    i split this text into two lines of data:

    450000001     This is just text

    450000001     Just ignore this text

    Could you help me for this case?

    Thanks.

    (0) 
    1. Jürgen L Post author

      Just follow the steps given in the Blog, exact this case is covered and explained, you must have rushed too much while reading

      (0) 
      1. Donny Noya

        Sorry, my mistake. apparently i missed the step when you change “transfer_record” Into “on_change_transfer_record”. after that, your method works fine for me! Thanks!

        (0) 
  16. Cynthia Lafleur

    Hi Jurgen,

    I have tried to copy your code almost as is… however I wasn’t able to get the old material number converted.  I suspected that something was wrong in this step of the mapping.  I changed the second longtext-old_number with WA_MARA_MATNR. and it worked.  Was it an error in your screenshot?  Because with this new code the program now works!  tks again as I can use this rule for all my objects that need the old-material number to new material number conversion.  its way faster then extracting MARA table and doing vlookup formula in the input file!  tks again.

    data: wa_mara type mara.

    SELECT  single  * FROM  MARA into WA_MARA

           WHERE  BISMT  = longtext-old_number.

    if sy-subrc = 0. “record found

         /SAPDMC/LTXTH-NAME = WA_MARA-MATNR.

    else.

      WRITE:/ longtext-old_number , ‘not in MARA-BISMT’.

      w_skip_flag = ‘Y’.

    endif.

    (0) 
    1. Jürgen L Post author

      Thank you very much for finding and reporting this mistake 😘

      I just checked my LSMW and it appears that it is like you mentioned. Somehow the old screenshot and coding survived here in the blog while it is was corrected in the program already a day after the blog was created.

      I replaced screenshot and the coding example

      (0) 
  17. Francisco Gonzalez

    Hi Juergen, First of all, let me thank you for your contribution, i read your posts a lot. Please let me ask you something: Right now i need to create a big amount of Equiment´s Task lists (about 3000 files). I am using LSMW, but i have a problem about creating Task list long text. I only have the txt file that contains all the long texts that belongs to that high amount of task lists. I have tried two methods without success. 1. LSMW Object 0001, Method 0001. I create two targe fields: NAME and TEXT. Since i want to upload Long Text to existing task list i set the following parameters: OBJECT : ‘ROUTING’ ID: ‘PLPO’ Target field NAME is equal to TDNAME field of the existeing task list Target field TEXT is directly the text contained in the task list long text. Nevertheless, when i execute all the legacy steps an d go to check if the text is uploaded in the task list operation text, it is not. 2. LSMW Object 0470, Method 0000. When I use object 490, and method 000 to create the task list, in the Long text structure I only can upload a file with 40 characters lenght rows,  but my long text have thousands of lines in sap editor format. So creating a single task list this way requires a long of file adecuation before load it. Repeating this 3000 times makes no sense. Is there anyway to massively upload my big txt files into the LSMW Long text without converting each one in sap text editor format  ?

    (0) 
  18. Francisco Gonzalez

    https://scn.sap.com/thread/3856825

    Thanks for your answer Juergen ,

    I have read the mentioned note and I also read your responses in the case  https://scn.sap.com/thread/3856825. Let me detail my question:

    This is my Project:

    1.JPG

    2.JPG

    5.JPG

    6.JPG

    And my file has this format:

    4.jPG

    After read the 138012 note i can understand that its needed to update the field of long text exist. And there are two ways to achieve this goal: 1) made an z report or 2) enter code in the field maping . I would like to take option 2. Trying to make an analogy between your material long text legacy and mine, Should I enter the code that updates the longt text exists indicator  in the _END_OF_TRANSACTION_ section ?

    Thanks in advance for your atention Juergen.

    (0) 
    1. Jürgen L Post author

      The objects are programmed by different people in SAP, while the material master directly checks for long text the task list needs an indicator that tells the program that it has long text and  triggers the program to look into the long text tables.

      The direct input for long text as described in this blog cares only about long text in tables STXH and STXL, it does not do any update in any other table.

      To make the text visible you would need to update the task list table.

      Option 1 is that you do that with a Z-program

      Option 2 is that you set this indicator already when loading the task list while you have not yet any text. Just to prepare for the separate text load.


      Since your task lists exists already you will not have the chance to use option 2. Its too late for that. You have to go with option 1

      (0) 
      1. Francisco Gonzalez

        Thanks again for your quick response,

        Sorry that i didn´t mention in the project explanation, but i made this legacy to create task list (since it only work for creation transactions) so, i forget about modifyng my old task list without long text and I decide to create a new ones from zero loading the long text.

        For that reason I´m taking option 2. So my question is in this scenario.

        (0) 
        1. Jürgen L Post author

          If you are allowed to do table updates from the LSMW conversion program then you can place your code in the end_of _transaction section.

          In the narrow sense you are programming a kind of trojan and bypass the usual approval and transport procedures for Z-Programs.

          It had cost me a lot of energy to convince our auditors and security guys that I need the flexibility of the export/import feature to be fast in critical times of data migration. I would not risk this privilege with such program code. 

          At the end it is nothing else than the Z-program does, but these kind of people are doctrinaire.

          (0) 
          1. Francisco Gonzalez

            I am going to thank you everytime you make a response, hope this don’t bother you,

            I understand that the option that i’m asking is not very ‘clean’ , i also think that z-programs generally cause more damages than their thought benefits. Nevertheless, thinking in the option 1,  right now our abap time is very overcharged.

            I will take again the option of loading the New task list by object 0470. One question about this method, i assume that this program deal with the long text existence indicator, as i said i have all the task lists operations in txt files in natural language, do you now a way to make the legacy able to transform and read the text? ( if i try to convert each One in sa text editor format i will never finish, 3 thousands aprox)

            (0) 
  19. Paul Jackson Consultant

    Hi Juergen,

    More kudos sir.  I was struggling to load PO header texts on multiple lines and just your one tip about “on_change_transfer_record” solved my issue.

    Thank you.

    (0) 
  20. Lars Birk

    Hi Juergen,

    I have tried to create a LSMW, based on your instruction, but when I run the input, it shows that it transfered, but when I  check my material, the text is not uploaded.

    I try to load Basic text on the Material master, via the material no MATNR.

    My mapping looks like this

    /wp-content/uploads/2016/07/1_994199.jpg

    When I have done the convertion the upload file look like this

    /wp-content/uploads/2016/07/2_994200.jpgI also get a ok on the upload, but the material master is not updated with my text.

    I think that it could the way I have mapped the material no, but I’m sure can you pls help here

    Thanks Lars

    (0) 
    1. Jürgen L Post author

      It worked for so many people as you could see on previous comments, so you must have overseen something.

      Unfortunately I am already over 50 and can’t read anything in your screenshots, not even with zoom of 500%

      But looking at the structure of your first screenshot I am very certain that you have not followed every detail in my blog.  Please go through my blog LSMW Material master by BAPI method – Part 1 to know how a professional does setup his LSMW, which is the basis to succeed with the approach in this blog.

      (0) 
      1. Lars Birk

        Hi Juergen,

        Thanks for your quick reply, I can see that these are small pictures 🙂 I tried to do a new

        I think that I have followed your instruction, but I have not used the coding in the Name field only mapped the material no. 

        Could this be the problem, I can see any other field to map the material no mara-matnr to.

        Regards, Lars 

        /wp-content/uploads/2016/07/3_994295.jpg

        (0) 
        1. Jürgen L Post author

          There were more places with coding in my blog, and they all have their meaning.

          In step “Display converted data” you can see how your data looks, you can see if you have the correct material number for each text and of course if the material number is in the right format, to much people forget that a material number usually has leading zeros in a standard SAP system, so just mapping a material number from an Excel sheet which has no leading zeros will certainly cause that you loaded the data to exact this number, but your material has a different number since it has leading zeros . Use SE16, there choose from menu Settings > user settings and in the tab data browser remove the flag for “consider conversion exit”, then check your MARA table and see how the material number is. If that does not match with your source then your load is not visible in the material master, but is certainly loaded to the STXH/STXL table (warning was given in my blog)

          (0) 
          1. Lars Birk

            Hi Juergen,

            your right the problem was the format, when I’ve added the missing zero’s it work fine.

            Can I ask one more thing, can you by coding add the missing zero’s to the material no I’m coming with in my excel sheet, or should I just add in excel.

            Thanks for help.

            Regards, Lars 

            (0) 
            1. Jürgen L Post author

              you can convert the number via calling function module CONVERSION_EXIT_MATN1_INPUT

              into the internal format.

              You can as well just use the  “concatenate” to add leading zeros (in case all numbers have the same length) in LSMW or in your Excel source

              (0) 
  21. Gregor Hintringer

    Hy Jürgen,

    great job, many thanks for this useful Guide.

    Do you know if there is a possibility for a change log when using the LSMW direct input method for (e.g. Material) long texts? (if i do it manually via MM02, a change log is created, just to inform that a certain text type has been changed).

     

    BR,

    Gregor

    (0) 
    1. Jürgen L Post author

      the direct input touches only STXH and STXL tables. it is just the text object and ID that makes the text visible from material master. So there is technically no option to see change history in the material master.

       

      (0) 
  22. Sasindran S

    Hi Jurgen,

    I want to migrate service master records into an SAP system. I already managed to migrate the fields of interest using an LSMW recording with transaction AC02, however long texts are ignored from recording the field.

    How I can proceed with that?

     

     

    (0) 
      1. Joel Uzibor

        Thanks Jurgen for your presentation.

        What I actually have is creating Purchase Orders with very long header texts. Some of them are as long as 80 lines.  I don’t know if LSMW would be an efficient method. Would you happen to know what other methods that can be used. Please don’t ask me what they are doing with 80 lines of text. I have asked the business that and they seem to think that is what they want. But I have explored cover letter options for them and this is just an extra layer of last resort.

        Thanks.

        (0) 

Leave a Reply