cancel
Showing results for 
Search instead for 
Did you mean: 

Date conversion in PI Mapping

Former Member
0 Kudos

Hi Guys,

              I need to convert the date from 01-Jan-2011 to 20110101, which is YYYYMMDD conversion.

is it possible to do it using standard node functions or do I have write user defined java code to do this. if its the case.. Could you please provide me some sample code snippet.

Thanks

Sam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

hi sam vel,

that is very simple by using standard function "DateTrans" of DATe function group

source field -> dateTrans -> target field

click on Date trans:

input date format : 01-Jan-2011 u have to select date like ddMMyyyy and separator '-'

output date format : 20110101 u have to select only yyyyMMdd and separator blank.(based on ur requirement)

Former Member
0 Kudos

Hi.. it don't work.. it will work only when you give 01-01-2011 to 20110101.

I checked its throwing error.

Runtime exception when processing target-field mapping /ORDERS05/IDOC/E1EDK03/DATUM; root message: Unparseable date: "01-Jan-2011"

Former Member
0 Kudos

Hi Sam,

Use the following entires in date trans function. This works.

regards,

Aravind

Former Member
0 Kudos

Hi Aravind,

                  I used the same way you mentioned still getting error.. Please find the screen shot

Shabarish_Nair
Active Contributor
0 Kudos

check your settings again... it works using the standard function itself

Former Member
0 Kudos

Hi Vijayakumar,

                         I think it might work with 7.3 I am in still 7.1.

not sure is there any other setting I have to check to make it work..!!

Cheers

Sam

Shabarish_Nair
Active Contributor
0 Kudos

the screenshots i posted was from 7.1

Answers (2)

Answers (2)

Former Member
0 Kudos

HEY SORRY ...THAT IS POSSIABLE WITH STANDARD FUNCTION DATE TRANS BUT NEED TO WITE LOGIC BEFOR USING DATE TRANS.

SOURCE FIELD -> SUBSTRING(O,3)->  CONCAT ->

SOURCE FIELD -> SUBSTRING(3,6)->FIXVALUES-> CONCAT ->

SOURCE FIELD -> SUBSTRING(6,11)->  DATETRANS -> TARGET FIELD

FIXVALUES:

JAN -O1

FEB-02

MAR-03

|

|

|

DEC - 12

NOTE: DOUBLE CLICK ON PIC DATE.JPG

Former Member
0 Kudos

Thanx guys.. solved.

Former Member
0 Kudos

Hi Sam,

    You can use simple date transformation. First you need to be sure what is the format that you'll be getting from source side and and target side transformation that needs to be done.

Hope this helps : http://www.saptechnical.com/Tips/XI/Date/Conversion.htm