cancel
Showing results for 
Search instead for 
Did you mean: 

Date format in Flat files

Former Member
0 Kudos

Hello Experts,

I have a flat while with date format as

9/26/2005, will it create any problem while loading this flat file data.

Bw takes the data format as yyyymmdd, if so how do i conver the mm/dd/yyyy to the bw format before loading the data from flat files.

Thank You,

John

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

U can go in the transfer routine, click on function, choose date functions, then select function 0DATE, give the date format u desire, and then load data.

hope this helps.

assign the points, if it helps.

Former Member
0 Kudos

As far as my first question i got through it but i had one more field in my flat file while actually is a time field, but in my flat file i have a data in this format

12/30/1899 08:30:00.000 which i need to change to 8:30

I am trying to change this but it is not allowing me.

one more note is i have some of the fields as [NULL] in this field

ZBGNTIME

12/30/1899 08:30:00.000

12/30/1899 08:30:00.000

[NULL]

[NULL]

12/30/1899 08:30:00.000

sO I WANT IT TO BE DISPLAYED AS 8:30 AND THE [NULL] AS IT IS.

Former Member
0 Kudos

Hi,

You can process this in the transfer rules. How to process it depends on the format of your flat file. Is it a fixed width file? (e.g column 1 is 35 chars long, column 2 is 10 chars long etc.) or is it a CSV (with separator)? In any case assuming the your time field is named "TIME_FIELD" in the datasource/trans. strucute tab then you can use an ABAP/routine similar to the following:

  • we default to "NULL"

clear result.

  • Delete any spaces in the left of the time field.

shift TRAN_STRUCTURE-TIME_FIELD left deleting leading space.

if not TRAN_STRUCTURE-TIME_FIELD is initial.

result = TRAN_STRUCTURE-TIME_FIELD+0(5).

endif.

Former Member
0 Kudos

hi john,

use transaction su01 and see which format of date and time is acceted by the system, if u dont have the access to the tcode then ask basis people to do for u is is simple

Former Member
0 Kudos

Hi John,

Goto the Transfer rules -> Datasource/Trans str tab -> Details -> For your date choose the conversion option "PDATE" or the appropriate conv routine.

Bye

Dinesh

Former Member
0 Kudos

John

As far as I know you need to change your CSV file in to YYYYMMDD.

Thnaks

Sat

Former Member
0 Kudos

Thanks guys i found the solution

Former Member
0 Kudos

Hi John , I have exactly same issue the format in CSV is "4/18/2006" and I get the error that " 418200 of characteristic 0Date is not a number with 000008 Spaces.

Can you please share how did you resolve your issue.

Thanks

Sarah

muhammadalimohsin
Participant
0 Kudos

hi John,

Can you please tell me how you solved the Date issue as i am facing the same porb.

Thanks in adv

Mo