Skip to Content

upload long text in mm02( basic data text )

dear experts,

  how to upload long text in basic data text in mm02 using BDC.

after recording it's showing no fields related to that text filed. so how we can upload it using mm02 t-code.

plz help to solve my issue.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Dec 10, 2012 at 10:53 AM

    Hi

    Upload long text is not possible through bdc.

    Use FM ' CREATE_TEXT '....

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 10, 2012 at 10:58 AM

    Hi,

    I suggest you to use the SAVE_TEXT function instead.

    http://search.sap.com/ui/scn#query=SAVE_TEXT+material+basic&startindex=1&filter=scm_a_site%28scm_v_Site11%29

    Regards,

    Christian

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member santosh kumar

      Hi,

      SAVE_TEXT usage for materials..

      data: thead type thead,
             tline type TABLE OF tline WITH HEADER LINE.

      thead-TDOBJECT = 'MATERIAL'.
      thead-TDNAME = your material no.
      thead-tdid = 'GRUN'.      "Basic data text
      thead-TDSPRAS = 'EN'.
      tline-tdformat = 'E'.
      TLINE-tdline = 'Hi this is the material SD TEST'.
      append tline.
      CALL FUNCTION 'SAVE_TEXT'
         EXPORTING
          CLIENT                = SY-MANDT
           header                = thead
           insert               = 'X'
          SAVEMODE_DIRECT       = 'X'
         tables
           lines                 = tline
        EXCEPTIONS
          ID                    = 1
          LANGUAGE              = 2
          NAME                  = 3
          OBJECT                = 4
          OTHERS                = 5

      thanks.           .

  • Dec 10, 2012 at 12:03 PM

    dear experts,

    i have the following format to upload to basic data text in mm02.

    material                        texts

                                    1. aaaaaaaaaaaa

                                    2. assssssssssssss

                                    3. eeeeeeeeeee

    a                              4. rttttttttttttttt

                                    5. rtttttttt

                                    6. trerrrrrrrrrrrrr

                                    7. errrrrrrrrrre

                                    8. errrrrrrrrrrrrrrr

                                    9. errrrrrrrrrrrrr

    b                             10 .errrrrrrrr

                                   11 .dfrrrrrrrrrrr

                                   12. dgffffffffff

                                    13. dfffffffffffffff

    how i will update this format in mm02 - basic data text (in that big box) using bdc.

    plz provide me some code.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Santosh ,

                              please check sample code using SAP Standard BAPI (

        BAPI_MATERIAL_SAVEDATA

      ).

        DATA: E_ERROR LIKE BDCDATA-FVAL,

                   MHEADER LIKE BAPIMATHEAD,

                   L_MLTX  LIKE BAPI_MLTX        OCCURS 0 WITH HEADER LINE.

      TYPES: BEGIN OF TYPE_ITB,
            MATNR TYPE MARA-MATNR,
            TEXT_LINE TYPE BAPI_MLTX-TDLINE,
            END OF TYPE_ITB.
           
            DATA:ITAB TYPE STANDARD TABLE OF TYPE_ITB,
                 WA TYPE  TYPE_ITB .


      */*            COLLECT ALL Excel sheet value into ITAB */

      SORT ITAB BY MATNR .

      LOOP AT  ITAB INTO WA .

      CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
              EXPORTING
                INPUT        = WA-MATNR
              IMPORTING
                OUTPUT       = WA-MATNR
              EXCEPTIONS
                LENGTH_ERROR = 1
                OTHERS       = 2.
            IF SY-SUBRC <> 0.
      * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.



      * FILLING MATERIAL HEADER STRUCTURE
        MOVE 'X'     TO MHEADER-BASIC_VIEW.
        MOVE 'X'     TO MHEADER-PURCHASE_VIEW.


      * LONG TEXT BUILD

            MOVE 'MATERIAL'                               TO L_MLTX-APPLOBJECT.
            MOVE  WA-MATERIAL                             TO L_MLTX-TEXT_NAME.
            MOVE 'BEST'                                   TO L_MLTX-TEXT_ID.
            MOVE  'EN'                                    TO L_MLTX-LANGU_ISO.
            MOVE  '/'                                     TO L_MLTX-FORMAT_COL.
            MOVE  WA-TEXT_LINE                            TO L_MLTX-TEXT_LINE.
            APPEND L_MLTX.
            CLEAR  L_MLTX.


      * CREATING MATERAIL MASTER
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
          EXPORTING
            HEADDATA            = MHEADER
          IMPORTING
            RETURN              = BAPIMSG
          TABLES
              MATERIALLONGTEXT    = L_MLTX .

        IF BAPIMSG-TYPE = 'E'.

          CONCATENATE E_ERROR BAPIMSG-MESSAGE INTO E_ERROR SEPARATED BY SPACE.
          EXIT.
        ELSE.

          CONCATENATE E_ERROR MAT_NR 'Material Master Record Description Successfully Changed' INTO E_ERROR SEPARATED BY SPACE.
          COMMIT WORK AND WAIT.
        ENDIF.

        ENDLOOP .

      Note : Use Excel sheet Format

      Material Number  (leading with zero if internal number used )        Long Test (132 character at time )

      000000001000000009               aaaaaaaaaaaaaaaaaaaaaaaaaaaa

      000000001000000009               bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

      000000001000000009               cccccccccccccccccccccccccccccccc

      000000001000000010               hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

      000000001000000010               uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

      000000001000000011               uuuuuuuuuukkkkkkkkkkkkkkkkkkkkkkk

      000000001000000011               uuuuuummmmmmmmmmmmmmmmmmm

      Regard's

      Smruti

      Regard's

      Smruti

  • Dec 10, 2012 at 12:07 PM

    Did you try a more up-to-date solution like BAPI BAPI_MATERIAL_SAVEDATA which allows to add long texts ?

    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded