Skip to Content
author's profile photo Former Member
Former Member

Comparing with sy-datum?????

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 07:02 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 07:00 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 07:01 AM

    hi,

    check ur system date settings

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 07:02 AM

    declare like dis.....

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

    p_date ll noew be like 20080122

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 07:03 AM

    Hi,

    Use this logic.

    read table p_date index 1.

    if p_date-low <> Sy-datum.

    message .......

    endif.

    regards,

    Santosh Thorat

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 07:10 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 07:12 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.