Application Development and Automation 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: 
Read only

Date conversion

Former Member
0 Likes
454

Hi,

I have a req to convert the date format.

Im fetching ZALDT from PAYR the date format of this ZALDT in database table is MM/DD/YYYY.

After downloading the file to presentation server the date format in the file is displaying as YYYYMMDD.

But i want to convert the date format to MMDDYY without any separators.

I have tried so many options like EDIT mask, FM's, Offshifts but could not get any.

Pls. anybody help me.

Thanks.

2 REPLIES 2
Read only

mvoros
Active Contributor
0 Likes
414

Hi,

just check ABAP documentation for ABAP command WRITE. It's well described there. Just convert your date field to string using WRITE command and addition MMDDYY.



WRITE zaldt TO l_output MMDDYY.

Cheers

Read only

Former Member
0 Likes
414

Hi,

Using the Offset and Position you can buid the date as per your requirement.

l_date = sy-datum+4(2).     " Month
l_date+2 =  sy-datum+6(2). " Date
l_date+4 =  sy-datum+2(2). " Year