cancel
Showing results for 
Search instead for 
Did you mean: 

Date conversion Problem

Former Member
0 Kudos

Dear Experts,

I have a problem in Date conversion in flat file Loading,

In Flat file it has the below format,

03-Mar-04.

But i want to store it in SAP Format (ie), yyyymmdd. I do know how to achieve this. In flat file if we click on Particular date value (03-Mar-04) in the formulae bar it shows that 3/3/2004.

up to PSA it stores (03-Mar-04) format, ie char -9,

I wrote the field routine by using SPILIT and Concatenate statement

My Question is how the SAP system will identify 04 as 2004, bcoz it may be 1904 or 2004?

Please help as this is very urgent.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If you are using csv file then in csv file you can select date colum and do format cell to select it in yyyymmdd. Then try loading data.

Regards,

Pravin Karkhanis.

Former Member
0 Kudos

Hi,

Firstly check if your target field is in date format. when you preview the data, it will always show in yyyymmdd format only.

correct the data according to format in the preview and then load.

Former Member
0 Kudos

Dear Sailesh,

Thanks for your reply

In the Preview Datasource when i load the sample data the field proposals shows me the Character type with Length 9, and i had declared Infoobject(Target) as Date type.

Awaiting for your Answers

Former Member
0 Kudos

Change the format of this date in CSV flat file and make sure to check the format by right clicking on the file and open using notepad.The format should appear as yyyymmdd in notepad.

Regards,

JB

Former Member
0 Kudos

Hi JB and Pravin,

II can't do anything in CSV file, and its going to be daily activity(Uploading). Is there any permanent solution for this.

I wrote the code like

If Year is between 00 and 50,

Concatenate 20 before the year

For Ex : if date = 28-feb-04

it will store as 28022004

If year is between 51 and 99

Concatenate 99 before the year

For Ex : if date = 28-feb-94

it will store as 28021994

This may not be the permanent Solution. PLease help me in this regard.

Former Member
0 Kudos

Hi Candie,

Your solution might work for next 39 years till 2050 but after that even for human being it will not be possible to identify the date based on the format in excel sheet. i.e. if you have some date like. 01/02/51 is it 1951? or 2051?

So there is no solution to this unless you get full year from excel file. Try to get full year number in excel itself.

Regards,

Durgesh.

Former Member
0 Kudos

Thank u Durgesh for your valuable suggestion, I will try to change this.