on 12-02-2014 7:37 AM
hi
the scenario is order is created from web and sent to SAP for PO creation. SOAP to RFC scenario.
the requirement is if order is for country USA, the PO date should be USA date. The PO date of SAP should be current date & time of the country. The country may change and it will come in input to PI.
how can we send the date based on country to SAP. how this can be achieved in PI mapping.
rgds
Hi,
Here is the sample code for your reference.You need to modify the below code a bit as per your requirement .
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
/**
* Simple Java program to convert local time into GMT or any other TimeZone in Java
* SimpleDateFormat in Java can be used to convert Date from one timezone to other
*/
public class TimeZoneConverter {
public static void main(String args[]) {
//Date will return local time in Java
Date localTime = new Date();
//creating DateFormat for converting time from local timezone to GMT
DateFormat converter = new SimpleDateFormat("dd/MM/yyyy:HH:mm:ss");
//getting GMT timezone, you can get any timezone e.g. UTC
converter.setTimeZone(TimeZone.getTimeZone("GMT"));
System.out.println("local time : " + localTime);;
System.out.println("time in GMT : " + converter.format(localTime));
}
}
Output:
local time : Wed Apr 11 05:48:16 VET 2012
time in GMT : 11/04/2012:10:18:16
NOTE:
You need to give "GMT" or country name as input paramter .Take below doc as reference for this input.You can either use Value mapping/fix values/look up based on your flexibilty.
TimeZone (Java Platform SE 7 )
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.