Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

convert date to int

Hello all,

in a routine I wamt to assign a char value to an int:

data l_day type d value '20110101'.

data day type i.

day = l_day.

Now my problem is, that the integer variable day is filled witth a value 734139.

What is the best thing to do to obtain 20110101 for the integer variable l_day?

Thank You!


Former Member
Former Member replied


Include one more step, first take the value of date in char and then pass it to integer.

data l_day type d value '20110101'.

data c_day(8) type c.

data day type i.

c_day = l_day.

day = c_day.

day will have the value as 20110101.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question