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

reports

Former Member
0 Likes
1,274

I have two radiobuttons and two input fields in a selection screen. If I check the first raditobutton I should be able to input into the first input field but not into the second input field. and if I check the second radiobutton I shoud be able to give input into the second field but not into the first input field. How it can be done.

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,252

TABLES : marc.

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

PARAMETERS : rad1 RADIOBUTTON GROUP grp1 USER-COMMAND cmd.

PARAMETERS : rad2 RADIOBUTTON GROUP grp1 DEFAULT 'X'.

SELECTION-SCREEN: END OF BLOCK b1.

SELECT-OPTIONS: p_werks FOR marc-werks MODIF ID m1.

SELECT-OPTIONS: s_matnr FOR marc-matnr MODIF ID m2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 EQ 'M1' AND rad1 EQ 'X'.

screen-input = 0.

MODIFY SCREEN.

ELSEIF screen-group1 EQ 'M2' AND rad2 EQ 'X'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

11 REPLIES 11
Read only

Former Member
0 Likes
1,252

hi

good

parameters: a as checkbox USER-COMMAND fcode,

b as checkbox.

At selection-screen output.

Case a.

when 'X'.

b = ' '.

when ' '.

b = 'X'.

endcase.

thanks

mrutyun^

Read only

Former Member
0 Likes
1,252

Hi Pallavi,

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.

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

Hope it will solve your problem.

Reward points if useful

thanks,

swaroop

Read only

former_member188829
Active Contributor
0 Likes
1,252

Hi Pallavi,

Check this Example..

PARAMETERS:R1 RADIOBUTTON GROUP GP1 USER-COMMAND U DEFAULT 'X'.

PARAMETERS:R2 RADIOBUTTON GROUP GP1.

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

PARAMETERS:P1(10) TYPE C MODIF ID AB1.

SELECTION-SCREEN END OF BLOCK B1.

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

PARAMETERS:P2(30) TYPE C MODIF ID AB2.

SELECTION-SCREEN END OF BLOCK B2.

AT SELECTION-SCREEN OUTPUT.

IF R1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'AB2'.

SCREEN-ACTIVE = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'AB1'.

SCREEN-ACTIVE = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Read only

Former Member
0 Likes
1,252

Hi,

use modif statement.

eg

parameters: p1 type c modif id 'PRN',

p2 type c modif id 'SDN'.

rb1 and rb2 are radiobuttons.

at selection-screen input on rb1 .

if rb1 = 'X'.

loop at screen.

if screen-group1 = 'SDN''.

screen-active = '0'.

modify screen.

else.

screen-active = '1'.

modify screen.

endif.

endloop.

at selection-screen input on rb2 .

if rb2 = 'X'.

loop at screen.

if screen-group1 = 'PRN'.

screen-active = '0'.

modify screen.

else.

screen-active = '1'.

modify screen.

endif.

endloop.

regards,

Santosh Thorat

Read only

Former Member
0 Likes
1,252

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.

Reward me if help full

Read only

Former Member
0 Likes
1,253

TABLES : marc.

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

PARAMETERS : rad1 RADIOBUTTON GROUP grp1 USER-COMMAND cmd.

PARAMETERS : rad2 RADIOBUTTON GROUP grp1 DEFAULT 'X'.

SELECTION-SCREEN: END OF BLOCK b1.

SELECT-OPTIONS: p_werks FOR marc-werks MODIF ID m1.

SELECT-OPTIONS: s_matnr FOR marc-matnr MODIF ID m2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-group1 EQ 'M1' AND rad1 EQ 'X'.

screen-input = 0.

MODIFY SCREEN.

ELSEIF screen-group1 EQ 'M2' AND rad2 EQ 'X'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

0 Likes
1,252

thanks for your replies.

Actually I want to know what is the use of modif statement and how and when to use it.

Read only

0 Likes
1,252

Hi,

See below docu.

The addition MODIF ID assigns all the screen elements of the parameter to the modification group modid, which is assigned to the column group1 of the system table screen. This enables them to be modified before the selection screen is displayed, using the statement MODIFY SCREEN. The name of the modification group modid must be directly specified and can have a maximum length of three characters.

Note

The modification groups that are assigned to columns group2 and group3 of the system table screen are set when the system generates a selection screen and are described in the screen elements of a selection screen.

Thanks,

Sriram Ponna.

Read only

0 Likes
1,252

Did you check help notes????

... MODIF ID modid

Effect

This addition assigns screen objects ( Comment, Underscore line, Parameter, ...) to a modification group and hence allows dynamic modification of the selction screen display.

The modification group name modid must be specified directly and must be no longer than 3 characters. The addition MODIF ID assigns modid to the column SCREEN-GROUP1 of the predefined internal table SCREEN. Parameters assigned to a modification group can be changed together using the LOOP AT SCREEN and MODIFY SCREEN statements at the event AT SELECTION SCREEN OUTPUT or in the subroutine PBO of the database program of the assigned logical database.

Read only

Former Member
0 Likes
1,252

Hi,

Please look at the code below :

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.

endif.

if sp_all = 'X'.

IF screen-group1 = 'SP1'.

screen-input = '0'.

screen-invisible = '0'.

screen-required = '0'.

MODIFY SCREEN.

ENDIF.

endif.

ENDLOOP.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
1,252

Hi,

Try with below sample code.It will solve your problem.

*+++++++++++++++++++++++++++++++++++

REPORT zstemp_qty2_ .

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-input = 1.

ELSE.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'DEF'.

IF p_rad2 = 'X'.

screen-input = 1.

ELSE.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

*++++++++++++++++++++++++++++++++++

Regds

Sivaparvathi

Please reward points if helpful.....