2007 Nov 20 9:25 PM
Hi gurus,
How set the <b>high value</b> in select option as mandatory and assign current date as default value?
Thanks,
Amal
2007 Nov 20 9:31 PM
Try with this code:
REPORT ZTEST_NP.
TABLES: BKPF.
SELECT-OPTIONS: S_DATE FOR BKPF-BUDAT.
INITIALIZATION.
S_DATE-SIGN = 'I'.
S_DATE-OPTION = 'BT'.
S_dATE-HIGH = SY-DATUM.
APPEND S_DATE.
AT SELECTION-SCREEN ON S_DATE.
IF S_dATE-HIGH IS INITIAL.
MESSAGE E398(00) WITH 'Please enter TO date'.
ENDIF.
Regards,
Naimesh Patel
2007 Nov 20 9:31 PM
Try with this code:
REPORT ZTEST_NP.
TABLES: BKPF.
SELECT-OPTIONS: S_DATE FOR BKPF-BUDAT.
INITIALIZATION.
S_DATE-SIGN = 'I'.
S_DATE-OPTION = 'BT'.
S_dATE-HIGH = SY-DATUM.
APPEND S_DATE.
AT SELECTION-SCREEN ON S_DATE.
IF S_dATE-HIGH IS INITIAL.
MESSAGE E398(00) WITH 'Please enter TO date'.
ENDIF.
Regards,
Naimesh Patel
2007 Nov 20 10:07 PM
Naimesh,
Thanks its working.
Now iam doing the validation that high value should not be greater than current date.After validation the cursor should be in high value not in low value if the date in high value is greater that curent date.How to set the cursor to high value ?
Thanks,
Amal
2007 Nov 20 10:11 PM
Ok..
For that you can use the SET CURSOR.
Like:
AT SELECTION-SCREEN ON S_DATE.
IF S_dATE-HIGH IS INITIAL.
SET CURSOR FIeld 'S_DATE-HIGH' DISPLAY OFFSET 0. " <<<
MESSAGE E398(00) WITH 'Please enter TO date'.
ENDIF.
Regards,
Naimesh Patel
2007 Nov 20 10:19 PM