2006 Feb 07 8:43 AM
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.
2006 Feb 07 9:32 AM
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.
2006 Feb 07 8:49 AM
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
2006 Feb 07 8:50 AM
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.
2006 Feb 07 8:51 AM
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.
2006 Feb 07 9:32 AM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |