lundi 29 décembre 2014

Run JavaScript Script snippet automatically


I want to run a script snippet on the SAP BO "Query Builder", it's a simple tool to retrieve data using SQL. (I can't upload the image due to the reputation, the product's interface can be found here: http://scn.sap.com/docs/DOC-42952)


Since I have a bunch of queries to run, I want to use snippet to run them automatically. Using the following code:





//select the textarea to insert retrieved queries
document.querySelector("textarea").textContent = "SELECT * FROM CI_INFOOBJECTS";
//click the submit button
document.getElementsByTagName('input')[0].click();
//code to export the query result
//after click(), the page reloaded and it won't executed the following code.
document.addEventListener("DOMContentLoaded", function() {
//back to the previous page, run the previous code again
window.history.back(1);
}, false);



Does anyone have good ideas how to implement it? Thanks for your help.


Alan





Aucun commentaire:

Enregistrer un commentaire