‎2007 Oct 30 9:07 AM
HI all,
am having a problem with a report program.
In ME53N, i can find the long text for my material num.
am executing TCODE-ME5A,here for tht particular material num i need to display the long text also...
So, for this requirement i copied the standard program to my Z*** program ,it is working well and good and the problemn araises...
i know tht i need to calll function module READ_TEXT() to read the long text.
But, wr to read this FM...wt r the parameters to be passed to the FM.
Help me wt to do....
REPLY ASAP..
regards,
Prashanth.
‎2007 Oct 30 10:37 PM
Here are the parameters you need:
<b>ID</b> - 'B01' for item text
'B02' for item note
'B03' for delivery text
'B04' for material PO text, etc
<b>LANGUAGE</b> - whatever language the texts were entered in, most likely your default system language (SY-LANGU) or language code, e.g. EN for English
<b>NAME</b> - For header this is the document number with leading zeros, for item append the item number to the document number (both with leading zeros)
<b>OBJECT</b> - 'EBANH' for header text and
'EBAN' for item text
Let me know if you need more help
AND
Please dont forget to reward point if this was helpful.
‎2007 Oct 30 10:45 PM
Hi,
Sample code for how to use READ_TEXT -
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
ARCHIVE_HANDLE
If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
The value '0' indicates that you do not want to read the text from the archive.
Reference field: SY-TABIX
Default value: 0
Import parameters:
HEADER
If the system finds the desired text, it returns the text header in this parameter.
Structure: THEAD
Table parameters:
LINES
The table contains all text lines that belong to the text read.
Structure: TLINE
Exceptions:
ID
The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
LANGUAGE
The parameter LANGUAGE contains a language key that does not exist in table T002.
NAME
The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
Possible errors:
The field contains only blanks.
The field contains the invalid characters * or ,.
OBJECT
The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
NOT_FOUND
The system did not find the specified text module.
REFERENCE_CHECK
The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
WRONG_ACCESS_ TO_ARCHIVE
The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
Hope this helps.
ashish