cancel
Showing results for 
Search instead for 
Did you mean: 

PO date based on country

former_member183906
Active Contributor
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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



iaki_vila
Active Contributor
0 Kudos

Hi,

In my opinion the best is to configure the different time hour difference per country in a value-mapping. To choose the best way to do a value-mapping check this document:

Regards.