cancel
Showing results for 
Search instead for 
Did you mean: 

date transformation not working

Former Member
0 Kudos

sender system is sending date in this format

2013-04-22 11:13:05.000

in PI i gave the format like this yyyy-mm-dd hh:mm:ss:mmm

the same format i gave for both input and output format

in the mapping i am getting this error

Mapping "urn:xxxxxxxx" failed to execute: MappingException: Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_yyyyyyy_; Details: com.sap.aii.mappingtool.tf7.MessageMappingException; Runtime exception when processing target-field mapping /ns0:ggggggggg/date; root message: Unparseable date: "2013-04-22 11:13:05.000"

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Midhun,

You need to give yyyy-mm-dd hh:mm:ss.SSS as sender date format receiver format you can give based on your requirement.

Regards,

Praveen.

Former Member
0 Kudos

the problem is it's working when the sender system sends in the same format

yyyy-mm-dd hh:mm:ss.SSS


however at times the sender system sends like this

2013-12-24 ::.000

then it is failing in PI..

is it possible to take it and post it like 2013-12-24 00:00:00.000

or should i ask sender system to send it in the exact format without hh mm and ss missing



former_member182412
Active Contributor
0 Kudos

Hi Midhun,

Then you can use it like below.

Sender Format : yyyy-mm-dd

Target Format :  yyyy-mm-dd 00:00:00.000

Regards,

Praveen.

iaki_vila
Active Contributor
0 Kudos

Hi Midhun,

Do you really need the time sequence?, you can use the substring function and to take only the date and later apply only the date to the datetrans function.

Regards.

Former Member
0 Kudos

that is not possible.

most of the time the sender system sends data in this format yyyy-mm-dd hh:mm:ss.SSS

some odd records come without timestamp.

i told client to tell all records in proper format and they agreed

Answers (2)

Answers (2)

iaki_vila
Active Contributor
0 Kudos

Hi Midhun,

You can follow Praveen suggestio, it should work.

If you want to learn more about dateTrans function you can check this Sarvesh Singh's blog

Regards.

Former Member
0 Kudos

Hi Midhun,

PI should give the format like this to database.

yyyy-mm-dd hh:mm:ss.mmm

Thanks,
Sateesh