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: 

Radio button processing in selection screen

Former Member
0 Kudos
150

Hai all.

I have two radio buttons i.e P0(copy) & P1(delete) on selection screen. if i click on copy it shoud display the copy related selection screen. if click delete it should display delete relate selection screen,. default is delete

related selection-screen. Now i am getting the above selection screen, but by default it is displaying all fileds on the selection-screen but iwant to display only the delete related selection-screen(P_VERDEL).Here i am copying the code. Please give me some idea.

SELECTION-SCREEN BEGIN OF BLOCK rad1 WITH FRAME TITLE text-003 .

selection-screen begin of line.

SELECTION-SCREEN POSITION 11.

SELECTION-SCREEN COMMENT 1(12) text-004 modif id mg1.

parameters p_verfr like zrepl_gps-ZVERSIONFROM modif id mg1.

SELECTION-SCREEN POSITION 41 .

SELECTION-SCREEN COMMENT 35(16) text-005 modif id mg1.

parameters p_verto like zrepl_gps-ZVERSIONTO modif id mg1.

selection-screen end of line.

selection-screen skip 1.

selection-screen begin of line.

SELECTION-SCREEN POSITION 11.

SELECTION-SCREEN COMMENT 1(22) text-008 modif id mg2.

Parameters : p_verdel(10) type c modif id mg2.

selection-screen end of line.

selection-screen skip 4.

selection-screen begin of line.

SELECTION-SCREEN POSITION 11.

SELECTION-SCREEN COMMENT 1(10) text-001.

PARAMETERS : P0 RADIOBUTTON GROUP RADI user-command ABCD.

SELECTION-SCREEN POSITION 41.

SELECTION-SCREEN COMMENT 35(16) text-002.

PARAMETERS P1 RADIOBUTTON GROUP RADI default 'X'.

selection-screen end of line.

selection-screen skip 1.

parameters : c2 as checkbox.

SELECTION-SCREEN end OF BLOCK rad1.

data: v_chk.

at selection-screen.

if sy-ucomm = 'ABCD'.

v_chk = 'X'.

endif.

***********************************************************************************

AT SELECTION-SCREEN OUTPUT.

if v_chk = 'X'.

loop at screen.

IF P0 = 'X'.

if SCREEN-GROUP1 = 'MG2'.

screen-input = 0.

screen-active = 0.

ENDIF.

elseif P1 = 'X'.

if SCREEN-GROUP1 = 'MG1'.

screen-input = 0.

screen-active = 0.

ENDIF.

endif.

modify screen.

endloop.

ENDIF.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
114
at selection-screen.--->problem is here ? check ur code 
if sy-ucomm = 'ABCD'.
v_chk = 'X'.
endif.
10 REPLIES 10

Former Member
0 Kudos
115
at selection-screen.--->problem is here ? check ur code 
if sy-ucomm = 'ABCD'.
v_chk = 'X'.
endif.

0 Kudos
114

Hi Prabhu

can please give the solution.

Thanks in advance.

regards

rams

Former Member
0 Kudos
114

Please check with below code:

SELECTION-SCREEN BEGIN OF BLOCK rad1 WITH FRAME TITLE text-003 .
selection-screen begin of line.
SELECTION-SCREEN POSITION 11.
SELECTION-SCREEN COMMENT 1(12) text-004 modif id mg1.
parameters p_verfr like zrepl_gps-ZVERSIONFROM modif id mg1.
SELECTION-SCREEN POSITION 41 .
SELECTION-SCREEN COMMENT 35(16) text-005 modif id mg1.
parameters p_verto like zrepl_gps-ZVERSIONTO modif id mg1.
selection-screen end of line.
selection-screen skip 1.
selection-screen begin of line.
SELECTION-SCREEN POSITION 11.
SELECTION-SCREEN COMMENT 1(22) text-008 modif id mg2.
Parameters : p_verdel(10) type c modif id mg2.
selection-screen end of line.
selection-screen skip 4.
selection-screen begin of line.
SELECTION-SCREEN POSITION 11.
SELECTION-SCREEN COMMENT 1(10) text-001.

PARAMETERS : P0 RADIOBUTTON GROUP RADI user-command ABCD.
SELECTION-SCREEN POSITION 41.
SELECTION-SCREEN COMMENT 35(16) text-002.
PARAMETERS P1 RADIOBUTTON GROUP RADI default 'X'.
selection-screen end of line.
selection-screen skip 1.
parameters : c2 as checkbox.
SELECTION-SCREEN end OF BLOCK rad1.

data: v_chk.

at selection-screen.
  if sy-ucomm = 'ABCD'.
    v_chk = 'X'.
  endif.
************************************************************************
***********

AT SELECTION-SCREEN OUTPUT.
    loop at screen.
      case p0.
      when 'X'.
         if screen-name cs 'P_VERDEL'.
            screen-active = 0.
         else.
            screen-active = 1.
         endif.
      when others.
         if screen-name cs 'P_VERT' or scren-name cs 'P_VERF'.
            screen-active = 0.
         else.
            screen-active = 1.
         endif.
      endcase.
      modify screen.
    endloop.

Kind Regards

Eswar

Message was edited by: Eswar Rao Boddeti

0 Kudos
114

Thanks for your help.

In this case, paramenter options are disabled but the selection secreen text is showing. But my requirment i don't want to display the selection-screen text also(i.E

Version from and Version to when i select Delete Radio Button).

Please give me some solution.

Thanks i advance.

regards

Rams

Message was edited by: ramesh

0 Kudos
114

Please check by doing the following changes:

SELECTION-SCREEN BEGIN OF BLOCK rad1 WITH FRAME TITLE text-003 .
selection-screen begin of line.
SELECTION-SCREEN POSITION 11.
SELECTION-SCREEN COMMENT 1(12) text-004 modif id mg1.
parameters p_verfr like zrepl_gps-ZVERSIONFROM modif id mg1.
SELECTION-SCREEN POSITION 41 .
SELECTION-SCREEN COMMENT 35(16) text-005 modif id mg1.
parameters p_verto like zrepl_gps-ZVERSIONTO modif id mg1.
selection-screen end of line.
selection-screen skip 1.
selection-screen begin of line.
SELECTION-SCREEN POSITION 11.
SELECTION-SCREEN COMMENT 1(22) text-008 modif id mg2.
Parameters : p_verdel(10) type c modif id mg2.
selection-screen end of line.
selection-screen skip 4.
selection-screen begin of line.
SELECTION-SCREEN POSITION 11.
SELECTION-SCREEN COMMENT 1(10) text-001.

PARAMETERS : P0 RADIOBUTTON GROUP RADI user-command ABCD.
SELECTION-SCREEN POSITION 41.
SELECTION-SCREEN COMMENT 35(16) text-002.
PARAMETERS P1 RADIOBUTTON GROUP RADI default 'X'.
selection-screen end of line.
selection-screen skip 1.
parameters : c2 as checkbox.
SELECTION-SCREEN end OF BLOCK rad1.

data: v_chk.

at selection-screen.
  if sy-ucomm = 'ABCD'.
    v_chk = 'X'.
  endif.
************************************************************************
***********

AT SELECTION-SCREEN OUTPUT.
    loop at screen.
      case p0.
      when 'X'.
         if <b>screen-group1 = 'MG1'</b>. "name cs 'P_VERDEL'.
            screen-active = 0.
         else.
            screen-active = 1.
         endif.
      when others.
         if <b>screen-group1 = 'MG2'</b>. "-name cs 'P_VERT' or scren-name cs 'P_VERF'.
            screen-active = 0.
         else.
            screen-active = 1.
         endif.
      endcase.
      modify screen.
    endloop.

Kind Regards

Eswar

0 Kudos
114

Hi Eswar!

Can you please copy and test this program.

It working ok but only that i want to display delete

as default when we execute the report.

Thanks.

SELECTION-SCREEN BEGIN OF BLOCK rad1 WITH FRAME TITLE text-003.

selection-screen begin of line.

SELECTION-SCREEN POSITION 11.

SELECTION-SCREEN COMMENT 1(12) text-004 modif id mg1.

parameters p_verfr(10) type c modif id mg1.

SELECTION-SCREEN POSITION 41.

SELECTION-SCREEN COMMENT 35(16) text-005 modif id mg1.

parameters p_verto(10) type c modif id mg1.

selection-screen end of line.

selection-screen skip 1.

selection-screen begin of line.

SELECTION-SCREEN POSITION 11.

SELECTION-SCREEN COMMENT 1(22) text-008 modif id mg2.

Parameters : p_seldel(10) type c modif id mg2.

selection-screen end of line.

selection-screen skip 4.

selection-screen begin of line.

SELECTION-SCREEN POSITION 11.

SELECTION-SCREEN COMMENT 1(10) text-001.

PARAMETERS : P0 RADIOBUTTON GROUP RADI user-command ABCD.

SELECTION-SCREEN POSITION 41.

SELECTION-SCREEN COMMENT 35(16) text-002.

PARAMETERS : P1 RADIOBUTTON GROUP RADI default 'X'.

selection-screen end of line.

SELECTION-SCREEN end OF BLOCK rad1.

data: v_chk.

at selection-screen.

if sy-ucomm = 'ABCD'.

v_chk = 'X'.

endif.

AT SELECTION-SCREEN OUTPUT.

if v_chk = 'X'.

loop at screen.

IF P0 = 'X'.

if SCREEN-GROUP1 = 'MG2'.

screen-input = 0.

screen-active = 0.

ENDIF.

elseif P1 = 'X'.

if SCREEN-GROUP1 = 'MG1'.

screen-input = 0.

screen-active = 0.

ENDIF.

endif.

modify screen.

endloop.

ENDIF.

0 Kudos
114

Hi,

Check this.

PARAMETERS : P0 RADIOBUTTON GROUP RADI user-command ABCD default 'X' .

SELECTION-SCREEN POSITION 41.

SELECTION-SCREEN COMMENT 35(16) text-002.

PARAMETERS : P1 RADIOBUTTON GROUP RADI .

selection-screen end of line.

SELECTION-SCREEN end OF BLOCK rad1.

0 Kudos
114

Hi Ramesh

Just by commenting the IF condition, it works fine.

SELECTION-SCREEN BEGIN OF BLOCK rad1 WITH FRAME TITLE text-003.
selection-screen begin of line.
SELECTION-SCREEN POSITION 11.
SELECTION-SCREEN COMMENT 1(12) text-004 modif id mg1.
parameters p_verfr(10) type c modif id mg1.
SELECTION-SCREEN POSITION 41.
SELECTION-SCREEN COMMENT 35(16) text-005 modif id mg1.
parameters p_verto(10) type c modif id mg1.
selection-screen end of line.
selection-screen skip 1.
selection-screen begin of line.
SELECTION-SCREEN POSITION 11.
SELECTION-SCREEN COMMENT 1(22) text-008 modif id mg2.
Parameters : p_seldel(10) type c modif id mg2.
selection-screen end of line.
selection-screen skip 4.
selection-screen begin of line.
SELECTION-SCREEN POSITION 11.
SELECTION-SCREEN COMMENT 1(10) text-001.
PARAMETERS : P0 RADIOBUTTON GROUP RADI user-command ABCD.
SELECTION-SCREEN POSITION 41.
SELECTION-SCREEN COMMENT 35(16) text-002.
PARAMETERS : P1 RADIOBUTTON GROUP RADI default 'X'.
selection-screen end of line.
SELECTION-SCREEN end OF BLOCK rad1.

data: v_chk.

at selection-screen.
  if sy-ucomm = 'ABCD'.
    v_chk = 'X'.
  endif.

AT SELECTION-SCREEN OUTPUT.
<b>*  if v_chk = 'X'.</b>
    loop at screen.
      IF P0 = 'X'.
        if SCREEN-GROUP1 = 'MG2'.
          screen-input = 0.
          screen-active = 0.
        ENDIF.
      elseif P1 = 'X'.
        if SCREEN-GROUP1 = 'MG1'.
          screen-input = 0.
          screen-active = 0.
        ENDIF.
      endif.
      modify screen.
    endloop.
<b>*  ENDIF.</b>

I dont know why you are using V_CHK, but if you definetely need it, you can make the condition as

<b>if v_chk = 'X' or SY-UCOMM IS INITIAL.</b>

This will also still work.

Hope this time it helps you.

Kind Regards

Eswar

jayanthi_jayaraman
Active Contributor
0 Kudos
114

Hi,

Try this and kindly reward points if it helps.

PARAMETERS: r_copy RADIOBUTTON GROUP R1 default 'X' user-command rusr,

r_delete RADIOBUTTON GROUP R1,

p_copy(10) modif id Z1,

p_delete(10) modif id z2.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF ( r_copy = 'X' and SCREEN-GROUP1 = 'Z1' ) or

( r_delete = 'X' and SCREEN-GROUP1 = 'Z2' ) or

( screen-name = 'R_COPY' ) or ( screen-name = 'R_DELETE' ).

SCREEN-input = 1.

ELSE.

SCREEN-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

0 Kudos
114

Hi,

Try this to hide.

PARAMETERS: r_copy RADIOBUTTON GROUP R1 default 'X' user-command rusr,

r_delete RADIOBUTTON GROUP R1,

p_copy(10) modif id Z1,

p_delete(10) modif id z2.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF ( r_copy = 'X' and SCREEN-GROUP1 = 'Z1' ) or

( r_delete = 'X' and SCREEN-GROUP1 = 'Z2' ) or

( screen-name CS 'R_COPY' ) or ( screen-name CS 'R_DELETE' ).

SCREEN-active = 1.

ELSE.

SCREEN-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.