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

Convert Julian date to a Calendar date

Is there a function to convert the Julian date to a calendar date? In our Quoting/Engineering our "Smart" numbers use the Julian date. In order to process this info we have to convert the Julian date.

In our R/2 system this was handled by the statement READ CALENDAR.... R/3 does not support this. I need to be able to convert the 3 digit Julian date to a calendar date, e.g. 031 = Jan 31, etc

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 10, 2005 at 06:19 PM
    Data: 
      greg_date   type d,
      jul_date(3) type n.
    
    greg_date = '20050101'.
    greg_date = greg_date + jul_date - 1.

    • greg_date would now have your date

    • add logic to handle the year

    Put this in a function module if you like.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 10, 2005 at 06:14 PM

    Here is some code that will show you how to calculate.

    
    report zrich_0002 .
    
    data: julian_day type i value '41'.
    data: date type sy-datum.
    data: firstofyear type sy-datum value 'XXXX0101'.
    
    replace 'XXXX' with sy-datum(4) into firstofyear.
    date = ( julian_day + firstofyear ) - 1.
    
    
    write:/ date.
    
    

    Regards,

    Rich Heilman

    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.