in code/src/main/java/Config.java [78:112]
public void getSystemTime() throws JCoException {
final long startTime = System.currentTimeMillis();
System.out.println("Executing RFC 'BDL_GET_CENTRAL_TIMESTAMP'...");
JCoDestination destination = JCoDestinationManager.getDestination(this.destination_name);
JCoFunction function_config = destination.getRepository().getFunction("BDL_GET_CENTRAL_TIMESTAMP");
if(function_config == null) {
throw new RuntimeException("RFC 'BDL_GET_CENTRAL_TIMESTAMP' not found! Check the SAP user authorization and required SAP release!");
}
try
{
function_config.execute(destination);
}
catch (AbapException e)
{
System.out.println(e.toString());
throw new RuntimeException("Connection lost: " + e.toString());
}
System.out.println("RFC 'BDL_GET_CENTRAL_TIMESTAMP' finished!");
java.util.Date system_day = function_config.getExportParameterList().getDate("TAG");
java.util.Date system_time = function_config.getExportParameterList().getTime("UHRZEIT");
system_date = Utils.copyTimeToDate(system_day, system_time);
System.out.println("SAP System Time: " + system_date);
final long elapsedTime = System.currentTimeMillis() - startTime;
System.out.println("PING: " + elapsedTime + " ms");
}