Ver Mensaje Individual
  #6  
Viejo 13/06/06, 21:14:56
Mauricio Hidalgo Mauricio Hidalgo is offline
Senior Member
 
Fecha de Ingreso: may 2006
Localización: Santiago, Chile
Mensajes: 481
Hola puedes ocupar el custom-control del screen painter y tratarlo mediante una clase llamada data CL_GUI_TEXTEDIT:

se declara como
data otxtarea_cabecera TYPE REF TO CL_GUI_TEXTEDIT.

se instancia de la forma siguiente

CREATE OBJECT custom_area_cabecera
EXPORTING
container_name = 'TXTAREA_CABECERA'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.


CREATE OBJECT otxtArea_Cabecera
EXPORTING parent = custom_area_cabecera.


donde TXTAREA_CABECERA es el nombre que se le dio al custom control en la dynpro.

Lo siguiente es que veas los metodos disponibles para la clase, aquí te agregó los que he ocupado.

para eliminar texto existente:
if not otxtarea_Cabecera is initial.
call method otxtArea_Cabecera->DELETE_TEXT.
endif.

para leer el contenido:
call method otxtArea_Cabecera->GET_TEXT_AS_STREAM
importing
TEXT = i_texttable
exceptions
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2.

CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
tables
text_stream = i_texttable
ITF_TEXT = t_txtcabecera.

para pasarle al control el contenido de una tabla interna:

call method otxtArea_cabecera->SET_TEXT_AS_STREAM
exporting
TEXT = i_texttable
exceptions
ERROR_DP = 1.



donde i_texttable

TYPES:
BEGIN OF t_texttable,
line(120) type c,
END OF t_texttable.

DATA i_texttable TYPE TABLE OF t_texttable.
data: t_txtcabecera like tline occurs 0 with header line.

esta otra función es la inversa de *stream_to_itf*

call function 'CONVERT_ITF_TO_STREAM_TEXT'
tables
ITF_TEXT = t_line
TEXT_STREAM = i_texttable.


espero haberte dado luces.

te adjunto como se ve el text edit.

Saludos
Imágenes Adjuntas
Tipo de Archivo: jpg Dibujo.JPG (26.0 KB, 575 visitas)
Responder Con Cita