11-11-2008 6:05 AM
Dear ABAPers,
I want to make the Select-options field mandatory.I have written the Below code.
select-options : p_date for crm_jcds-udate obligatory no-extension.
My problem is the above statement makes only the p_date-low mandatory .I want to make both p_date-low and p_date-high both as Mandatory field.How to do this.
Thanks & Regards,
Ashok.
11-11-2008 6:13 AM
at selection-screen.
if s_date-high is initial.
message e000(zz) with 'Input the High Date'.
endif.
11-11-2008 6:10 AM
hi,
please remove the no-extension, if you use no-extension you will get only low value, so remove no-extension but use obligatory.
11-11-2008 6:12 AM
U can do like this.
Declare a range for date and pass ur low and high values to the range in the function module source code.
RANGES: r_date FOR sy-datum.
Let us assume ur importing parameters are low_date, high_date.
If high_date is not mandatory field then do like this.
CLEAR: r_date, r_date[].
MOVE: 'I' TO r_date-sign.
IF NOT high_date IS INITIAL.
MOVE 'BT' TO r_date-option.
ELSE.
MOVE 'EQ' TO r_date-option.
ENDIF.
MOVE: low_date TO r_date-low,
high_date TO r_date-high.
APPEND r_date.
If high_date also mandatory field then do like this.
CLEAR: r_date, r_date[].
MOVE: 'I' TO r_date-sign.
'BT' TO r_date-option.
low_date TO r_date-low,
high_date TO r_date-high.
APPEND r_date.
If both are not mandatory fields then do like this.
CLEAR: r_date, r_date[].
SELECT....
INTO TABLE ...
FROM..
WHERE date IN r_date.
11-11-2008 6:13 AM
at selection-screen.
if s_date-high is initial.
message e000(zz) with 'Input the High Date'.
endif.
11-11-2008 6:13 AM
Hi,
No raj if u removed no extention aslo its not possible.
its not possible i think so...
thank u,
santhosh
Edited by: santhosh kumar on Nov 11, 2008 7:13 AM
11-11-2008 6:52 AM
hello Kumra,
try this , it works ,
select-options : p_date for crm_jcds-udate obligatory .
AT SELECTION-SCREEN ON p_date.
IF p_date-HIGH IS INITIAL.
MESSAGE 'Make an entry in all required fields' TYPE 'E'.
ENDIF.
Regards,
Aby
11-11-2008 8:35 AM
Dear ABAPers,
Your answers solved my problem.
I have given the Points.
Thank you very much.
Thanks & Regards,
Ashok.