6 Replies Latest reply: Sep 4, 2012 2:58 PM by sandeep reddy RSS

failed to update the Basic Data Text in the MM01 using lsmw

sandeep reddy
Currently Being Moderated

Hii,

 

When i am doing recording using batch input method for MM01

Create Material 1000074 (MoA Raw Materials)_2012-06-16_20-50-55.png

 

Problem: I need to fill the data in highlighted area.how to achieve this functionality using lsmw.

  • Re: failed to update the Basic Data Text in the MM01 using lsmw
    Thomas Zloch
    Currently Being Moderated

    Looks like a long text. You cannot load these via recordings. Create the master record without the long texts in a first step, in the second step you additionally load the long texts using LSMW standard object 0001.

    Alternatively do not use a recording at all, rather use LSMW standard object 0020 and report RMDATIND, which is more complex, but includes the long texts as well, if I remember correctly.


    Thomas

  • Re: failed to update the Basic Data Text in the MM01 using lsmw
    Venkateswaran K
    Currently Being Moderated

    Hi

    You can use    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA' - to upload Material Data along with Long Text.

     

    In this BAPI, there is ta table structure called MATERIALLONGTEXT -

    You can fill this  table and pass it to this BAPI.

    This will upload your longtext for that material..

     

    I used this and succesfully upload the material data along with Long text. 

     

    Regards,

    Venkat

  • Re: failed to update the Basic Data Text in the MM01 using lsmw
    Venkateswaran K
    Currently Being Moderated

    OR

     

    You can use the following method.  This is also a working program

     

    You can upload material long text using following FM as well
    -- Create IT_LINE as follows - by reading the material code and long text from the excel file
    -- Call the SAVE_TEXT in the loop and it will update the long text


    DATA: GW_THEAD LIKE THEAD,      
          IT_LINE  TYPE TABLE OF TLINE WITH HEADER LINE.

    DATA: P_TXTNAM LIKE THEAD-TDNAME.

    -- Create IT_LINE as follows - by reading the material code and long text from the excel file

      GW_THEAD-TDNAME   = You Material code goes here. 
      GW_THEAD-TDID     = ’GRUN’. 
      GW_THEAD-TDSPRAS  = SY-LANGU. 
      GW_THEAD-TDOBJECT = ’MATERIAL’.

      IT_LINE-TDFORMAT = ’*’. 
      IT_LINE-TDLINE   = Your long text goes here. 
      APPEND IT_LINE.

     

      CALL FUNCTION ’SAVE_TEXT’   
           EXPORTING
        *     CLIENT = SY-MANDT     
              HEADER = GW_THEAD
        *     INSERT                = ’ ’
        *     SAVEMODE_DIRECT       = ’ ’
        *     OWNER_SPECIFIED       = ’ ’
        *     LOCAL_CAT             = ’ ’
        *   IMPORTING
        *     FUNCTION              =
        *     NEWHEADER             =   
          TABLES     
              LINES                 = IT_LINE   
          EXCEPTIONS      ID    = 1     
          LANGUAGE              = 2     
          NAME                  = 3     
          OBJECT                = 4     
          OTHERS                = 5            . 

       IF SY-SUBRC <> 0.  
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. 
       ENDIF.

     

    REgards,

    Venkat