Skip to Content
avatar image
Former Member

Extraneous Information coming from Function module READ_TEXT

Hi,

I am Using READ_TEXT to read the long text of items in quality notification.

If there is no long text maintained for item in Quality notification even though it is showing some text.

How can i correct this problem, as the values are coming from standard FM.

From this FM control is going into an include "LSTXDFDB"

while importing it is picking some text.

move-corresponding rt_header to stxl_id.

if rt_header-tdtexttype is initial. "SAPscript format

import tline to rt_lines

from database stxl(tx)

client rt_client

id stxl_id

IGNORING CONVERSION ERRORS.

Kindly suggest....

Thanks and Regards,

Vaibhav

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 07, 2007 at 11:45 AM

    When using function module READ_TEXT you need to pass 4 input variables and one table as follows:

    DATA: l_id     LIKE  thead-tdid,
          l_lang   LIKE  thead-tdspras,
          l_name   LIKE  thead-tdname,
          l_object LIKE  thead-tdobject,
          lt_lines TYPE STANDARD TABLE OF  tline.
    
    l_id     = '0001'.       "<<<<<< change to match desired text
    l_lang   = sy-langu.     "<<<<<< change to match desired text
    l_name   = 'BELEG'.      "<<<<<< change to match desired text
    l_object = '0002500001'. "<<<<<< change to match desired text
    
    CLEAR: lt_lines[].
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        id       = l_id
        language = l_lang
        name     = l_name
        object   = l_object
      TABLES
        lines    = lt_lines.
    

    You do not need to do anything with STXL or its fields - that is what the function module is there for - it converts the text from the cluster table into a standard internal table and returns it to your program as LT_LINES in the above example.

    You just need to find out the values that must be specified in the four fields I have listed to match the text you are trying to retrieve. It is unlikely to start with '%'.

    To find the key values, edit a text using the online transaction and go to the full screen editor for it - then display the text header which should show the four values. You may need to switch to the old style text editor to see the header.

    Andrew

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 07, 2007 at 07:28 AM

    Hi,

    Read text function module will return subrc 0 only when the text extends more that 72 char.... so in the line item check if there are any blank lines appended...

    If the hint is useful… Say thanks by reward….

    Regards,

    Prabhu Rajesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for replying but my question is not resolved.

      My question is: if i am not giving any long text while creating quality notification then why this FM is picking garbage text "test".

      Please let me know what is CLUSTR, CLUSTD in STXL table.

  • avatar image
    Former Member
    Oct 07, 2007 at 11:10 AM

    Check that you have cleared the internal table rt_lines (or whatever the table in your code is called that is passed to the Fuction Module) before calling the function module READ_TEXT. If it does not find anything, then the text from previous calls may be still in the table.

    Also check the object key you are passing the function module - often you need to make sure the correct number of leading zeros is included to get the right result.

    Andrew

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 07, 2007 at 02:32 PM

    Thanks

    Add comment
    10|10000 characters needed characters exceeded