728x90
반응형
Create long text
DATA : BEGIN OF GS_SCREEN_0101,
CC_T01_0101 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
EDIT01_0101 TYPE REF TO CL_GUI_TEXTEDIT,
END OF GS_SCREEN_0101.
PERFORM CREATE_TEXT_AREA USING GS_SCREEN_0101-CC_T01_0101
'CC_1T01'
GS_SCREEN_0101-EDIT01_0101
GS_WA-FIELD1.
data element type : CHAR, LCHR
FORM create_text_area USING po_container
TYPE REF TO cl_gui_custom_container
pv_name TYPE char7
po_editor TYPE REF TO cl_gui_textedit
pv_value TYPE char1024.
DATA lt_text LIKE ldbpsjtab1024-tabname1024 OCCURS 0
WITH HEADER LINE.
* Check ininialization
IF po_container IS INITIAL.
po_container =
NEW cl_gui_custom_container( container_name = pv_name ).
po_editor = NEW cl_gui_textedit( parent = po_container ).
CLEAR:lt_text,lt_text[].
lt_text = pv_value.
APPEND lt_text.
* Update text area by 'LT_TEXT'
CALL METHOD po_editor->set_text_as_stream
EXPORTING
text = lt_text[]
EXCEPTIONS
error_dp = 1
error_dp_create = 2
OTHERS = 3.
IF sy-subrc > 0.
MESSAGE ID sy-msgid TYPE gc_s NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
DISPLAY LIKE gc_e.
EXIT.
ENDIF.
ENDIF.
CHECK p_displ EQ gc_x.
PERFORM set_readonly_mode USING po_editor.
ENDFORM.
REFRESH시 set_text_as_stream 메소드 재호출해서 사용
TEXT EDITOR 값 가져오려면 get_text_as_stream 메소드 사용
조회 모드
FORM set_readonly_mode USING po_editor TYPE REF TO cl_gui_textedit.
CALL METHOD po_editor->set_readonly_mode
EXPORTING
readonly_mode = 1 "0-OK else-NO
EXCEPTIONS
error_cntl_call_method = 1
invalid_parameter = 2
OTHERS = 3.
IF sy-subrc > 0.
MESSAGE ID sy-msgid TYPE gc_s NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
DISPLAY LIKE gc_e.
EXIT.
ENDIF.
ENDFORM.
728x90
반응형
'ABAP' 카테고리의 다른 글
[Smartform] 금액 수량 단위 필드 (0) | 2023.03.02 |
---|---|
[Smartform] Preview, PDF 기능 (0) | 2023.03.02 |
[ALV] ALV + Hotspot Event (0) | 2023.03.02 |
[SD] Sales Order Update/Delete BAPI (0) | 2023.03.01 |
Pop-up Message (POPUP_TO_CONFIRM) (0) | 2023.03.01 |
댓글