Quantcast
Channel: SCN: Message List - SAP Manufacturing Integration and Intelligence (SAP MII)
Viewing all articles
Browse latest Browse all 4841

Re: Input screen data into BLT

$
0
0

Hello Suman,

   Refer Interacting with transactions through Web Page for more details. You could either use an applet like iCommand. Then use the applet's executeComman() method to trigger the call.

 

Or you can use direct HTTP Call from the web page.

 

I have edited the source from the above post to give it a form like look.

 

Here is my source code

 

<!DOCTYPE HTML><HTML><HEAD>          <TITLE>Your Title Here</TITLE>          <META http-equiv="X-UA-Compatible" content="IE=edge">          <META http-equiv='cache-control' content='no-cache'>          <META http-equiv='expires' content='0'>          <META http-equiv='pragma' content='no-cache'>          <SCRIPT language="JavaScript">


function getXML(_url){
// code for IE7+, Firefox, Chrome, Opera, Safari
if (window.XMLHttpRequest){
  xmlhttp=new XMLHttpRequest();
} else {// code for IE6, IE5  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("POST",_url,false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
return xmlDoc;
}
// Fuction to Call the Trx defined in the Javascript Variable at the end
function startTrx(){
var url = "/XMII/Runner?Transaction=" + currTrxFullPath + "&OutputParameter=*";
var url = url + "&one="+document.getElementById('one').value;
var url = url + "&two="+document.getElementById('two').value + "&content-type=text/xml";
//alert(url);
var returnedXML = getXML(url);
//alert("XML Doc: " + returnedXML.xml); // Display the Full XML Element
currTrxId= returnedXML.getElementsByTagName('Rowsets')[0].getAttribute('TransactionID');
alert("Transaction ID: " + currTrxId); // Display the Transaction Id
alert("Output: " + returnedXML.getElementsByTagName(currTrxField)[0].text); // Display the Value Returned in the Field
}
// Javascript Variables;
var currTrxId = -1; // Currently Running Transaction Id
var currTrxFullPath = "Default/Transactions/HelloWorld_Runner_Output"; // Full Path of the Transaction as in the WorkBench
var currTrxField = "Out"; // Field to be returnd          </SCRIPT></HEAD><BODY><form>
Input 1(number): <input id = "one" type="text" name="FirstName" value=""><br>
Input 2(number): <input id = "two" type="text" name="LastName" value="Mouse"><br><button type="button" onclick=startTrx()>Add Me!</button></form></form></BODY></HTML>

 

 

 

 

 

In this example I have used the transaction to calculate sum of two numbers . The transaction takes in two parameters (one,two). The value of the input fields are passed to this parameter and appended in URL. The Output parameter Name is Out.

 

Regards

Tufale Ashai.


Viewing all articles
Browse latest Browse all 4841

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>