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 excel date and time to SAP format

0 Kudos
949

Hello,

So i have an excel file that gives me date in the following format: DD:MM:YYYY - 1.2.2021 for example.

I have assigned it as type - char15. How can i convert it to data element AEDAT - Domain datum. Format is YYYYMMDD.

Also, i have time in format like this: 23:00:51 - HH:MM:SS. I also have that as char15. I wish to convert it to AEZEIT that has data type TIMS, that is the same - HH:MM:SS.

How should i approach this? Are there any relevant FM's i can use?

Thanks in advance.

2 REPLIES 2

Abinathsiva
Active Contributor
0 Kudos
502

Hi,

CONCATENATEtab-purch_date+4(4)tab-purch_date+2(2)tab-purch_date+0(2)INTOtab-purch_date.

joltdx
Active Contributor
0 Kudos
502

There are many ways to convert data, depending on the data type and formats. In your example you say format DD:MM:YYYY, with colon :, and the also 1.2.2021 with dot .. And also only 1 digit for the day and month.

And for TIMS, that format is HHMMSS, without the colons.

If you could specify exactly then we can help you. This can be done with substrings or regex or other conversion methods, depending on those details...