07-31-2007 9:57 AM
Hi,
I am ANAND.
can any one say how to use LONG TEXTs in SAPSCRIPTS? (by using SUBROUTINE-POOL Program and also by INCLUDE).
Thank u.
07-31-2007 10:06 AM
Hi
Welcome to SDN forum.
Long texts(Header and Item texts of an application document) are included in the script using the command INCLUDE
/: INCLUDE TEXT <name> ID <id> OBJECT < object> Language <en> Paragraph <name>
In the program they are fetched from the system using the fun module READ_TEXT and fetched data is transfered to Script using internal tables
see the doc
READ_TEXT provides a text for the application program in the specified work areas.
The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
Function call:
CALL FUNCTION 'READ_TEXT'
EXPORTING CLIENT = SY-MANDT
OBJECT = ?...
NAME = ?...
ID = ?...
LANGUAGE = ?...
ARCHIVE_HANDLE = 0
IMPORTING HEADER =
TABLES LINES = ?...
EXCEPTIONS ID =
LANGUAGE =
NAME =
NOT_FOUND =
OBJECT =
REFERENCE_CHECK =
WRONG_ACCESS_TO_ARCHIVE =
Export parameters:
CLIENT
Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
Reference field: SY-MANDT
Default value: SY-MANDT
OBJECT
Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
Reference field: THEAD-TDOBJECT
NAME
Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
Reference field: THEAD-TDNAME
ID
Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
Reference field: THEAD-TDID
LANGUAGE
Enter the language key of the text module. The system accepts only languages that are defined in table T002.
Reference field: THEAD-TDSPRAS
<b>Reward points for useful Answers</b>
Regards
Anji
07-31-2007 10:11 AM
Hi,
Long text are genrally used as information text in many places for 2 purposes.
1). For internal communications
2). FOr external printing purposes.
Long texts are available and many transactions. Eg. PO , SO etc
Which specific long text r u referring to ?
Long text could be used in sapscript, you create it with the transaction SO10.
Long text could be used in a lot of standard SAP transaction to store informations. For example VL02N, VA02, CO02 .......
Long text could be used to store anything.
The text are save in the tables : STXH (header) STXL (text). The second table is cluster table, so you can't access directly, you must use the function READ_TEXT, SAVE_TEXT ....
Regards