on 07-11-2008 11:44 PM
I am trying to print out additional text that is entered in the "item text" section when creating the sales order. I am trying to call the READ_TEXT FM to read out the additional text, but I get the following error when I try to print preview it in vf02.
The reason for the exception is:
When calling the function module "READ_TEXT", one of the parameters needed according to the interface description was not specified.
This parameter was "LINES".
I know I don't pass the table "LINES" simply because 1) I don't know what table that is 2) I don't know what type of table it is and the data it contains.
DATA:
temp_id TYPE thead-tdid,
temp_language TYPE thead-tdspras,
temp_name TYPE thead-tdname,
temp_object TYPE thead-tdobject.
temp_id = '0001'.
temp_language = 'EN'.
temp_name = '0090000068000050'.
*temp_name = gs_it_gen-bil_number + gs_it_gen-itm_number.
temp_object = 'VBBP'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = temp_id
LANGUAGE = temp_language
NAME = temp_name
OBJECT = temp_object
IMPORTING
HEADER = extra_text.
The below bold text is missing in your program, may be u have declared it like variable...
DATA BEGIN OF i_tlines OCCURS 0.
INCLUDE STRUCTURE tline.
DATA END OF i_tlines.
DATA: w_textname(70) TYPE c.
w_textname = vbdkr-vbeln.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = 'Z006'
language = 'E'
name = w_textname
object = 'VBBK'
TABLES
lines = i_tlines.
IF sy-subrc = 0.
READ TABLE i_tlines INDEX 1.
t_in-m1 = i_tlines-tdline.
ENDIF.
Regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can use an include text instead of the read_text fm.
goto the general attributes of a text element. From the drop down menu, convert the text type to include text.
The just as in read_text fm pass the parameters
text name, text object, text id and language.
Every thing will be handled automatically
reward points if helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id =
language =
name =
object =
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
tables
lines = i_tab
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
So you want to know how get the parametrs right. This is how"
if u r using a standard text:
In SO10 goto goto menu -> header
here u will find all the required parametrs.
The text lines will be returned in the i_tab.
U can loop at this itab and display the data.
To get the sructure of the lines, go inside the read_text FM and use the same structure as declared in tables section.
data:i_tlines type standard table of <read_text table structure>
Reward points if hepful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark Lee,
The text will be stored in the parameter LINES. LINES is of type TLINE.
TLINE is a structure which contains two fields TDLINE and TDFORMAT.
In TDLINE the text is stored.
so we need to get the TDLINE.
DATA: I_TLINE LIKE TLINE,
T_TLINE LIKE TLINE OCCURS 0,
THEAD LIKE THEAD.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = temp_id
LANGUAGE = temp_language
NAME = temp_name
OBJECT = temp_object
IMPORTING
HEADER = THEAD
TABLES
LINES = T_TLINE.
IF NOT T_TLINE IS INITIAL.
LOOP AT T_TLINE INTO I_TLINE.
WRITE: I_TLINE-TDLINE.
ENDLOOP.
ENDIF.
Best regards,
raam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For some reason the WRITE statement does not output anything in my smartform. Is there an attribute that needs to be set or an option checked before I can issue this statement?
I have instead tried to use a loop element where I loop the itab into a wa_tab and try to print each tdline. However, the tdformat of "*" and random new line characters are being output as well instead of a single line of output. Here is how my nodes are ordered:
- table column node
- Program lines to call FM read_text
- Text Node to write out material description
- Loop Node to look itab into wa_tab
- Text node that writes the additional text (&wa_tline-tdline&)
If I enter in the addional text as: "This is additional text blah blah blah blah blah blah blah blah"
I get the output of:
"* This is additonal text blah blah
blah blah blah
blah blah blah blah"
I checked the table and there are only 2 entries, so why is it outputting as if there were 3?
Edited by: mark lee on Jul 14, 2008 11:27 AM
Hi,
Declare:
DATA: i_lines TYPE STANDARD TABLE OF tline,
It will have TDFORMAT and TDLINE. TDFORMAT contains some tags for each line, and TDLINE contains the actual long text.
Loop through this internal table to get your long text values.
Eg:
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = c_0020
language = sy-langu
name = ws_name
object = 'BELEG'
TABLES
lines = i_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
regards,
Subramanian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.