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

To make certain selection screen fields change dynamic

Former Member
0 Likes
1,347

Hi ,

I have a requirement as there are 2 radio buttons on selection screen,say A & B.

If A clicked,need few other selection fields to be mandatory while when B selected,need not get these fields mandatory.How can this dynamic change be done?

Thanska lot in advance.

Regards,

Leeza.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
742

Hi,

You can do this via the event "AT SELECTION SCREEN".



SELECTION-SCREEN BEGIN OF BLOCK a1.
 SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
  PARAMETERS r_write RADIOBUTTON GROUP radi MODIF ID aa
            USER-COMMAND abc DEFAULT 'X'.
  PARAMETERS r_rever  RADIOBUTTON GROUP radi MODIF ID aa.

  SELECTION-SCREEN END OF BLOCK b1.

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

  PARAMETERS p_start LIKE sy-datum MODIF ID bb.
  PARAMETERS p_date  LIKE sy-datum MODIF ID cc.  
  PARAMETERS p_rever LIKE sy-datum MODIF ID dd.  

  SELECTION-SCREEN END OF BLOCK b2.

  SELECTION-SCREEN END OF BLOCK a1.

AT SELECTION-SCREEN OUTPUT.
  IF r_write EQ gc_mark.
    gv_block = 'DD'.
    PERFORM f6000_deactivate.

  ELSEIF r_rever EQ gc_mark.
    gv_block = 'CC'.
    PERFORM f6000_deactivate.
  ENDIF.

FORM f6000_deactivate.

  LOOP AT SCREEN.
    screen-active = '1'.
    IF screen-group1 = gv_block.
      screen-active = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

ENDFORM.   

Hey Leeza, if you want the field to be mandatory, just add the keyword OBLIGATORY next to it while decalring, so that the field becomes mandatoty.

I hope this is suffice. If any doubt just message.

Thanks & Regards,

Venkat Ramanan

Hi ,

I have a requirement as there are 2 radio buttons on selection screen,say A & B.

If A clicked,need few other selection fields to be mandatory while when B selected,need not get these fields mandatory.How can this dynamic change be done?

Thanska lot in advance.

Regards,

Leeza.

4 REPLIES 4
Read only

hymavathi_oruganti
Active Contributor
0 Likes
742

u can do it in event

at selection screen output.

loop at screen.

if screen-name = .......

......

endif.

modify screen.

endloop.

see in dictionary, table named "SCREEN" and find its fields. u have to use those fields.

there are many posts in forum regarding this topic, search in forum. u can find many

Read only

Former Member
0 Likes
742

Hi leeza,

1. Using OBLIGATORY

at the time of parameters definition

won't help.

2. Hence, we need to

EXPLICITLY

use IF-ENDIF

and check parameter is INITIAL.

3. So if smoething is found wrong,

then

message s999(yhr) with 'Field is compulsory'.

LEAVE LIST-PROCESSING. <---- IMPORTANT.

regards,

amit m.

Read only

Former Member
0 Likes
742

hi leeza,

check this sample..

clicking on check1 makes the select-options mandatory..

tables : vbap.

data : vbap_wa like vbap.

PARAMETERS : CHECK radiobutton group rd1 user-command chk ,

check_1 radiobutton group rd1 .

select-options : s_vbeln for vbap-vbeln MODIF ID B .

at selection-screen on radiobutton group rd1.

LOOP AT SCREEN.

IF CHECK NE 'X' AND SCREEN-GROUP1 = 'B'.

SCREEN-required = '1'.

ENDIF.

modify screen.

ENDLOOP.

Read only

Former Member
0 Likes
743

Hi,

You can do this via the event "AT SELECTION SCREEN".



SELECTION-SCREEN BEGIN OF BLOCK a1.
 SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
  PARAMETERS r_write RADIOBUTTON GROUP radi MODIF ID aa
            USER-COMMAND abc DEFAULT 'X'.
  PARAMETERS r_rever  RADIOBUTTON GROUP radi MODIF ID aa.

  SELECTION-SCREEN END OF BLOCK b1.

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

  PARAMETERS p_start LIKE sy-datum MODIF ID bb.
  PARAMETERS p_date  LIKE sy-datum MODIF ID cc.  
  PARAMETERS p_rever LIKE sy-datum MODIF ID dd.  

  SELECTION-SCREEN END OF BLOCK b2.

  SELECTION-SCREEN END OF BLOCK a1.

AT SELECTION-SCREEN OUTPUT.
  IF r_write EQ gc_mark.
    gv_block = 'DD'.
    PERFORM f6000_deactivate.

  ELSEIF r_rever EQ gc_mark.
    gv_block = 'CC'.
    PERFORM f6000_deactivate.
  ENDIF.

FORM f6000_deactivate.

  LOOP AT SCREEN.
    screen-active = '1'.
    IF screen-group1 = gv_block.
      screen-active = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

ENDFORM.   

Hey Leeza, if you want the field to be mandatory, just add the keyword OBLIGATORY next to it while decalring, so that the field becomes mandatoty.

I hope this is suffice. If any doubt just message.

Thanks & Regards,

Venkat Ramanan