Skip to Content
0
Former Member
Mar 03, 2009 at 07:13 AM

Selection-screen radiobuttons

41 Views

hi,

I had created a selection-screen with : 2 radiobuttons(RB) customer and customer group,

date field and 3 push buttons.here date z mandatory.

Under customer radiobutton,there is customer input field.and for custgrp RB customer group as i/p field.

without entering date field,if i select second radiobutton its displaying error msg as fill in required fields.

But i want to make custgrp i/p as active whenever i select 2nd RB whether date field is empty or filled.Similarly if i select again the 1st RB the custgrp should get inactive irrespective of date field.

how to do this??..

DATA: G_KDGRP TYPE S504-KDGRP,

G_KUNNR LIKE S001-KUNNR,

G_DATE TYPE SY-DATUM.

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

PARAMETERS:R1 RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND CC.

SELECT-OPTIONS: CUSTOMER FOR G_KUNNR MODIF ID CC.

SELECTION-SCREEN SKIP 1.

PARAMETERS:R2 RADIOBUTTON GROUP G1.

SELECT-OPTIONS: CUSTGRP FOR G_KDGRP MODIF ID GG.

SELECTION-SCREEN END OF BLOCK B1.

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

SELECT-OPTIONS: DATE FOR G_DATE OBLIGATORY.

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN: PUSHBUTTON 33(9) P1 user-command PB1,

PUSHBUTTON 50(9) P2 user-command PB2,

PUSHBUTTON 66(9) P3 user-command PB3.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B2.

AT SELECTION-SCREEN OUTPUT.

IF R1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'CC'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'GG'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'CC'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

IF SCREEN-GROUP1 = 'GG'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

INITIALIZATION.

P1 = 'Print'.

P2 = 'Clear'.

P3 = 'Close'.