‎2007 Sep 28 11:09 AM
I have declared
gt_itm_texts in Global Data.
and i have wrrite Routine in Form Routines
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'BEST'
language = 'E'
name = ls_text-tdname
object = 'MATERIAL'
archive_handle = 0
TABLES
lines = lt_texts
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
CLEAR : ls_text,ls_text-tdname.
LOOP AT lt_texts INTO ls_text.
APPEND ls_text TO gt_itm_texts.
ENDLOOP.it gives an error gt_itm_texts not declared ...
what can be the solution for this where i have declared it in Global Data.
‎2007 Sep 28 11:13 AM
Abhishek,
does gt_itm_texts refer to THEAD? If not, change it accordingly to refer to THEAD.
‎2007 Sep 28 11:15 AM
Hi,
try like this..
perform read_text using gt_itm_texts .
Regards,
Nagaraj
‎2007 Sep 28 11:20 AM
‎2007 Sep 28 11:23 AM
Hi
try like this
perform read_text using ls_text,ls_text-tdname
changing gt_itm_texts .
Regards,
Nagaraj
‎2007 Sep 28 11:31 AM
*&---------------------------------------------------------------------*
*& Form f_read_text
*&---------------------------------------------------------------------*
FORM f_read_text USING p_id p_name p_object
changing c_txt type ty_text.
DATA : lt_texts TYPE TABLE OF ty_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = p_id
language = 'E'
name = p_name
object = p_object
TABLES
lines = lt_texts
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT lt_texts INTO ls_text.
APPEND ls_text TO c_txt.
ENDLOOP.
ENDFORM. "f_read_texti have used the above code but still giving error...
‎2007 Sep 28 2:25 PM
‎2007 Sep 28 3:41 PM
Change your form interface as follows and change the corresponding perform accordingly.
FORM f_read_text <b>TABLES</b> c_txt type ty_text USING p_id p_name p_object.
‎2007 Oct 01 9:17 AM
I have used but it throws error
<b>@8O@ Global Definitions "C_TXT" is not an internal table - the "OCCURS n" specification is missing.</b>
*&---------------------------------------------------------------------*
*& Form f_read_text
*&---------------------------------------------------------------------*
FORM f_read_text USING p_id p_name p_object CHANGING c_flg
TABLES c_txt TYPE ty_text.
DATA : lt_texts TYPE TABLE OF ty_text,
ls_text TYPE ty_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = p_id
language = 'E'
name = p_name
object = p_object
TABLES
lines = lt_texts
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT lt_texts INTO ls_text.
APPEND ls_text TO c_txt.
c_flg = 'X' .
ENDLOOP.
ENDFORM. "f_read_text
‎2007 Oct 01 9:19 AM
I have used but it throws error
<b>@8O@ Global Definitions "C_TXT" is not an internal table - the "OCCURS n" specification is missing.</b>
*&---------------------------------------------------------------------*
*& Form f_read_text
*&---------------------------------------------------------------------*
FORM f_read_text USING p_id p_name p_object CHANGING c_flg
TABLES c_txt TYPE ty_text.
DATA : lt_texts TYPE TABLE OF ty_text,
ls_text TYPE ty_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = p_id
language = 'E'
name = p_name
object = p_object
TABLES
lines = lt_texts
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
LOOP AT lt_texts INTO ls_text.
APPEND ls_text TO c_txt.
c_flg = 'X' .
ENDLOOP.
ENDFORM. "f_read_text
‎2007 Oct 01 3:06 PM
What is the definition of your "ty_text"? If it is not defined as table type, you can use TABLES c_txt TYPE ty_text OCCURS 0, or you can leave it untyped "TABLES c_txt".
TABLES is now obsolete, you can use USING, and CHANGING to achieve the same.
‎2007 Sep 28 11:33 AM
hi
good
go through this code
The following code is a function that will return a customer comment.
form get_comment using cur_kunnr.
call function 'READ_TEXT'
exporting
id = '0002'
language = sy-langu
object = 'KNA1'
name = cur_kunnr
importing
header = thead
tables
lines = tlinetab
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.
loop at tlinetab.
write / tlinetab-tdline.
add 1 to line_cnt.
endloop.
endif.
endform.
The above subroutine is called with the following code:
if p_cmnt = 'X'.
tdname = cur_cust-kunnr.
perform get_comment using tdname.
endif.
These data elements are defined as:
data: begin of tlinetab occurs 100. "table to process comments
include structure tline.
data: end of tlinetab.
data: tdname like thead-tdname.
reward point if helpful.
thanks
mrutyun^
‎2007 Oct 01 10:18 AM
TABLES: mara.
DATA: g_name LIKE thead-tdname.
DATA: g_tline LIKE tline OCCURS 0 .
PARAMETERS: p_matnr LIKE mara-matnr.
CLEAR: g_name.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = p_matnr
IMPORTING
output = g_name
EXCEPTIONS
length_error = 1
OTHERS = 2.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = 'BEST'
language = 'D'
name = g_name
object = 'MATERIAL'
* ARCHIVE_HANDLE = 0
* IMPORTING
* HEADER =
TABLES
lines = g_tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8
.
you see the long text in IntTab: g_tline