Skip to Content

about function read_text

hi

when I use function read_text and it doesn't get any value, a popup window will be showed up and then the program stops.

I am wordering if there is a way to continue to execute the program and return a null value.

thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    Posted on Sep 09, 2013 at 07:05 AM

    Hi Ming,

    why didn't you check before using this function if the text exist using an SQL statement on the table : STXH ?

    regards

    Fred

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 09, 2013 at 07:18 AM

    Hi,

    The wiki will give you a better idea on the usage of the FM

    http://wiki.scn.sap.com/wiki/display/EIM/Function+Example+READ_TEXT

    Cheers,

    Arindam

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 09, 2013 at 07:24 AM

    Hi Ming,

    I am not sure what you have passed to FM,

    It is used as below:

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    id = ' ' ( Text id )

    language = sy-langu

    name = likp-vbeln

    object = 'VBBK'

    TABLES

    lines = l_it_lines

    The ID will be same which is in table STXH (TDID).

    Hope it will work .

    Thanks

    Romit Raina

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 09, 2013 at 07:33 AM

    Hi Ming,

    I have used this FM and the program is absolutely fine. There is a table TTXIT from where you can fetch TDID according to your application area(my application area was MM and related to PO so I passed 'EKKO' in TDOBJECT) and this TDID can be used in READ_TEXT FM.

    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    client = sy-mandt
    id = wa_text-tdid
    language = sy-langu
    name = gv_ebeln "PO number
    object = text-wh4 "EKKO
    TABLES
    lines = lt_lines "text
    EXCEPTIONS
    id = 1
    language = 2
    name = 3
    not_found = 4
    object = 5
    reference_check = 6
    wrong_access_to_archive = 7
    OTHERS = 8.
    IF sy-subrc <> 0 AND sy-subrc <> 4.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    Hope this will help you.

    Cheers.

    Dineshwar

    Add a comment
    10|10000 characters needed characters exceeded

    • use of read_text.............

      DATA: lt_line TYPE TABLE OF tline,

      ls_line TYPE tline.



      data: NAME type THEAD-TDname,

      TDOBJECT type THEAD-TDOBJECT value 'VBBK' .

      * LV_LINE TYPE TDLINE.



      name = p_vbeln.

      *BREAK-POINT.

      CALL FUNCTION 'READ_TEXT'

      EXPORTING

      * CLIENT = SY-MANDT

      ID = '0002'

      LANGUAGE = sy-langu

      NAME = NAME

      OBJECT = TDOBJECT

      * ARCHIVE_HANDLE = 0

      * LOCAL_CAT = ' '

      * IMPORTING

      * HEADER =

      * OLD_LINE_COUNTER =

      TABLES

      LINES = LT_LINE

      EXCEPTIONS

      ID = 1

      LANGUAGE = 2

      NAME = 3

      NOT_FOUND = 4

      OBJECT = 5

      REFERENCE_CHECK = 6

      WRONG_ACCESS_TO_ARCHIVE = 7

      OTHERS = 8

      .

      IF SY-SUBRC <> 0.

      * Implement suitable error handling here

      ENDIF.


      LOOP AT lt_line into ls_line.
      concatenate LV_string ls_line-tdline into LV_string separated by space.
      ENDLOOP.



  • author's profile photo Former Member
    Former Member
    Posted on Sep 09, 2013 at 09:46 AM

    Hi Ming,

    Read_text works fine to retreive the texts. Please check whether texts are maintained properly and you are passing correct parameters to function module.

    Kindly post your code with pop up window you are receiving in order to resolve the issue.

    Best Regards,

    Abirami S

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 09, 2013 at 10:00 AM

    you can find the text in se75 by text id.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 09, 2013 at 10:08 AM

    Hi Ming,

    Not sure if it will work but worth trying.

    Check the values of sy-subrc after the function call.

    call function read_text.....

    if sy-subrc ne 0.

    message text TYPE 'I'. " Just give a message and continue with the program execution.

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.