in code/src/main/java/DataProviderSM37.java [36:114]
public void getData() throws JCoException
{
try
{
JCoContext.begin(config.destination);
//PART1 (LOGIN)
//METRIC
String SessionID = "";
//IMPORT
HashMap<String, Object> importParametersT = new HashMap<String, Object>();
importParametersT.put("EXTCOMPANY", "AWS");
importParametersT.put("EXTPRODUCT", "AWS");
importParametersT.put("INTERFACE", "XBP");
importParametersT.put("VERSION", "1.0");
//EXECUTE
JCoParameterList exportParametersT = utils.execute("PARAMS", importParametersT, rfc0, prefix+"_Login", frequency);
//EXPORT
if(exportParametersT != null)
{
String sessionId = exportParametersT.getString("SESSIONID");
System.out.println("XBP SESSIONID: "+sessionId);
}
//PART2 (READ)
//METRIC
Integer cancelledJobs = 0;
//IMPORT
HashMap<String, Object> importParameters = new HashMap<String, Object>();
importParameters.put("EXTERNAL_USER_NAME", "AWS");
HashMap<String, Object> job_param = new HashMap<String, Object>();
job_param.put("JOBNAME", "*");
job_param.put("USERNAME", "*");
job_param.put("FROM_DATE", config.system_date);
job_param.put("TO_DATE", config.system_date);
job_param.put("FROM_TIME", "00:00:00");
job_param.put("TO_TIME", "23:59:59");
job_param.put("ABORTED", "X");
importParameters.put("JOB_SELECT_PARAM", job_param);
importParameters.put("SELECTION", "ALL");
//EXECUTE
JCoParameterList exportParameters = utils.execute("TABLE", importParameters, rfc, prefix+"_Select", frequency);
//EXPORT
if(exportParameters != null)
{
cancelledJobs = exportParameters.getTable("SELECTED_JOBS").getNumRows();
System.out.println("Cancelled Jobs: "+cancelledJobs);
//COLLECT & SUBMIT
utils.collectResultEmbedded(config.destination_name, prefix+"_CANCELLED_JOBS", (double) cancelledJobs);
utils.submitResultsEmbedded(prefix);
}
}
catch (AbapException ex)
{
throw new RuntimeException(ex);
}
catch (JCoException ex)
{
throw new RuntimeException(ex);
}
catch (Exception ex)
{
throw new RuntimeException(ex);
}
finally
{
JCoContext.end(config.destination);
}
}