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

date problem

Hi all,

In my report display there is date field with format dd.mm.yyyy. if i enter some date (ex. 12.10.2007) and click on update button to insert into database it's storing in different format.

cud any one please suggest me how to validate this date format before inserting in to data base.

thanks and regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 25, 2007 at 01:28 PM

    before updating date c the format of date the system is using... n try

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 25, 2007 at 01:33 PM

    1.open any session

    2. go to system -> user profile -> own data

    3. then to defaults tab

    4.Change the date format according 2 ur requirement.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 25, 2007 at 01:42 PM

    Hi ,

    In sap it is stored in YYYYMMDD or YYYYDDMM format.

    You have to format the input date to this format and then insert in the database.

    DATA: l_dd TYPE char2.

    DATA: l_mm TYPE char2.

    DATA: l_yy TYPE char4.

    l_dd = p_sdate+0(2).

    l_mm = p_sdate+3(2).

    l_yy = p_sdate+6(4).

    CONCATENATE l_yy l_mm l_dd INTO p_tdate.

    if helpful reward points,

    regards,

    Tanmay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 25, 2007 at 02:22 PM

    Hi Abdul,

    The data needs to be converted to the system date format before updating it to the database. So use statement "write w_cdate to w_sdate" to covert the date format to the system date format.

    w_cdate- Date available in the current date format.

    w_sdate- Variable used to update the database.

    Use the w_sdate to update the database.

    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.