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: 

convert SY-DATUM into Julian Code

former_member184701
Active Contributor
0 Kudos

dear abapers

can you please advice how to convert the current date into Julian Code?

(I am not a technical person, sorry)

the example is : for today 07.01.2010

Julian code supposed to be

0007 (or just "7")

Julian code is 4 digit number:

first letter is the last digit of the current year (example - 0 for 2010, 9 for 2009,...)

other 3 digits are the day of the year (example - 0007 for 7 January, 032 for 1 February,...)

can you please provide some code?

thank you very much.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI

try the below code

report z_date_to_julian.

data : v_i type i.

data : v_n(3) type n.

data : v_julian(5) type n.

data : date1 like sy-datum.

parameters : p_date like sy-datum.

concatenate p_date(4) '0101' into date1.

v_i = p_date - date1 + 1.

move : v_i to v_n.

concatenate p_date+2(2) v_n into v_julian.

write 😕 'Date -', p_date.

write 😕 'Julian -' , v_julian.

JULIAN DATE to YYMMDD format

2 REPLIES 2

Former Member
0 Kudos

HI

try the below code

report z_date_to_julian.

data : v_i type i.

data : v_n(3) type n.

data : v_julian(5) type n.

data : date1 like sy-datum.

parameters : p_date like sy-datum.

concatenate p_date(4) '0101' into date1.

v_i = p_date - date1 + 1.

move : v_i to v_n.

concatenate p_date+2(2) v_n into v_julian.

write 😕 'Date -', p_date.

write 😕 'Julian -' , v_julian.

JULIAN DATE to YYMMDD format

Former Member
0 Kudos

Hi chk the below link ..from Rex Jonathan Joseph .

System date conversion to Julian format

http://sap.ittoolbox.com/groups/technical-functional/sap-dev/system-date-conversion-to-julian-format...