on 07-29-2008 9:30 AM
I want to print the header textmaintained for billing no. in the smartform.
I have done the following code but all the text is not printed.
I want to print the text which i get in TEXT_LINE table after i execute this Funciotn module in a sngle line. So i have written concatenate as below. But after 256 characters it is not displaying. I declared hed_text as string, then i tried as char512. Yet it does not take . How to proceed.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'Z009'
LANGUAGE = SY-LANGU
NAME = NAME_TO_PASS
OBJECT = 'VBBK'
IMPORTING
HEADER =
TABLES
LINES = TEXT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
clear hed_text.
Loop at TEXT_LINE.
concatenate hed_text TEXT_LINE-TDLINE into hed_text.
endloop.
Hi,
when we write more than 255 characters in a window it wont display because it can print up to 255 characters. So try to use template in that window and then place text. so that text will be displayed in the next line.
Hope this will give you some idea.
Regards,
Aswini.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
OR
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"
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want a certain number of character i have use that for me:
In global definition:
Z010_LIB type TDLINE
Program Window:
DATA: BEGIN OF it_lines occurs 0,
tdformat TYPE tline-tdformat,
tdline TYPE tline-tdline,
END OF it_lines.
DATA : str_lines like tline.
DATA : Z010_LIB1 type TDLINE.
DATA : Z010_LIB2 type TDLINE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'Z010'
language = SY-LANGU
name = '0050000027000010'
object = 'VBBP'
tables
lines = it_lines.
.
READ TABLE it_lines into str_lines index 1.
Z010_LIB1 = str_lines-tdline+0(132).
READ TABLE it_lines into str_lines index 2.
Z010_LIB2 = str_lines-tdline+0(132).
Concatenate Z010_LIB1 Z010_LIB2 into Z010_LIB
separated by ''.
I take just the 2 line ( index 1 and 2).
If you want take all the text, use Include Text.
If you take read_text solution : use that too (if the text not exist )
select * from STXH into STXH
where TDOBJECT = 'VBBP'
and TDNAME = '0070000007000010'.
Endselect.
if stxh-tdname = ''.
ELSE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'Z010'
language = SY-LANGU
name = '0050000027000010'
object = 'VBBP'
tables
lines = it_lines.
.
READ TABLE it_lines into str_lines index 1.
Z010_LIB1 = str_lines-tdline+0(132).
READ TABLE it_lines into str_lines index 2.
Z010_LIB2 = str_lines-tdline+0(132).
Concatenate Z010_LIB1 Z010_LIB2 into Z010_LIB
separated by ''.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The length of the header text window in smart form may be less than 256.Thats why you are unable to print all the text. Check the length of the window once.
If that is the case, put a condition and check for length less than 256 then append text and remaining text will be appended to next line.In this way you can print all text.
Thanks,
Phani Diwakar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
instead u create text in smartforms and in that text --> General aatributes, select Include text and provide text name, text id, object and language the same way u are providing in 'read_text', it will fetch the complete text maintained and display.
u can also give dynamic text name like &variable name&.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
its better u use include text. there u pass the object name id and language.
check no error if no text exist.
this ll be helpful,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.