09-17-2008 5:45 AM
Hello All,
I have a checkbox and a filename input next to it.
I want to make the filename input mandatory if the checkbox is ticked.
Please suggest.
Thanks,
Kunal.
09-17-2008 5:49 AM
Hi,
write condition
if checkbox is not initial, then make the field name has obligatory or madatory.
Regards,
Kasuladevi Srinivas
09-17-2008 5:54 AM
Hello Kasuladevi,
How do i make the fieldname mandatory.
In which event should i write the code.
Please elaborate.
Thank you for the help.
Regards,
Kunal.
09-17-2008 6:02 AM
Hello
Try:
parameters: filename like rlgrap-filename.
parameters: sss as checkbox.
if sss = 'X'.
if filename is initial.
MESSAGE 'Enter filename' TYPE 'E'
exit. LEAVE SCREEN.
endif.
endif.
09-17-2008 5:53 AM
Hi,
You can do a selection screen validation on your file name.
Check if the checkbox is checked if so throw an error message if the file name is empty.
Say :
w_check -- > Checkbox
w_file -
> filename.
code :
at selection-screen on w_file.
if w_check = 'X'.
if w_file is initial.
Message 'Please enter the file Name' type 'E'.
endif.
endif.
09-17-2008 5:58 AM
09-17-2008 5:59 AM
Hi,
Check this sample code
REPORT z_sdn.
PARAMETERS:
p_chkbx AS CHECKBOX,
p_char(10) TYPE c.
AT SELECTION-SCREEN.
IF p_chkbx = 'X'.
IF p_char IS INITIAL.
MESSAGE 'Enter the value in field' TYPE 'E'.
ELSE.
MESSAGE 'You may proceed further' TYPE 'I'.
ENDIF.
ENDIF.
START-OF-SELECTION.
WRITE: / 'TEST'.
Regards
Abhijeet
09-17-2008 5:59 AM
Hi kunal,
Parameters:
p_chk as checkbox,
p_file LIKE dxfields-longpath .
At selection-screen.
if p_chk = 'X' and p_file is initial.
Message 'Fill mandatory field' type 'E'.
Endif.
Regards,
Sravanthi
09-17-2008 6:44 AM
hi try this ...
intitally read the value of check box using DYNP_VALUES_READ ... after that loop at the SCREEN ... and when screen-fieldname = ParameterName ... make thse forllowing change
screen-required = 1.
modify screen.
hope this helps ...........
09-17-2008 7:51 AM
Hi,
Find the sample code below to make the input field mandatory on clicking the checkbox.
REPORT ZCHECK_BOX.
TABLES sscrfields.
data: gv_x.
PARAMETERS check AS CHECKBOX USER-COMMAND check.
parameters test type mara-matnr modif id SC1.
AT SELECTION-SCREEN output.
IF gv_x = 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'SC1'.
screen-required = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
at selection-screen .
if sscrfields-ucomm = 'CHECK'.
gv_x = 'X'.
else.
clear gv_x.
endif.
START-OF-SELECTION.
WRITE 'Check Box Test'.
Regards,
Vadi