‎2006 Aug 29 9:59 AM
Hi,
I have a issue with selection-screen validations.
I have 2 radio-buttons placed initially in my screen.
Now based on Radio button selected other screen fields will vary. In this some mandatory fields are also there.
Now when i am moving shifting from 1 radio button to 2nd radio button sel-screen is prompting for filling of manadatory fields.
I have to input some dummy values and get into 2nd radio button selection.
Is there any way we can discard mandatory field prompting for radio buttons.
Can anybody solve this issue.
Thanks in advance.
Thanks & Reagards,
Prasad.
‎2006 Aug 29 10:02 AM
U can use the AT SELECTION-SCREEN event to do the necessary validation and checks..so in your case if a particular is mandatory for rd1 and not for rd2..in that case please take out the obligatory clause from the parameter and do the validation in the above event..basically if rd1 is selected and the particular parameter is blank ..display an error message.
Regards
Anurag
‎2006 Aug 29 10:02 AM
U can use the AT SELECTION-SCREEN event to do the necessary validation and checks..so in your case if a particular is mandatory for rd1 and not for rd2..in that case please take out the obligatory clause from the parameter and do the validation in the above event..basically if rd1 is selected and the particular parameter is blank ..display an error message.
Regards
Anurag
‎2006 Aug 29 10:05 AM
Hi,
This can be achieved by making the fields mandatory thro' programmatically, check for the value when the user presses 'execute' button and if the value is blank you can throw the error message that the value needs to be entered in order to proceed, this would resolve the issue related with mandatory fields,
Hope this helps,
Rgds,
‎2006 Aug 29 10:17 AM
hi,
Alternatively what you can do is,put the validations in the beginning of START-OF-SELECTION Event. this way you can come out of this problem.
START-OF-SELECTION.
perform validate_sel_screen.
*--then proceed further with processing.
perform get_data.
Regards
srikanth
‎2006 Aug 29 10:26 AM
Hi Prasad,
yes you can do that.., you have to remove the obligatory option, and need to check the intial condition in at selection screen event.only when you press F8.
Just check the sample code..
REPORT ztest.
TABLES: mara,vbak.
PARAMETERS: r_m RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND ABC,
r_s RADIOBUTTON GROUP g1.
parameters: p_matnr like mara-matnr,
p_vbeln like vbak-vbeln.
AT SELECTION-SCREEN OUTPUT.
IF r_m = 'X'.
LOOP AT SCREEN.
IF screen-name = 'P_VBELN'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-name = 'P_MATNR'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
AT SELECTION-SCREEN.
<b> IF sy-ucomm = 'ONLI'.</b>
IF r_m = 'X'.
IF P_matnr IS INITIAL.
MESSAGE e000(zz) WITH 'error'.
ENDIF.
ENDIF.
ENDIF.Regards
vijay
‎2007 Apr 06 10:16 AM
Hi,
I think this coding is help u.
REPORT YREPVALIDATION .
TABLES: KNA1,VBAK.
DATA : BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
ERDAT LIKE VBAK-ERDAT,
NETWR LIKE VBAK-NETWR,
END OF ITAB.
DATA : VAL TYPE I VALUE 1.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : CUST LIKE KNA1-KUNNR.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS : SALES LIKE VBAK-VKORG MODIF ID RAF,
DCH LIKE VBAK-VTWEG MODIF ID RAF.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'RAF'.
IF VAL = 1.
SCREEN-INPUT = 0.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ELSE.
VAL = 2.
*SCREEN-INPUT = 1.
SCREEN-INVISIBLE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
Rgds,
P.Naganjana Reddy