on 2008 Jul 23 9:40 PM
Hi All,
I am performing SAP production order confirmations in xMII. The transaction works fine except it executes twice. I am sure this is something to do with my JavaScript. This is the first time I am using applets (Xacute query & display query) in my JavaScript. Earlier I tried with .irpt and iframe method and it executed only once. Could somebody please tell me what might be wrong in my script. Thanks in advance.
Regards,
V M.
Request clarification before answering.
You are a good man. Finally, I used the 'if' statement on 'applet.executeCommand()' object and it worked. I want to thank you all for your patience and help me learn a great deal about xMII. You are all excellent.
Regards,
V M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you link a query to a grid, the query will often be executed twice - once to determine the column metadata and once to load the actual data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you explicitly assign the columns in the column definition tab of the iGrid template editor, it should not attempt the "column lookup".
Also, do you really need an iGrid, or could a hidden iCommand applet do the job? In general, if you are writing data via a SQLQuery or XacuteQuery template, you should use an iCommand applet, not a chart or grid applet.
Rick
I guess you are reading the production order number and operation or the confirmation number from a grid and passing those as a parameter to your Xacute query to confirm the production order.
In that case you need to have an Xacute query that calls the BLS based on the selection in the grid to do the confirmation.
The iCommand applet for the xAcuteQuery should look like (remember to set the InitialUpdate to False):
<applet name="ConfirmPO" width="1" height="1" code="iCommand" codebase="/Illuminator/Classes" archive="illum8.zip" mayscript>
<param name="QueryTemplate" value="PP/Query/ProductionOrderConfirmation">
<param name="InitialUpdate" value="false">
</applet>
and execute the Xacute query by passing the required parameters.
Thanks,
John
Ok, I am using the iCommand applet now. But, my webpage still gives me an error. My script has a function that looks like -
function JCOCall2(f){
document.GetDataApplet2.getQueryObject().setParam(1, f.txtCode6.value);
document.GetDataApplet2.getQueryObject().setParam(2, f.txtCode7.value);
document.GetDataApplet2.getQueryObject().setParam(3, f.txtCode8.value);
document.GetDataApplet2.getQueryObject().setParam(4, f.txtCode9.value);
document.GetDataApplet2.getQueryObject().setParam(5, f.txtCode10.value);
document.GetDataApplet2.getQueryObject().setParam(6, f.txtCount2.value);
document.GetDataApplet2.getQueryObject().setParam(7, f.txtCount3.value);
document.GetDataApplet2.getQueryObject().setParam(8, f.txtCount4.value);
document.GetDataApplet2.getQueryObject().setParam(9, f.txtCount1.value);
document.GetDataApplet2.getQueryObject().setParam(10, f.txtDate1.value);
document.GetDataApplet2.getQueryObject().setParam(11, f.txtDate2.value);
f.SAPSuccess4.value = document.GetDataApplet2.getSelectedCellValueByName("OutputMessage")
f.SAPSuccess5.value = document.GetDataApplet2.getSelectedCellValueByName("ConfirmationNumber")
f.SAPSuccess6.value = document.GetDataApplet2.getSelectedCellValueByName("ConfirmationCounter")
}
Are there any mistakes in it?
Regards,
V M.
Hi,
I think that GetDataApplet2 is an iCommand...
then after assigning the parameters, you should execute the iCommand..
check the help file for iCommand..
In My previous post and Jeremy's post, we have mentioned to use the executeCommand() method.. use that...
One more point, you can't use the getSelectedCellValueByName method...
You can use the getValueByName(ColName, rowID)...
You cannot select any row in the iCommand.
If the result set is returning only one row, you can use the
getFirstValue(ColName)
Regards,
Kishore
Hi,
There is nothing called display query.
You need to map your Xacute query in your display template.
Save the template.Then come to Dynamic Pgae Generator from Visualization Services in xMII menu page.Then select your respective Query Template and Display Template and generate the applet.Do view Source and get the code.Paste the code in your HTML page under body tag.
It will be like this:
<body>
<APPLET NAME="Applet" CODEBASE="/Illuminator/Classes" CODE="iChart" ARCHIVE="illum8.zip" WIDTH="800" HEIGHT="400" MAYSCRIPT>
<PARAM NAME="QueryTemplate" VALUE="FillingArea/SampleQuery">
<PARAM NAME="DisplayTemplate" VALUE="FillingArea/SampleChart">
</APPLET>
</body>
Thanks,
Manisha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
can u give some detailed information about ur js.
normally, if we want to execute a transaction in the web pages using js, we just call the Xacute Query.
so ur applet should consists of iCommand and ur Xacute Query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am not sure what exactly you are doing....
By Calling the Xacute Query you are executing the Transaction once... I am not very clear about the display query.
The method I follow is...
1. Create a transaction to hit the SAP and confirm the production orders with necessare input parameters in the transaction parameters
2. Call the transaction the Xacute query.
3. Assign the transaction Input parameters to the Params in the INPUT PARAMS tab.
4. Call that Xacute Query in the iCommand Applet.
5. Excute the iCommand through java script after assigning all the params when you hit the confirmation button
document.<AppletName>.executeCommand()
Regards,
Kishore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.