Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to put a textarea inside a subscreen tab ?

fergomes
Explorer
0 Kudos

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.


3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos

Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!

Sandra_Rossi
Active Contributor
0 Kudos

A GUI Control can be displayed only inside a Custom Container (i.e. inside a normal screen, not a Selection Screen), or in a Docking Container, or any other type of GUI Container.

As you want to do a "complex" layout, I advise to use a normal screen, not a selection screen.

If you still want to use a selection screen:

  • For a Custom Container, create a dynpro of type subscreen, containing an area for custom container, and include this dynpro in your subscreen.
  • For a Docking Container, it will start from the bottom of the screen only (or any other side of the screen), you don't need a dynpro, but calculating the height of the Container is very challenging because it will depend on the user's window and screen resolution, so I would recommend to not bother and display the text area at the bottom.

Note that you can also include a selection screen inside a normal screen.

0 Kudos

Thx. Bro,