on 10-17-2008 11:42 AM
Hi,
I am creating a purchase order ....i want to capture Header and
Item text in PO. For that iam using read_text...but the problem
is length of the text in FM : Read_text is of just 132 Characters....if my user enters more than this how to capture those text and print it in PO ?
Hi,
TDLINE is in the structure, so it is like internal table , it fecth all the data, After fetching data, You have to loop and Concatenate to another varaible.
data:V_text type char***
call function 'READ_TEXT'
exporting
CLIENT = SY-MANDT
id = id
language = sy-langu
name = tname
object = object
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
tables
lines = it_item_text_dtl
exceptions
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
others = 8
.
if sy-subrc eq 0.
loop at it_item_text_dtl into fs_item_text.
Concatenate v_text fs_item_text-tdline into v_text.
endloop.
endif.
Regards
Jana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
yes it will retrieve total data, Just now i have tested
see example
data:v_lines type standard table of TLINE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
id = '0001'
language = sy-langu
name = '0000000172'
object = 'VBBK'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
tables
lines = v_lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
V_lines contain more than one lines, if you have data particular text node.
Regards
jana
both in sapscript and in smartform you can use the include statement for text.
the text is stored in a table so if you have more then 132 characters you have more lines. when you use the include then SAP will automatically size the output to the length of the given output-line. when there is more text then can be captured in one output-line you will have more output-lines occupied automatically.
Regards,
Guido
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the SAPScript at the text element where you want the text to print, go Insert -> Text -> Standard and fill in the values for text name, id, and language (same values you would use for the READ_TEXT FM).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you just want to print the text why are you reading it?
You can invoke it with an INCLUDE without reading it first.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
*declare v_name1 as char70 and loop this one for it_tline into *wa_tline.
*suppose u want long text in main window, then create a loop in *the cell of main window
and proceed as below.
then creat a text and give &wa_TLINE-TDLINE&
clear it_Tline.
concatenate wa_OUT-ebeln wa_OUT-ebelp into v_name1.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'F01'
LANGUAGE = sy-langu
NAME = v_name1
OBJECT = 'EKPO'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
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 SY-SUBRC = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
this was for smartforms.
if u r using sapscript,then u need to loop ur it_tline itab.
data : v_name1(70),
v_info4(50).
data :IT_TLINE4 LIKE TLINE OCCURS 0 WITH HEADER LINE.
loop at it_out into wa_out. " your final itab
concatenate it_OUT-ebeln it_OUT-ebelp into v_name1.
it_head-tdobject = 'EKPO'.
it_head-tdid = 'F01'.
it_head-tdspras = SY-LANGU.
IT_HEAD-TDNAME = V_NAME1.
APPEND IT_HEAD.
CALL FUNCTION 'TEXT_READ'
EXPORTING
I_HEADER = IT_HEAD
I_READONLY = 'X'
TABLES
T_LINES = IT_TLINE
EXCEPTIONS
NOTEDITED = 1
NOTFOUND = 2
ID = 3
OBJECT = 4
NAME = 5
LANGUAGE = 6
OTHERS = 7.
IF SY-SUBRC = 0.
read table it_tline. "#EC *
v_info4 = it_tline-tdline.
ENDIF.
endloop.
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.