Skip to Content
avatar image
-4
Former Member

read_text function for multiple id and multiple languages

I have managed to make the READ_TEXT FM work only for one cID at a time on multiple calls of function read_text(for example I found out how to access it for cID = 'GRUN' cObject = 'MATERIAL'. Can anyone advise how to connect read_text function so that inspection text(cID = 'GRUN' cObject = 'MATERIAL') will be dispalyed in my alv grid on the same line with material details? Please see below output when running my program:

FORM READTEXT.
  data: it_MVKE type standard table of MVKE initial size 0.
  data: lMVKE like MVKE, lMAKT like MAKT, lT002 like T002 ,
        lTDNAME like THEAD-TDNAME,"text header

        it_TLINE type standard table of TLINE,
        wa_TLINE type TLINE.

  data: cObject(10) type c, cID(4) type c.


  select MATNR from MARA into corresponding fields of table it_MVKE
  where MATNR in Material order by MATNR.
  cID = 'GRUN'. cObject = 'MATERIAL'. "Text date principale "


  loop at it_MVKE into lMVKE.

    lTDNAME = lMVKE-MATNR.

    select spras from T002 into lT002.

      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          CLIENT   = SY-MANDT
          ID       = cID
          LANGUAGE = lT002-SPRAS
          NAME     = lTDNAME
          OBJECT   = cObject
        TABLES
          LINES    = it_TLINE
        EXCEPTIONS
          ID       = 1
          OTHERS   = 8.

      IF SY-SUBRC EQ 0.

        select single * from MAKT into lMAKT where MATNR eq lMVKE-MATNR
         and SPRAS eq lT002-SPRAS.

        LOOP AT it_TLINE INTO wa_TLINE.
          wa_join-TEXTPRI = wa_TLINE-TDLINE.
          append wa_join to lt_join.
          clear wa_join.
        ENDLOOP.
      ENDIF.
    ENDSELECT.
  ENDLOOP.
ENDFORM.
capture.jpg (109.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 03, 2017 at 06:55 AM

    Just call READ_MULTIPLE_TEXTS or call READ_TEXT for each ID, what your exact concern. Have a coffee, walk around the block to clear your head and then get back to coding.

    Add comment
    10|10000 characters needed characters exceeded