cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in passing parameter values to Xacute query from MII html page for a

Former Member
0 Kudos

Hi,

I am facing issue in passing the parameter values to the webservice transaction through the Xacute Query.

My requirement is to invoke the SAP ME webservice through MII by passing the arguments to the webservice from the webpage to the Xacute Query where in the Xacute query is invoking the webservice transaction.

While I hardcode the values in the Xacute query and execute the webservice it is working fine.

But while I pass the values from the webpage to the Xacute query parameter, i am facing issue where in the call was not executed and no action has been happened. I am not even getting the alerts after the statement of setting the parameters.

Find below my code.

<HTML>

<HEAD>

<TITLE>Invoke webservice</TITLE>

<SCRIPT language="JavaScript">

function testwebservice(){

alert("insidewebservice callmethod");

document.webserviceCall.getQueryObject().setParam(1,"PI04");

alert("TEST");

alert(document.webserviceCall.getQueryObject().getParam(1,"Site"));

document.webserviceCall.getQueryObject().setParam(2,"TESTA9");

alert(document.webserviceCall.getQueryObject().getParam(2,"SFC"));

document.webserviceCall.getQueryObject().setParam(3,"1");

document.webserviceCall.getQueryObject().setParam(4,"404");

document.webserviceCall.getQueryObject().setParam(5,"test immediate hold
webservice");

document.webserviceCall.getQueryObject().setParam(6,"DEF_FHOLD_RC");

document.webserviceCall.getQueryObject().setParam(7,"MESYS");

document.webserviceCall.getQueryObject().setParam(8,"DevSAPME52");

alert("result::"+document.webserviceCall.executeCommand());

}

</SCRIPT>

</HEAD>

<BODY>

<APPLET NAME=" webserviceCall "
CODEBASE="/XMII/Classes" CODE="iCommand"
ARCHIVE="illum8.zip" WIDTH="1" HEIGHT="1"
MAYSCRIPT>

<PARAM NAME = "QueryTemplate"
VALUE="Default/MYProject/Transaction/SFCImmdhold_ExQuery">

</APPLET>



<input type="button" id="GetShopor"
value="FetchSFC's" onClick="testwebservice()">

</HTML>

Kindly help me out in solving this issue.

Thanks for your support in advance.

Note: the MII version which I am using is 12.2 and 12.0 in both
the environments I am facing this issue.

regards,

Senthil

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Thanks for all your support.

It finally worked. instead of using the icommand, i tried with igrid and invoked the execute query by passing the values and updating the igrid.

regards,

Senthilmanivenkatesh.B

former_member211944
Active Participant
0 Kudos

Hi Senthil,

Manoj is correct.

Use document.webserviceCall.getQueryObject().setParam(1,"Site") for setting the parameters in the query object.

I replicated your scenario and it worked fine for me.

I had used the following code :

document.test.getQueryObject().setParam(1,"Enterprise");

alert(document.test.executeCommand());

I got "true" in the alert.

Hope this solves your problem.

Regards,

Rohit Negi.


Former Member
0 Kudos

Hi Rohit,

Can you please let to me know like in which version of MII you tried this.

I tested in MII 12.1 environment

regards,

Senthilmanivenkatesh.B

Former Member
0 Kudos

Dear Senthil,

I had also faced this issue with 12.1 and that is why I asked you to trace the parameters in the transaction when it is called from the webpage using 'Write File' action block in 'File I/O' category.

If the parameters are not passed to the transaction, then try passing the parameters in between single quotes from your webpage and remove the single quotes in your transaction. This is how I had resolved this issue, I was not able to figure out the exact problem as it was not consistent but the solution I told worked for me.

Warm Regards,

Anuj

former_member211944
Active Participant
0 Kudos

Hi Senthil,

I tried out this in MII 14.0 SP2.

I would try to replicate the scenario in MII 12.1 and let you know if i find something.

Regards,

Rohit Negi.

Former Member
0 Kudos

Hi Anju,

I tried it, but its not passing the values, where as if i get the parameter value which i am setting, its working and i am to view the values which i am setting to the parameters.

regards,

Senthil

Former Member
0 Kudos

Hi Senthil,

This likely seems to be the same issue I had faced.

Can you try passing these parameters in single quotes. e.g:

var sampleParam = "abc";

sampleParam = " ' " + sampleParam + " ' "; // Including spaces for clarity

document.CommandApplet.getQueryObject().setParam(1,sampleParam);

or

document.CommandApplet.getQueryObject().setParam(1," ' "+sampleParam+" ' "); // remove spaces

and then remove these single quotes in your transaction.

This worked fine for me, hope it works for you too.

Warm Regards,

Anuj

Former Member
0 Kudos

Hi Senthil,

After looking your code, I can suggest one thing please update getParam script in your java script

alert(document.webserviceCall.getQueryObject().getParam(1,"Site"));

alert(document.webserviceCall.getQueryObject().getParam(1));

alert(document.webserviceCall.getQueryObject().getParam(2,"SFC"));
alert(document.webserviceCall.getQueryObject().getParam(2));

getParam(int ParamNumber): in getParam method you have to pass only Param Number

sometimes if you call wrong method than complete java script wont work that could be the reason for your alert issue you can check for errors in ie ooter left corner.

Below is the URL for basic query template pameter reference.

http://help.sap.com/saphelp_xmii115/helpdata/en/applet_reference_details/ParameterReference.htm

Hope it helps!!

Regards,

Manoj Bilthare

Former Member
0 Kudos

Hi Manoj ,

Thanks for your response.

I tried out even after removing the code

alert(document.webserviceCall.getQueryObject().getParam(2,"SFC");

but still its not working.

Actually the problem which I am facing here is only in the case fo passing the values to the Xacute query from the webpage. But I am able to pass the values to the parameters of sql query templates in the same manner and its working fine.

Also in the case of passing the parameter values to Xacute query, i am not getting any errors. Hence i got strucked off.

regards,

Senthilmanivenkatesh.B

Note: the version i am working on is MII 12.1 and not 12.0. Appologize for the mistake

Former Member
0 Kudos

Hi Senthil,

Can you try tracing these parameters in a text file in your transaction when you pass them from web page. This is just to make sure whether the parameters are actually passed to the transaction or not.

Warm Regards,

Anuj