cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction calling using JavaScript

former_member8532
Participant
0 Kudos

Hello,

I have a requirement. I am calling an IGrid applet. The grid applet displaying the content in a table.

The user is selecting the row and the row content should have be been retrieved and send as input parameter for a Transaction . The transaction is an RFC call.

The one return value (Suppose XYZ)of RFC will replace the selected row one column (cell ) content with XYZ and display in the grid.

My questions are.

1. How to call /execute the transaction and get the returned value in Javascript?

2. How to replace the content of a cell of the selected table?

Regards.

Anshul

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Anshul,

1) You can make use of jQuery.ajax() function to call your transaction from your irpt or html or js. Just pass the following runner URL to the jQuery's ajax function:

http://<host>:<port>/XMII/Runner?Transaction=<Transaction path>&<InputParamName>=<InputParamValue>&OutputParameter=<OutputParamName>&session=false&content-type=text/xml

This will return the result of your transaction as xml, Parse through this xml and get your desired value as string.

2) To replace the cell value, make use of the javascript functions on the grid object as,

yourAppletName.getGridObject().setCellValue(int Row, int Column, String Value)

Similarly, to pass your cell value to the transaction as its input parameter while making the ajax call, make use of getCellValue(int Row, int Column)

Hope this will solve your doubt.

Regards,

Rutika Bodas