10-07-2007 8:21 AM
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
10-07-2007 12:45 PM
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
10-07-2007 8: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
10-07-2007 11:50 AM
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.
10-07-2007 12:10 PM
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
10-07-2007 12:20 PM
I am using TDNAME = %000000000010001 (As this is the notification number while creating)
while using FM READ_TEXT.
It is fetching data from STXL table.
When i checked in STXL TABLE for this TDNAME i am getting a value for CLUSTD:
FF06010102028000343130320000000063010000121F9D0232663E060606461E20C1C0CA800D8430F8307832F831B8AE85A85C05166501538C1CEB2082FBA066
Please let me know how to encode this.
10-07-2007 12:24 PM
Should i clear CLUSTD value in STXL table after using FM READ_TEXT for TDNAME = %000000000010001.
Please suggest.
10-07-2007 12:45 PM
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
10-07-2007 3:32 PM