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: 

regarding conversion of date in abap

Former Member
0 Kudos

Hi All,

while running my application I am not getting the date of birth in correct format.

say for example i require the correct output i.e DOB as 01.01.1970 but i am getting the wrong output in this field as 19700101.so if there is any function module or any way to do the date conversion then give it i.e. how can I convert the date from string to date format.If any one knows the solution then revert me back.

Thanking you All in advance.

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

where are you doing this ..?

what ever format you are getting it is in YYYYMMDD format.

are you facing this problem in Screen fields or Program output.

Or while storing it to Database..?

4 REPLIES 4

former_member188685
Active Contributor
0 Kudos

where are you doing this ..?

what ever format you are getting it is in YYYYMMDD format.

are you facing this problem in Screen fields or Program output.

Or while storing it to Database..?

Former Member
0 Kudos

say your user setting format is mm.dd.yyyy

now, data: v_date like sy-datum.

move the data to V_date.

write:/ v_date.

as your user setting format is mm.dd.yyyy it displays as 01.01.1997 although internally it stores as 19970101

Former Member
0 Kudos

Hi,

To avoid that problem and you always want to write date in mm.dd.yyyy or dd.mm.yyyy format just write like

WRITE <date_variable> DD/MM/YYYY. or

WRITE <date_variable> MM/DD/YYYY.

Hope this will help you,

Regards,

Aswini.

Former Member
0 Kudos

HI anand,

There is no such FM but you can utilise the concept of offset & then concatenate them.

Luck,

Bhumika