Application Development 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: 

Problem in Select-options

Former Member
0 Kudos

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

Former Member
0 Kudos

at selection-screen.

if s_date-high is initial.

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

endif.

6 REPLIES 6

Former Member
0 Kudos

hi,

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

at selection-screen.

if s_date-high is initial.

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

endif.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Dear ABAPers,

Your answers solved my problem.

I have given the Points.

Thank you very much.

Thanks & Regards,

Ashok.