Skip to Content
avatar image
Former Member

Problem in using FM READ_TEXT to read Material Sales Text.

Hi Guys,

I am developing a Customer Outstanding report in which I display all the invoices of a particular customer.

I need to read "Material Sales Text" which comes under "Item Text" tab in transaction FBL5N.

I have used READ_TEXT in my program. I have identified the Object, and ID but I am stuck up with the Name. I dont know what Name to pass. I have tried passing the Invoice Number in "Name" but couldnt get the text.

Request you to please help me out. Please check the below code.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = '0001'

language = SY-LANGU

name = -


???????????????

object = 'VBBP'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = tl001

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OTHERS = 8

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jan 11, 2011 at 09:50 AM

    Hi,

    Please write the below ..

    SELECT TDOBJECT

    TDNAME

    TDID

    TDSPRAS

    FROM STXH INTO TABLE IT_STXH

    WHERE TDOBJECT = 'MATERIAL'.

    LOOP AT IT_STXH INTO WA_STXH.

    L_ID = WA_STXH-TDID.

    L_LAN = WA_STXH-TDSPRAS.

    L_NAME = WA_STXH-TDNAME.

    *pass WA_STXH-TDOBJECT to NAME ..

    endloop.

    Regards,

    Srini.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 11, 2011 at 09:52 AM

    Hi,

    Goto transaction FBL5N ->Item->Material sales text->double click on it ->in the menu GOTO-> select header->Change editor..

    You will get one popup and see what is there in the NAME..pass that value and see if you are getting the desired result.

    Regards,

    Nagaraj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 11, 2011 at 09:54 AM
    *&---------------------------------------------------------------------*
    *&      Form  READ_TEXT
    *&---------------------------------------------------------------------*
    FORM read_text  USING    p_tdid  p_tdname
                    CHANGING p_tdline.
    
      DATA: it_line  TYPE STANDARD TABLE OF tline,
            wa_line  TYPE tline                  ,
            l_tdid   TYPE thead-tdid,
            l_tdname TYPE thead-tdname.
    
      l_tdid   = p_tdid.
      l_tdname = p_tdname.
    
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          id       = l_tdid
          language = 'E'
          name     = l_tdname
          object   = 'VBBP'
        TABLES
          lines    = it_line
        EXCEPTIONS
          OTHERS   = 8.
    
      LOOP AT it_line INTO wa_line.
        IF NOT wa_line-tdline IS INITIAL.
          p_tdline = wa_line-tdline.
        ENDIF.
      ENDLOOP.
    
    ENDFORM.                    " READ_TEXT
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      The name of tetxt will be the bill number concatenated with item number, you can get all data from VBRP:

      NAME(10) = VBRP-VBELN.

      NAME+10(6) = VBRP-POSNR.

      or

      CONCATENATE VBRP-VBELN VBRP-POSNR INTO NAME.

      Max

  • Jan 11, 2011 at 11:08 AM

    Hello,

    You can use the BAPI 'BAPI_MATERIAL_GET_ALL' to get the Material Sales text. The text lines are returned in the table param MATERIALLONGTEXT.

    You need to pass the Sales Org. & Distribution Channel values for the BAPI to return the sales text.

    Anyway as per your question:

    NAME = MATERIAL + SALES ORG + DISTR. CHANNEL (RESPECTING BLANKS)

    BR,

    Suhas

    PS: The object is MVKE & not VBBP as used by you!

    Add comment
    10|10000 characters needed characters exceeded