Skip to Content
0
Former Member
Apr 20, 2009 at 05:31 PM

At selection screen output problem when a field is obligatory

643 Views

Hi All,

I have two radiobuttons on the selection screen and when I select first radiobutton one screen should display and the other should not be displayed and vice-versa. It is working fine if I do not have a mandatory field.I am pasting my code here.Can anyone please help me how to handle this situation when we have some mandatory fields on one of these screens.

TABLES : mara,marc.

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

PARAMETERS : p_meth1 RADIOBUTTON GROUP g1 USER-COMMAND g1,

p_meth2 RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b1.

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

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS : so_matnr FOR marc-matnr MODIF ID m1 obligatory.

SELECTION-SCREEN SKIP 1.

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

SELECTION-SCREEN END OF BLOCK matnr.

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

SELECTION-SCREEN SKIP 1.

PARAMETERS: p_fpath TYPE ibipparms-path MODIF ID m2 LOWER CASE.

SELECTION-SCREEN END OF BLOCK file.

SELECTION-SCREEN BEGIN OF BLOCK date WITH FRAME TITLE text-004.

SELECTION-SCREEN SKIP 1.

PARAMETERS : p_date TYPE datuv.

SELECTION-SCREEN END OF BLOCK date.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

CASE screen-group1.

WHEN 'M1'.

IF p_meth1 = 'X'.

screen-active = 1.

ENDIF.

IF p_meth2 = 'X'.

screen-active = 0.

ENDIF.

WHEN 'M2'.

IF p_meth2 = 'X'.

screen-active = 1.

ELSE.

screen-active = 0.

ENDIF.

IF p_meth1 = 'X'.

screen-active = 0.

ENDIF.

ENDCASE.

MODIFY SCREEN.

ENDLOOP.

Thanks in advance

Sandeep