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

select options

Former Member
0 Likes
725

Hi

i want 2 radio buttons in my select options

when i click on the first one 1 page should be displayed with diff select options and vice versa

can any one help me out on this

Thanks in advance

rajesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
707

Hi,

to modify a selection screen we use that.

refer this code

-


PARAMETERS & SELECT-OPTIONS *

-


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.

PARAMETERS : p_pay1 RADIOBUTTON GROUP grp USER-COMMAND fc DEFAULT 'X',

p_pay2 RADIOBUTTON GROUP grp.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

SELECT-OPTIONS : s_pernr FOR pa0000-pernr. "Personnel Number

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT (31) text-018.

PARAMETERS : p_begda LIKE pa0000-begda OBLIGATORY. "Start Date

SELECTION-SCREEN COMMENT 52(05) text-019.

PARAMETERS : p_endda LIKE pa0000-endda OBLIGATORY. "End Date

SELECTION-SCREEN END OF LINE.

SELECT-OPTIONS : s_stat2 FOR pa0000-stat2, "Status

s_werks FOR pa0001-werks, "Personnel Area

s_raufnr FOR catsdb-raufnr MODIF ID md1. "Internal Order Number

SELECTION-SCREEN END OF BLOCK b2.

-


AT SELECTION-SCREEN *

-


AT SELECTION-SCREEN OUTPUT.

IF p_pay1 EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'MD1'.

screen-active = '1'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF p_pay2 EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'MD1'.

screen-active = '1'.

screen-input = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Regards,

Satish

5 REPLIES 5
Read only

Former Member
0 Likes
707

hi rajesh,

Have a look on this logic.It will help you out.

If you want to do it using Selection screen then it is possible.

for that you have to use AT SELECTION-SCREEN output. event..

See the below code and use it according to your requirement.

======================================

tables: pa0000, pa0001.

parameters: p_rad1 radiobutton group rad1 default 'X' user-command rusr,

p_rad2 radiobutton group rad1.

selection-screen: begin of block blk1 with frame.

select-options: s_pernr for pa0000-pernr modif id ABC.

selection-screen: end of block blk1.

selection-screen: begin of block blk2 with frame.

select-options: s_stat2 for pa0000-stat2 modif id DEF.

select-options: s_werks for pa0001-werks modif id DEF.

selection-screen: end of block blk2.

AT SELECTION-SCREEN output.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

IF p_rad1 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'DEF'.

IF p_rad2 = 'X'.

SCREEN-ACTIVE = 1.

ELSE.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

=====================================

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS: P_WERKS LIKE MARC-WERKS OBLIGATORY VALUE CHECK MODIF ID S1.

SELECT-OPTIONS: S_EBELP FOR EKPO-EBELP OBLIGATORY NO INTERVALS NO-EXTENSION MODIF ID S2.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: R_PLANT RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND UC1.

SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R_PLANT.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS:R_PO RADIOBUTTON GROUP G1.

SELECTION-SCREEN COMMENT 5(20) TEXT-004 FOR FIELD R_PO.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF R_PLANT = 'X' AND SCREEN-GROUP1 = 'S2'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

IF R_PO = 'X' AND SCREEN-GROUP1 = 'S1'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Hope it will solve your problem.

Reward points if useful

thanks

swaroop

Read only

Former Member
0 Likes
708

Hi,

to modify a selection screen we use that.

refer this code

-


PARAMETERS & SELECT-OPTIONS *

-


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.

PARAMETERS : p_pay1 RADIOBUTTON GROUP grp USER-COMMAND fc DEFAULT 'X',

p_pay2 RADIOBUTTON GROUP grp.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

SELECT-OPTIONS : s_pernr FOR pa0000-pernr. "Personnel Number

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT (31) text-018.

PARAMETERS : p_begda LIKE pa0000-begda OBLIGATORY. "Start Date

SELECTION-SCREEN COMMENT 52(05) text-019.

PARAMETERS : p_endda LIKE pa0000-endda OBLIGATORY. "End Date

SELECTION-SCREEN END OF LINE.

SELECT-OPTIONS : s_stat2 FOR pa0000-stat2, "Status

s_werks FOR pa0001-werks, "Personnel Area

s_raufnr FOR catsdb-raufnr MODIF ID md1. "Internal Order Number

SELECTION-SCREEN END OF BLOCK b2.

-


AT SELECTION-SCREEN *

-


AT SELECTION-SCREEN OUTPUT.

IF p_pay1 EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'MD1'.

screen-active = '1'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF p_pay2 EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'MD1'.

screen-active = '1'.

screen-input = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Regards,

Satish

Read only

Former Member
0 Likes
707

Hi Rajesh,

Go through this code which helps u..

type-pools : slis .

tables : eban .

types : begin of ty_eban,

banfn type eban-banfn,

bnfpo type eban-bnfpo,

bsakz type eban-bsakz,

statu type eban-statu,

ekgrp type eban-ekgrp,

matnr type eban-matnr,

werks type eban-werks,

lgort type eban-lgort,

preis type eban-preis,

peinh type eban-peinh,

end of ty_eban.

  • internal table

data : lt_eban type standard table of ty_eban,

wa_eban type ty_eban .

data: repid type sy-repid .

data : begin of it_matnr occurs 0 ,

matnr type eban-matnr ,

end of it_matnr .

data : matno type eban-matnr,

ilen type i value 1 ,

count type i value 0 .

data: ad_fdcat type slis_t_fieldcat_alv,

layout type slis_layout_alv,

s_event type slis_t_event,

wa_event type slis_alv_event.

initialization.

repid = sy-repid .

selection-screen begin of block b1 with frame title text-001.

parameters:rad_blk1 radiobutton group rad1 user-command rad default 'X',

rad_blk2 radiobutton group rad1.

selection-screen end of block b1.

selection-screen: begin of block b2 with frame title text-001.

parameters: chk_blk1 as checkbox modif id ms2 user-command chk .

parameters: chk_blk2 as checkbox modif id ms2 user-command chk1 .

select-options: s_matnr for eban-matnr modif id ms1.

select-options :s_lgort for eban-lgort modif id ms3 .

selection-screen: end of block b2.

at selection-screen output.

loop at screen.

if screen-group1 = 'MS1' .

if rad_blk1 eq 'X' .

screen-active = 1.

else.

screen-active = 0 .

endif.

endif .

modify screen.

endloop.

loop at screen.

if screen-group1 = 'MS2' .

if rad_blk1 eq 'X' .

screen-active = 1.

else.

screen-active = 0 .

endif.

endif .

modify screen.

endloop.

loop at screen.

if screen-group1 = 'MS1' .

if chk_blk1 eq 'X' .

screen-input = 1.

else.

screen-input = 0 .

endif.

endif .

modify screen.

endloop.

if sy-ucomm = 'CHK' .

loop at screen.

if screen-group1 = 'MS2' .

if chk_blk1 eq 'X' .

screen-input = 1.

else.

screen-input = 0 .

endif.

endif .

modify screen.

endloop.

endif .

Reward if helpful.

Thankyou,

Regards.

Read only

Former Member
0 Likes
707

Hi,

Please let at below code :

TABLES : bsis.

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETER : sp_sel radiobutton group rad USER-COMMAND radio DEFAULT 'X',

sp_all RADIOBUTTON GROUP rad.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

SELECT-OPTIONS : so_bukrs FOR bsis-bukrs MODIF ID sp1.

SELECT-OPTIONS : so_hkont FOR bsis-hkont MODIF ID sp2.

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF sp_sel = 'X'.

IF screen-group1 = 'SP2'.

screen-input = '0'.

screen-invisible = '0'.

screen-required = '0'.

MODIFY SCREEN.

ENDIF.

elseif sp_all = 'X'.

IF screen-group1 = 'SP2'.

screen-input = '0'.

screen-invisible = '0'.

screen-required = '0'.

MODIFY SCREEN.

ENDIF.

endif.

ENDLOOP.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
707

Hi,

selection-screen begin of screen 100 title title.

selection-screen begin of block b1 with frame title text-t01.

parameter:rad1 radiobutton group rad user-command frad1 default 'X',

rad2 radiobutton group rad .

selection-screen end of block b1.

selection-screen begin of block b2 with frame title text-t02.

parameter: mtr as checkbox modif id g3 user-command chk1,

p_matnr type eban-matnr modif id g1,

sloc as checkbox modif id g3 user-command chk2,

str_loc type eban-lgort modif id g4.

selection-screen end of block b2.

selection-screen begin of block b3 with frame title text-t03.

select-options: matnr1 for eban-matnr modif id g2.

selection-screen end of block b3.

selection-screen pushbutton /20(10) name user-command ucom.

selection-screen end of screen 100.

name = 'FETCH'.

title = 'Test Report'.

call selection-screen '100'.

type-pools slis.

  • declare your internal tables and work areas to be used here*

initialization.

pr_id = sy-repid.

at selection-screen output.

if rad1 = 'X'.

loop at screen.

if screen-group1 = 'G1' or screen-group1 = 'G4'.

screen-active = '1'.

screen-input = 0.

elseif screen-group1 = 'G2'.

screen-active = '0'.

endif.

modify screen.

endloop.

elseif rad2 = 'X'.

loop at screen.

if screen-group1 = 'G1' or screen-group1 = 'G4' or screen-group1 = 'G3' or screen-group1 = 'G5'.

screen-active = '0'.

elseif screen-group1 = 'G2'.

screen-active = '1'.

endif.

modify screen.

endloop.

endif.

if mtr = 'X'.

loop at screen.

if screen-group1 = 'G1'.

screen-input = 1 .

endif.

modify screen.

endloop.

endif.

if sloc = 'X'.

loop at screen.

if screen-group1 = 'G4'.

screen-input = 1 .

endif.

modify screen.

endloop.

endif.

clear sy-ucomm.

and then write select and write statement.

this may probably help you rajesh,

plz reward if helpful,

plz get back to me for further queries,

thanks and regards,

srikanth tulasi.