on 08-08-2016 7:24 PM
Hi Experts,
We have created a xsjs script which accepts date and time from UI5 screen for setting the xscron job dynamically.
In it, we are passing parameters for xscron as 2016 08 08 mon 17 01 00.
It gets scheduled and its status doesnt get changed to running.
In our case, this date and time would depend upon user inputs and would be dynamic.
Has anyone been able to successfully execute xsjob based on user inputs ?
Regards,
Saritha
Hello Saritha,
yes, that works. What steps have you done in your code.
An example (which can be easily enhanced to accept user input values for the schedules) is listed in the online help: Add or Delete a Job Schedule during Runtime - SAP HANA Developer Guide for SAP HANA Studio - SAP Lib...
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian,
Here is my code-
var responseBody = '';
$.import("sap.hana.xs.libs.dbutils", "xsds");
var XSDS = $.sap.hana.xs.libs.dbutils.xsds;
var myjob = new $.jobs.Job({uri:"/TEST_XSJS/demoXSJS.xsjob"});
user: '#####',
password: '#####'
});
var year = "2016";
var month = '8';
var day = '9';
var day_of_week = 'tue';
var hour = '10';
var minute = '07';
var second = '00';
var input_cron1 = year + " " + month + " " + day + " " + day_of_week + " " + hour + " " + minute + " " + second ;
var id = myjob.schedules.add({"description": "Table upd",
"xscron": input_cron1});
---------------------------------------------
this xjs calls xsjob as below-
{
"description": "test run" ,
"action": "TEST_XSJS:insertjob.xsjs::createEntry2",
"schedules": []
}
--------------------------------------------
and in here my insertjob actually enters the records in a test table.
currently the problem is job gets scheduled and gets triggered by a delay of 1 hour.
Let me know if there is anything unclear.
Regards,
Saritha
Hi Florian,
Not very clear with the UTC and local timezone part which you mentioned.
Actually, I just ran the current_timestamp and current_date function to get the time and date in hana studio and I am passing 5mins ahead time in my xscron parameters. Still it gets triggered after an hour.
Kindly suggest if I am missing on setting some additional time parameter as such on server level for scheduling as such
Regards,
Saritha
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.