cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Transaction executes twice

Former Member
0 Kudos
286

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.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

That makes sense Rick. I am using a Grid as well. So, how to go about fixing it without getting rid of the grid? I need the grid dispaly because I am using the getCellValue() function to pick certain cells and displaying them in different fields. Thanks.

Regards,

V M.

Former Member
0 Kudos

Hi ,

From iCommand also you can get the values...

document.<appletName>.getValue(ColNo, RowNo)...

hope this helps....

Regards,

Kishore

jcgood25
Active Contributor
0 Kudos

Map your Display Columns in the iGrid template and you shouldn't have the query executed 2 times.

Regards,

Jeremy

Former Member
0 Kudos

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

Former Member
0 Kudos

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

jcgood25
Active Contributor
0 Kudos

InitialUpdate is not a valid parameter used by the iCommand, so adding the param line to an applet is meaningless since the iCommand only runs the underlying query when the .executeCommand() method is called.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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