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

Comparing with sy-datum?????

Former Member
0 Likes
2,791

Hi,

I have got a select option which i have given the type sy-datum. Now in the code i have to check whether user has selected current date. for ex

p_Date for sy-datum.

now in the code i compare if (p_date = sy-datum)

I am facing a problem here, the format of p_date and sy-datum is different.

Suppose i selected todays date from select screen p_date value is shown as IE2000801220000000

and sy-datum value is 20080122. Due tro this the check condition fails. Please advice how to overcome this?

Rakesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,639

Hi,

If you use select options, the input field values will be like:

so_field-low and so_field-high

so use like,

if p_date-low eq sy-datum.

Pls reward points if solved.

Regards,

Renjith Michael.

Edited by: Renjith Michael on Jan 22, 2008 12:33 PM

Hi,

I have got a select option which i have given the type sy-datum. Now in the code i have to check whether user has selected current date. for ex

p_Date for sy-datum.

now in the code i compare if (p_date = sy-datum)

I am facing a problem here, the format of p_date and sy-datum is different.

Suppose i selected todays date from select screen p_date value is shown as IE2000801220000000

and sy-datum value is 20080122. Due tro this the check condition fails. Please advice how to overcome this?

Rakesh

7 REPLIES 7
Read only

Former Member
0 Likes
1,639

Use the FM CONVERT_DATE_TO_INTERNAL to convert the date entered to internal format and then compare.

Read only

Former Member
0 Likes
1,639

hi,

check ur system date settings

Read only

Former Member
0 Likes
1,640

Hi,

If you use select options, the input field values will be like:

so_field-low and so_field-high

so use like,

if p_date-low eq sy-datum.

Pls reward points if solved.

Regards,

Renjith Michael.

Edited by: Renjith Michael on Jan 22, 2008 12:33 PM

Read only

Former Member
0 Likes
1,639

declare like dis.....

p_date type sy-datum. adn not p_Date for sy-datum

p_date ll noew be like 20080122

Read only

Former Member
0 Likes
1,639

Hi,

Use this logic.

read table p_date index 1.

if p_date-low <> Sy-datum.

message .......

endif.

regards,

Santosh Thorat

Read only

Former Member
0 Likes
1,639

Hi Rakhesh,

Instead of using select option use

p_date type sy-datum.

at selection-screen on p_date.

if p_date <> sy-datum.

give error msg...........

endif.

If it is helpfull pls reward pts.

Regards

Srimanta

Read only

Former Member
0 Likes
1,639

hi rakesh,

since you are using select-options,

get the 'low' value of your p_date.

so instead of just p_date, use p_date-low.

regards,

laure.

>>>reward points if useful.