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

radiobutton

Former Member
0 Likes
1,149

Hi abapers,

Iam using 3 radio button.

If i click one of the radionbutton it should display one block with contains 3 fields in it, Otherwise it should be hidden.

I am able to hide the fields but i dont know how to hide the block.

Please help immediately

Thanks,

Regards

Naga M

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,130

hi Nagaraj,

Just use the same MODIF id for the entire block and LOOP at Screen and hide it.

it will work

try this simple one..

tables : vbap.

data : vbap_wa like vbap.

PARAMETERS : CHECK radiobutton group rd1 user-command chk ,

check_1 radiobutton group rd1 .

select-options : s_vbeln for vbap-vbeln MODIF ID B .

at selection-screen output.

LOOP AT SCREEN.

IF CHECK NE 'X' AND SCREEN-GROUP1 = 'B'.

SCREEN-ACTIVE = '0'.

ENDIF.

modify screen.

ENDLOOP.

this one displays if chec_1 is clicked..

reward points if helpful

13 REPLIES 13
Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,130

U GIVE ALL THE FIELDS IN ONE BLOCK TO MODIF-ID.

ex:

SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE

text-013.

SELECT-OPTIONS: s_werks FOR vbap-werks NO-EXTENSION NO INTERVALS OBLIGATORY MODIF-ID grp. "plant

SELECT-OPTIONS: s_matnr FOR vbap-matnr NO-EXTENSION NO INTERVALS OBLIGATORY MDIF-ID grp. "material number

SELECTION-SCREEN END OF BLOCK blk.

loop at screen.

if screen-group1 = grp.

screen-invisible = 1

modify screen.

endloop.

Read only

Former Member
0 Likes
1,131

hi Nagaraj,

Just use the same MODIF id for the entire block and LOOP at Screen and hide it.

it will work

try this simple one..

tables : vbap.

data : vbap_wa like vbap.

PARAMETERS : CHECK radiobutton group rd1 user-command chk ,

check_1 radiobutton group rd1 .

select-options : s_vbeln for vbap-vbeln MODIF ID B .

at selection-screen output.

LOOP AT SCREEN.

IF CHECK NE 'X' AND SCREEN-GROUP1 = 'B'.

SCREEN-ACTIVE = '0'.

ENDIF.

modify screen.

ENDLOOP.

this one displays if chec_1 is clicked..

reward points if helpful

Read only

0 Likes
1,130

Hi Satesh,

Thanks for your help .

I am able to hide the fields but the frame is not hidden . How to hide that also?

Regards

Naga.

Read only

0 Likes
1,130

See my previous post.It works.

Read only

0 Likes
1,130

Hi nagaranjan

It is hiding for me.

regards

Read only

0 Likes
1,130

Use this if you need checkbox.

PARAMETERS : show AS CHECKBOX USER-COMMAND flag.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p1(10) TYPE c,
            p2(10) TYPE c,
            p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: p4(10) TYPE c MODIF ID bl2,
            p5(10) TYPE c MODIF ID bl2,
            p6(10) TYPE c MODIF ID bl2.
SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF show <> 'X' AND
       screen-group1 = 'BL2'.
      screen-active = '0'.
    ELSEIF show = 'X' AND
       screen-group1 = 'BL2'.
       screen-active = '1'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Read only

0 Likes
1,130

Hi wen,

I have used begin of line and end of line for each paramteter .

For ex see below .,

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(30) text-006 FOR FIELD insme.

PARAMETERS: insme AS CHECKBOX MODIF ID BOM.

SELECTION-SCREEN END OF LINE.

selection-screen end of block.

So the block is visible but only the field is hidden

Thankx,

Regards

Naga

Read only

0 Likes
1,130

This works...

PARAMETERS : "show AS CHECKBOX USER-COMMAND flag.
                     R1 RADIOBUTTON GROUP show USER-COMMAND flag,
             		R2 RADIOBUTTON GROUP show.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p1(10) TYPE c,
            p2(10) TYPE c,
            p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
SELECTION-SCREEN BEGIN OF LINE.
<b>SELECTION-SCREEN COMMENT 1(30) text-006 FOR FIELD insme MODIF ID bl2.</b>
PARAMETERS: insme AS CHECKBOX MODIF ID bl2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF r2 <> 'X' AND
       screen-group1 = 'BL2'.
      screen-active = '0'.
    ELSEIF r2 = 'X' AND
       screen-group1 = 'BL2'.
       screen-active = '1'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Message was edited by: Wenceslaus G

Read only

0 Likes
1,130

HI

The comment should be outside the line. then it works

or include modif id for the comment.

Message was edited by: Harikishore Sreenivasulu

Read only

Former Member
0 Likes
1,130

HI

here is the code

  • PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.

PARAMETERS show_all radiobutton group g1 USER-COMMAND flag.

PARAMETERS no_show radiobutton group g1.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: p1(10) TYPE c,

p2(10) TYPE c,

p3(10) TYPE c.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: p4(10) TYPE c MODIF ID bl2,

p5(10) TYPE c MODIF ID bl2,

p6(10) TYPE c MODIF ID bl2.

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF show_all <> 'X' AND

screen-group1 = 'BL2'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

rewards if helpful

Message was edited by: Harikishore Sreenivasulu

Read only

Former Member
0 Likes
1,130

Use the same modif id for all the elements in the block.

Read only

Former Member
0 Likes
1,130

Choose the radio button and then Execute( F8 ) to see changes.

PARAMETERS : "show_all AS CHECKBOX USER-COMMAND flag.
                     R1 RADIOBUTTON GROUP show USER-COMMAND flag,
             		R2 RADIOBUTTON GROUP show.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p1(10) TYPE c,
            p2(10) TYPE c,
            p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: p4(10) TYPE c MODIF ID bl2,
            p5(10) TYPE c MODIF ID bl2,
            p6(10) TYPE c MODIF ID bl2.
SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF R2 <> 'X' AND
       screen-group1 = 'BL2'.
      screen-active = '0'.
    ELSEIF R2 = 'X' AND
       screen-group1 = 'BL2'.
       screen-active = '1'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Read only

Former Member
0 Likes
1,130

see if this one works..

PARAMETERS: insme1 AS CHECKBOX user-command flag.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME." modif id bl2.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(30) text-006 FOR FIELD insme modif id BOM.

PARAMETERS: insme AS CHECKBOX MODIF ID BOM.

SELECTION-SCREEN END OF LINE.

selection-screen end of block b2.

at selection-screen output.

loop at screen.

if insme1 eq 'X' and screen-group1 = 'BOM'.

screen-active = '0'.

  • screen-invisible = '1'.

endif.

modify screen.

endloop.