cancel
Showing results for 
Search instead for 
Did you mean: 

icommand in MII15.0 SSCE

Former Member
0 Kudos

Hi,

MII version 15.0 SP5 Patch4. In MII 15.0 version, since there is no i5Command, I though of using icommand applet.

I created a query template (Fixed SQL query)

I configured a displaytemplate with icommand.

I placed an icommand applet in webpage through workbench as I can't edit SSCE source code just before </body> tag.I gave applet name as iCmdpartno

in the javascript function, when I code as

//querytemplate has 1 input parameter

iCmdpartno.getQueryObject().setParam(1,partno);  

iCmdpartno.executeCommand();

I am getting the following error.

Uncaught ReferenceError: iCmdpartno is not defined.

How to place an icommand applet in SSCE?

Is there a way to execute querytemplate with out using iCommand?

Regards,

Naga.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can use the following way to Run Query or Transaction from SSCE without a iCommand applet.

In SSCE just add the below code in the function where you wanted to run the Query/Transaction.

For Transaction:

$.ajax({

            type: 'POST',

            url: '/XMII/Runner?Transaction=<Transaction Path>&content-type=text/json',

            success: function(data) {

               alert("Transaction ran successfully");

          } // Success Function

            });   // Ajax Call

For Query:

$.ajax({

            type: 'POST',

            url: '/XMII/Illuminator?QueryTemplate=<Query Path>&content-type=text/json',

            success: function(data) {

               alert("Query executed successfully");

          } // Success Function

            });   // Ajax Call

Regards,

Sriram

Former Member
0 Kudos

Hi Sriram,

Thank you for the reply. If I want to pass parameters , Do I need to pass parameters through URl? and how to get the values by columns (like getValue(1,1) ) after executing query or transaction?

Can you give me an example how to pass parameters and to get values back?

Regards,

Naga.

Former Member
0 Kudos

Hi Naga,

Parameters are passed in url. Refer :

https://scn.sap.com/thread/3492027

Thanks and regards,

Ruchi Agrawal

Former Member
0 Kudos

You can get the results like this as the format is JSON

data.Rowsets.Rowset[0].Row[0].LotNumber

Regards,

Sriram

Former Member
0 Kudos

Hi Sriram,

Thank you for your help.

Regards,

Naga.

Former Member
0 Kudos

Hi Sriram,

If the output of the querytemplate is not null then

data.Rowsets.Rowset[0].Row[0].LotNumber   ---> gives value.


If the output of the querytemplate is null then

data.Rowsets.Rowset[0].Row[0].LotNumber  -- > gives error.


Unable to get property '0' of undefined or null reference


Even if I take this LotNumber in to variable and check( if  condition)  for null after this statement, it throws error as it is not even reaching If condition.


Is there any way to handle this?


Regards,

Naga.

saivellanki
Active Contributor
0 Kudos

Hi Naga,

Do a check in success condition of AJAX. Something like this:


var oResult = data.Rowsets.Rowset[0].Row;

if(oResult){

  var oLotNumber = oResult[0].LotNumber;          // Get Lot Number

}else{

  //doNothing

}

Regards,

Sai Vellanki.

saivellanki
Active Contributor
0 Kudos

Hi Sriram,

Does BLS Runner service supports response in JSON format? I didn't knew this, is this introduced recently / is it available from long time?

Regards,

Sai Vellanki.

Former Member
0 Kudos

Hi Sai,

Thank you for your help . It worked.

Regards,

Naga.

Private_Member_14935
Active Participant
0 Kudos

Hi Sai,

BLS Runner service doesn't support json format.

Best Regards,

Ria

Answers (0)