Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in Select-options

Former Member
0 Likes
781

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
751

at selection-screen.

if s_date-high is initial.

message e000(zz) with 'Input the High Date'.

endif.

6 REPLIES 6
Read only

Former Member
0 Likes
751

hi,

please remove the no-extension, if you use no-extension you will get only low value, so remove no-extension but use obligatory.

Read only

Former Member
0 Likes
751

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.

Read only

Former Member
0 Likes
752

at selection-screen.

if s_date-high is initial.

message e000(zz) with 'Input the High Date'.

endif.

Read only

Former Member
0 Likes
751

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

Read only

Former Member
0 Likes
751

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

Read only

0 Likes
751

Dear ABAPers,

Your answers solved my problem.

I have given the Points.

Thank you very much.

Thanks & Regards,

Ashok.