Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Radio Buttons on Selection Screen

Hi,

I have four radio buttons on selection screen in a frame, all belonging to the same group.

When the program is called using transaction 1, first two radio buttons are displayed. When the program is called using transaction 2, bottom two radio must be displayed.

I am doing this using the following code.

The problem is : When last two are displayed, there is empty space left on the top and first two are displayed there is empty space left in the bottom of the frame. How can this be taken care of such there are no empty spaces in the box frame?

Code:

  • Radio Buttons for Table Name

SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-005.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : p_ot RADIOBUTTON GROUP grp1 MODIF ID one.

SELECTION-SCREEN COMMENT 5(31) text-001 FOR FIELD p_ot.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : p_exp RADIOBUTTON GROUP grp1 MODIF ID one.

SELECTION-SCREEN COMMENT 5(31) text-002 FOR FIELD p_exp.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : p_cost RADIOBUTTON GROUP grp1 MODIF ID two.

SELECTION-SCREEN COMMENT 5(31) text-003 FOR FIELD p_cost.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : p_att RADIOBUTTON GROUP grp1 MODIF ID two.

SELECTION-SCREEN COMMENT 5(31) text-004 FOR FIELD p_att.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK bl1.

----


  • Initialization

----


INITIALIZATION.

  • Display Table Names depending on transaction calling the program

PERFORM display_table_names.

FORM display_table_names.

DATA : l_mod_id(3) TYPE c.

IF sy-tcode EQ 'ZVTEST1'.

l_mod_id = 'ONE'.

ELSEIF sy-tcode EQ 'ZVTEST2'.

l_mod_id = 'TWO'.

ENDIF.

LOOP AT SCREEN.

IF screen-group1 EQ l_mod_id.

screen-invisible = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDFORM. " display_table_names

Tags:
Former Member
replied

Better still just extend each of your SELECTION-SCREEN COMMENT commands with the MODIF ID addition like this:

SELECTION-SCREEN COMMENT 5(31) TEXT-001 FOR FIELD P_OT MODIF ID ONE.

This way both your radio button and comment will become hidden together.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question