Application Development and Automation 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: 
Read only

Table control using container

Former Member
0 Likes
1,431

I have 3 blocks in my selection screen. I need to add a table control in my third block which contains the cols MATNR CHARG DELIV DATE QUANTITY

How to implement this. Can this be done using container & custom control?

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_vorna TYPE pa0002-vorna,
            p_bednr TYPE ekpo-bednr,
            p_vstel TYPE ekpv-vstel,
            p_notes TYPE pa0002-cname.
SELECTION-SCREEN COMMENT 79(20) text-004.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_ekorg TYPE ekko-ekorg,
            p_ekgrp TYPE ekko-ekgrp,
            p_bukrs TYPE ekko-bukrs.
SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
               <b>Need table control in here.</b>
SELECTION-SCREEN END OF BLOCK b3.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,035

You can not do this within a selection screen, but you can go the other way around. You can embed a selection screen in your dynpro(screen) which can contain a table control or an ALV grid within a container. Here is how you can embed a selection screen into a subscreen within the dynpro.

report zrich_0006 .

tables: mara.

* Custom Selection Screen 1010
selection-screen begin of screen 1010 as subscreen.
selection-screen begin of block b1 with frame title text-001.
parameters: p_rad1 radiobutton group grp1 default 'X',
            p_rad2 radiobutton group grp1,
            p_rad3 radiobutton group grp1.
select-options: s_matnr for  mara-matnr,
                s_matkl for  mara-matkl,
                s_mtart for  mara-mtart.
selection-screen end of block b1.
selection-screen end of screen 1010.


start-of-selection.

  call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
module status_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

endmodule.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
module user_command_0100 input.

endmodule.


* Screen screen 100 with a subscreen area called "subscreen_1010"
* Screen Flow Logic follows

process before output.

  module status_0100.

  call subscreen subscreen_1010 including sy-repid '1010'.

process after input.

  call subscreen subscreen_1010 .

  module user_command_0100.

Regards,

Rich Heilman

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,036

You can not do this within a selection screen, but you can go the other way around. You can embed a selection screen in your dynpro(screen) which can contain a table control or an ALV grid within a container. Here is how you can embed a selection screen into a subscreen within the dynpro.

report zrich_0006 .

tables: mara.

* Custom Selection Screen 1010
selection-screen begin of screen 1010 as subscreen.
selection-screen begin of block b1 with frame title text-001.
parameters: p_rad1 radiobutton group grp1 default 'X',
            p_rad2 radiobutton group grp1,
            p_rad3 radiobutton group grp1.
select-options: s_matnr for  mara-matnr,
                s_matkl for  mara-matkl,
                s_mtart for  mara-mtart.
selection-screen end of block b1.
selection-screen end of screen 1010.


start-of-selection.

  call screen 100.
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
module status_0100 output.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

endmodule.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
module user_command_0100 input.

endmodule.


* Screen screen 100 with a subscreen area called "subscreen_1010"
* Screen Flow Logic follows

process before output.

  module status_0100.

  call subscreen subscreen_1010 including sy-repid '1010'.

process after input.

  call subscreen subscreen_1010 .

  module user_command_0100.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,035

So in my case .. I would have to create 3 subscreens in the screen painter subscreen_1010 subscreen_1020 & subscreen_1030 and in the third one embed a table control? and then in the flow call them all

CALL subscreen subscreen_1010 including sy-repid '1010'.

CALL subscreen subscreen_1020 including sy-repid '1010'. and so on ?

Read only

0 Likes
1,035

No need for three, just one. The one subscreen will hold the two blocks of your selection screen. Then under this subscreen in your dynpro, you will create your "3rd block" by using the appropriate UI element in screen painter and then putting a table control inside it. So just use one subscreen for your selection-screen(blocks 1 and 2).

Regards,

RIch Heilman

Read only

Former Member
0 Likes
1,035

How do I create the 3rd block in screen painter. Also what should I set the PF-STATUS as so I get the BACK, EXIT buttons. Thank you

Read only

0 Likes
1,035

Go to screen painter and choose the UI element for box. It is the six one from the button in the section to the left. Create it and then double click on it, then you can give some text which will be embeded into the frame.

And for pf-status, all you need to do is use the SET PF-STATUS statement in the STATUS_0100 module. Double click the statement to create the gui status.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
1,035

Rich, Thank you. I was able to figure this out. I just need to add a title to the screen now and I will look around on how to do that. Thanks once again.

Read only

0 Likes
1,035

You can add a title simply by putting a statement in the STATUS_100 module after the SET PF-STATUS statement.

  set pf-status '0100'.
  set titlebar '0100'.          "<--- Like this.

Double click on the '0100' in this statement to create the title. Save and activate all.

Regards,

RIch Heilman