cancel
Showing results for 
Search instead for 
Did you mean: 

Handling the Timezone using UDF in Message mapping

0 Kudos

Hi Experts,

After searching forums and blogs, it has been decided to write UDF for the Time stamp. I have the requirement for the target looks like YYYY-MM-DDThh:mm:ss: 00Z, hereu2019Tu2019 separates the date from the time. I had tried with standard functions using "CurrentDate or DateTransformationu201D provided by Graphical Mapping Editor, but no luck. Please let me know how to write UDF to reach my requirement.

Scenario: SAP ECC6.0 (ABAP Proxy) >PI>Ariba. Date Conversion should takes place at PI Graphical mapping and source Date format should be standard SAP ECC.

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

there is a good amount of sample date formatting code here - http://javatechniques.com/blog/dateformat-and-simpledateformat-examples/

refer to write your UDF

Answers (4)

Answers (4)

0 Kudos

Hi Anupam,

I'm getting only date field from SAP ECC and for timestamp and timezone we are using UDF in graphical mapping.

Thnkx.

anupam_ghosh2
Active Contributor
0 Kudos

hi Sreemannarayana,

Can you please kindly clarify some doubts. The date and time are provided as input from source or you have to generate it within UDF?

regards

Anupam

0 Kudos

Hi Stefen,

Thnkx for quick reply, Am getting date from SAP ECC(I mean source strucrure will be getting the date value from SAP ECC). So not possible to use CurrentDate as input to the tearget.Help me writing the UDF for the requirement and timezone should also be converted as PI runtime.

Former Member
0 Kudos

Hi

Try this


        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        String strdate = ""; 
        strdate =sdf.format(yourdate);
        return strdate;

stefan_grube
Active Contributor
0 Kudos

As the T is not possible for separator, you can do following:

CurrentDate - concat(T) - CurrentDate - target

first CurrentDate gives back the day, second the time