Skip to Content
0
Jun 10, 2022 at 02:03 AM

how to put a textarea inside a subscreen tab ?

177 Views

I need to create a canvas with some tabs and inside the second tab I need to put 5 texteareas, how can I do that?

This is my abap code:

*&---------------------------------------------------------------------*
*& Include
*&---------------------------------------------------------------------*
*------------------------------------------------------
SELECTION-SCREEN BEGIN OF TABBED BLOCK t1 FOR 10 LINES.

*------------------------------------------------------------------------
SELECTION-SCREEN TAB (79) tab1 USER-COMMAND tab1 DEFAULT SCREEN 101.
SELECTION-SCREEN TAB (79) tab2 USER-COMMAND tab2 DEFAULT SCREEN 102.
SELECTION-SCREEN TAB (79) tab3 USER-COMMAND tab3 DEFAULT SCREEN 103.
SELECTION-SCREEN TAB (79) tab4 USER-COMMAND tab4 DEFAULT SCREEN 104.

SELECTION-SCREEN END OF BLOCK t1.

DATA: container TYPE REF TO cl_gui_docking_container,
container2 TYPE REF TO cl_gui_docking_container,
splitter TYPE REF TO cl_gui_splitter_container,
splitter2 TYPE REF TO cl_gui_splitter_container,
dock_sub_cont1 TYPE REF TO cl_gui_container,
dock_sub_cont12 TYPE REF TO cl_gui_container,
editor TYPE REF TO cl_gui_textedit,
editor2 TYPE REF TO cl_gui_textedit,
report2 TYPE syrepid,
report TYPE syrepid.

DATA:tlines TYPE TABLE OF tdline,
tlines2 TYPE TABLE OF tdline,
wa_tlines TYPE tdline,
wa_tlines2 TYPE tdline.

*-----------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN NESTING LEVEL 2.

PARAMETERS: p_descbe TYPE char100 MODIF ID des.
PARAMETERS: p_ri TYPE char10.
PARAMETERS: p_cc TYPE csks-kostl,
p_und TYPE char10,
p_codd TYPE char10,
p_dt_aq TYPE dats,
p_dt TYPE dats,
p_val_aq TYPE p,
p_val_me TYPE p,
p_val_re TYPE p,
p_vur TYPE numc2.

SELECTION-SCREEN END OF SCREEN 101.

* Subscreen 102.
*-----------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.
PARAMETERS: p_dummy2 TYPE c LENGTH 1000 VISIBLE LENGTH 150."

SPLIT 'TEST1' AT cl_abap_char_utilities=>cr_lf INTO TABLE tlines.

report = sy-repid.

IF container IS INITIAL.

CREATE OBJECT container
EXPORTING
repid = report
ratio = 40
dynnr = sy-dynnr
side = container->dock_at_bottom
extension = 300.

CREATE OBJECT splitter
EXPORTING
parent = container
rows = 2
columns = 1.

CALL METHOD splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = dock_sub_cont1.

splitter->set_height(
EXPORTING
height = 50 " Current Height of Control
* EXCEPTIONS
* cntl_error = 1 " cntl_error
* others = 2
).
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

splitter->set_width(
EXPORTING
width = 150 " Current Width of Control
* EXCEPTIONS
* cntl_error = 1 " cntl_error
* others = 2
).
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

CREATE OBJECT editor
EXPORTING
parent = dock_sub_cont1.

ENDIF.
CALL METHOD editor->set_text_as_r3table
EXPORTING
table = tlines
EXCEPTIONS
OTHERS = 1.

CALL METHOD editor->go_to_line( 1 ).

SELECTION-SCREEN END OF SCREEN 102.

* Subscreen 103.
*-----------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN.
PARAMETERS: p_dummy3 RADIOBUTTON GROUP rb01,
p_dummy4 RADIOBUTTON GROUP rb01.
SELECTION-SCREEN END OF SCREEN 103.

* Subscreen 104.
*-----------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 104 AS SUBSCREEN.
PARAMETERS: p_dummy5 RADIOBUTTON GROUP rb02,
p_dummy6 RADIOBUTTON GROUP rb02.
SELECTION-SCREEN END OF SCREEN 104.

INITIALIZATION.
tab1 = 'text1'.
tab2 = 'text2'.
tab3 = 'text3'.
tab4 = 'text3'.
*----------------------------------------------------------------

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name EQ 'TAB2'.

ENDIF.
ENDLOOP.

AT SELECTION-SCREEN.
IF sy-ucomm = 'TAB2'.
ENDIF.


image.png

Attachments

image.png (32.9 kB)