06-28-2008 11:05 AM
Daer all,
i have created one container,
on double click on material i have printing Material long text in container.
but the problem is that, suppose i have 2 material, i have double click on first material then material description printed correctly,
but when i double click on second material container data(previous description of material) not removed,
so, i want to clear the container text.
here i m pasted code:
CREATE OBJECT G_EDITOR_CONTAINERSET
EXPORTING
CONTAINER_NAME = 'RISKED'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc NE 0.
add your handling
ENDIF.
IF sy-subrc NE 0.
add your handling
ENDIF.
L_WORDRAP_POSITION = L_WORDRAP_POSITION - 1.
CREATE OBJECT G_EDITORSET
EXPORTING
PARENT = G_EDITOR_CONTAINERSET
WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
WORDWRAP_POSITION = 60 "LINE_LENGTH "L_WORDRAP_POSITION
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
add your handling
ENDIF.
CALL METHOD G_editorSET->set_toolbar_mode
EXPORTING
toolbar_mode = 0
.
CALL METHOD G_editorSET->set_statusbar_mode
EXPORTING
statusbar_mode = 0.
CALL METHOD g_editorSET->SET_TEXT_AS_R3TABLE
EXPORTING
TABLE = I_SETL "g_mytable
EXCEPTIONS
ERROR_DP = 1
ERROR_DP_CREATE = 2
others = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
06-28-2008 1:19 PM
refresh internal table I_SETL before calling the method SET_TEXT_AS_R3TABLE
REFRESH I_SETL.
CALL METHOD g_editor->SET_TEXT_AS_R3TABLE
EXPORTING
TABLE = I_SETL "g_mytable
EXCEPTIONS
ERROR_DP = 1
ERROR_DP_CREATE = 2
others = 3.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
You can also destroy the text editor using the method
CALL METHOD g_editor->free.
06-28-2008 1:51 PM
Check out this code:
*&---------------------------------------------------------------------*
*& Report ZTEST11
*&
*&---------------------------------------------------------------------*
REPORT ztest11.
DATA: container TYPE REF TO cl_gui_custom_container,
textedit TYPE REF TO cl_gui_textedit,
g_text TYPE STANDARD TABLE OF char72 INITIAL SIZE 0,
wa_text TYPE char72,
ok_code TYPE syucomm.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_100'.
SET TITLEBAR 'TITLE_100'.
IF container IS INITIAL.
CREATE OBJECT:
container
EXPORTING container_name = 'CONT',
textedit
EXPORTING parent = container.
ENDIF.
textedit->set_readonly_mode( 1 ).
textedit->set_toolbar_mode( 0 ).
textedit->set_font_fixed( 1 ).
textedit->set_text_as_r3table( table = g_text ).
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'BACK'.
SET SCREEN 00.
LEAVE SCREEN.
WHEN 'BUT1'. " button 1
REFRESH g_text.
wa_text = 'Button 1 pressed'.
APPEND wa_text TO g_text.
WHEN 'BUT2'. " button 2
REFRESH g_text.
wa_text = 'Button 2 pressed'.
APPEND wa_text TO g_text.
WHEN OTHERS.
EXIT.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT