08-22-2006 4:01 AM
Hi All,
I need to retrieve the the customers with text IDs YDL3. I know this can be seen on the customer master, Sales Area Tab, and going to menu path Extras --> Texts. If i input any value for this text ID, i will be able to retrieve the customers with this text IDs via STXH and STXL. However, if this has no value, i can't retrieve the customers with this header text configured. Can you please tell me where to retrieve this information even without a text maintained?
Thanks in advance!
Jim
08-22-2006 4:26 AM
The long texts are stored in STXH and STXL tables, however they are not in readable formats.
So, you will have to use READ_TEXT function to read the text which will throw a exception if the text does not exist and you will have to catch the same for further processing.
Regards,
Ravi
note - Please mark all the helpful answers
08-22-2006 4:18 AM
Hi Jim,
The contents of these "Standard Texts" or "Long Texts" are stored in table STXL but the contents are stroed in a compressed cluster format. This allows you to enter as much text as you like.
When you enter the text, save it and view it in the SAPscript Editor. You will see an asterisk (*) in the the first column, followed by your text. Now go to the following menu path: Goto->Header
You will see a popup giving you text name, text id, language and object. Notice the text name is a concatenation of customer number (with leading zeros), sales org, etc.
If you pass this into in function module READ_TEXT, you will get your "Header Text" contents.
Hope this helps.
Cheers,
Pat.
08-22-2006 4:26 AM
The long texts are stored in STXH and STXL tables, however they are not in readable formats.
So, you will have to use READ_TEXT function to read the text which will throw a exception if the text does not exist and you will have to catch the same for further processing.
Regards,
Ravi
note - Please mark all the helpful answers
08-22-2006 8:09 AM
My requirement is to determine whether the customer has a maintained header text, text ID YDL3 for example. I really don't need to read the content of the header text. All i need to know is check if my customer has a text ID YDL3 maintained without opening the customer master transaction. However, if my text ID does not have a long text maintained, it is not being reflected to STXH and STXL. So basically, i need to know what table to retrieve the information even if the text ID does not contain any long text.
Thanks!
08-22-2006 8:46 AM
Hi Jim
Will try to address your problem in the following way.
Hope it helps you.
Step1: Finding TEXT Details:
i) Create some text for a customer for testing.
ii)Now in Change mode go to the text double click on
the text which will take you to the EDITOR.
iii) Use Menu path: Goto-> Header
iV) Here you can find Text Name, Language, Text ID,
Text Object.
v) Figure out the combination of text name, whether
itz customer number alone or cutomer number and sales
area.
vi) Note the Text Object, i guess it should be KNVV
for sales texts.
vii) Now you can use these details to code in your
program.
Step2: Coding in your program
Below is a sample program which can help you.
Note that my assumption is Text Name is created with
customer number and sales area.
DATA: L_ID LIKE THEAD-TDID,
L_LANGU LIKE THEAD-TDSPRAS,
L_NAME LIKE THEAD-TDNAME,
L_OBJECT LIKE THEAD-TDOBJECT.
TYPES: T_LINE LIKE TLINE.
DATA: IT_TLINE TYPE STANDARD TABLE OF T_LINE.
L_ID = 'YLD3'.
L_LANGU = SY-LANGU.
L_OBJECT = 'KNVV'.
LOOP AT IT_CUSTOMER INTO WA_CUSTOMER.
CONCANTENATE WA_CUSTOMER-KUNNR WA_CUSTOMER-VKORG
WA_CUSTOMER-VTWEG WA_CUSTOMER-SPART INTO L_NAME.
REFRESH: IT_TLINE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = L_ID
LANGUAGE = L_LANGU
NAME = L_NAME
OBJECT = L_OBJECT
TABLES
LINES = IT_TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
IF IT_TLINE[] IS INITIAL.
" MESSAGE CUSTOMER TEXT NOT MAINTAINED
ELSE.
" MESSAGE CUSTOMER TEXT MAINTAINED
ENDIF.
ENDLOOP.
Hope the above info helps you.
Kind Regards
Eswar
09-15-2006 6:11 AM
Hi Eswar,
It's a nice explanation, from the above code i need some more info, could u please email ur phone to this address:
mxyz123@gmail.com.
Message was edited by: Mxyz
09-15-2006 6:49 AM
Hi,
Eswar has given very good explanation.
But before using read_text check with single select statement whether the text id is exist or not with table STXL.
It is for better parctise and for performance.
If sy-subrc = 0 then use the function to retrieve value.
-Umesh