cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Applet for passing values dynamically from web page to sap xMII

Former Member
0 Kudos

I have just started learning xMII but facing problem in passing values of parameters like rangeLow, rangeHigh, etc dynamically from web page to sap xMII 12.0. I have referred many web page examples in the Module Library template on SDN, but not getting exact solution.

Applet using an irpt extension. I am using Xacute query. Below is some part of code containing calling of required function on buttonClick event and Applet for dynamic paramter passing. Kindly correct me if any part is incorrect or missing.

Simillarly in queryTemplate some default values has been maintained in propertyDetail Value and TransactionDetails Param values. Is this correct method?

Edited by: Anand G Saraswat on Apr 25, 2011 6:56 PM

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Anand,

I would highly recommend downloading one or two of the projects available in SDN. Not only do they contain a lot of valuable techniques, but there are quite a few which have the type of functionality that you seek. The function module libraries and the Batch Manufacturing project are both full of good features to utilize.

Regards,

Mike

Former Member
0 Kudos

Thanks Michael,

I have already downloaded some projects available on SDN and studying that only. No doubt, they are useful. Still facing above mentioned problem. This is some part of coding, kindly correct me, if any part is incorrect or missing.

function getList() { if (validateForm()) { var df = document.frmMain; var Orders = document.Orders;

var OrdersQuery = Orders.getQueryObject(); OrdersQuery.setParam(4,df.cbMaterialRange.checked)

OrdersQuery.setParam(5,df.txtMaterialHigh.value); OrdersQuery.setParam(6,df.txtMaterialLow.value);

OrdersQuery.setParam(7,df.optMaterialOption.value); OrdersQuery.setParam(8,df.optMaterialSign.value);

OrdersQuery.setParam(14,df.OrderType.value); OrdersQuery.setParam(15,df.Plant.value);

Orders.updateGrid(true); } }

Also part of applet contains :

<applet name="Orders" codebase="/XMII/Classes" code="iGrid" archive="illum8.zip" width="708" height="156" mayscript="" id="Orders"> <param name="QueryTemplate" value="PPPI_Test/UI/ProcessOrderList_Query">

<param name="DisplayTemplate" value="PPPI_Test/UI/ProcessOrderList_Grid">

<param name="Param.5" value=""> <param name="Param.6" value="">

<param name="Param.7" value=""> <param name="Param.8" value="">

<param name="Param.14" value=""> <param name="Param.15" value="{Plant.value}">

<param name="InitialUpdate" value="FALSE">

Thanks,

Anand

0 Kudos

Hi Anand,

That looks good, but can you also provide the script in the Query?

If, in the Query Template, you are using Query mode (query builder), can you change it to Fixed Query (straight scripting)? Then provide the complete script which is failing.

The Param properties need to have single quotes on the outside of the text or date properties in the sql script. (i.e.

'[Param.1]'

)

You may also have some issues with dates depending upon the default format for the connection, but that is usually less of an issue.

Regards,

Mike

Edited by: Michael Appleby on Apr 26, 2011 12:47 PM

Former Member
0 Kudos

Hi Mike

I got the output. Yes, I am using Query mode in QueryTemplate, I havnt found any FixedQuery Mode option in that.

In ParamProperties you are talking about to have single quotes on the outside of text or date but then it is not working. I have used double quotes here.

But yes Mike, you are right, having some issues with dates depending upon the default format. Some records are not displaying whereas last field i.e. confirmedQty also not displaying its value properly. Which settings needs to be maintain for date format??

Regards,

Anand

0 Kudos

Hi Anand,

Please provide the default date format, the date as you are trying to pass it from the UI, a copy of the sql script in the query template, and the date format of the data.

Also does the query template work when run by itself from the workbench?

I noticed that you do not define a date range from your javascript function. Are you using a duration setting for the date range?

Regards,

Mike

Former Member
0 Kudos

Hi Mike

Where should i provide default date format. Query template working when run by itself from the workbench but not getting few records in the output by running from the workbench and same with web page also. Yes, I have not define a date range javascript function. Some default date settings needs to be maintained. I have maintained it in QueryTemplate-->startDate of MappedInput and endDate of MappedInput, but still it is not displaying few initial records. And also ConfirmedQty values also not properly displaying. Where should I maintain Date settings. I have tried it in DateRange also but of no use.

Regards,

Anand

0 Kudos

Please put the requested information here in the forum thread.

Regards,

Mike

Former Member
0 Kudos

Hi Mike,

I have provided all the information that you have asked in the forum regarding question. Which extra information i need to put here?

Regards,

Anand

0 Kudos

What is the date format for the data server (database)? i. e. MM/

DD/YYYY or some such

What is the SQL Script in your query template? i.e.



Select * from XYZ where startdate = '[Param.1]' and enddate = '[Param.2]' 

If your Xacute Query does not involve an SQL Query action block, from where are you retrieving your data?

Regards,

Mike

Edited by: Michael Appleby on May 1, 2011 3:23 PM

Former Member
0 Kudos

Date format is YYYY-MM-DDT00:00:00 eg. 2011-01-01T00:00:00

I have not found any SQL Script in my Query Template. How i m retrieving data that code i have already posted in the forum. I am maintaining some values in TransactionPropoerty, then in QueryTemplate-->TransactionDetails some values are passing. Interface is done by Applets of which code is already posted.

I am new to SAP xMII. How to use SQL Query action block or the way i m using for data retrieval is correct?

Regards,

Anand

0 Kudos

Hi Anand,

The applet in your web page has a query template identified. That query template is of type Xacute. The Xacute query is a wrapper around an MII transaction. You should be able to get the name of the transaction from within the Query Template if opened within the MII workbench.

If you open up the transaction, you will be able to see the transaction properties as well as the sequences which contain one or more action blocks. The data for your orders will either come from a database or as is more likely in your case, from a BAPI or RFC pulling order information from an ECC system.

The transaction properties need to be populated by the query template from the applet in order for the transaction to retrieve the data you require. At some point within this flow, you are not receiving the data back in the UI (If I understand the issue properly).

I would recommend using tracers to see if the data being passed from the applet is making it to the transaction and also whether the data is being returned from ECC (if that is the source).

Good luck!

Regards,

Mike

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Anand,

Is your problem solved? I assume not, because the question is still open.

it seems from above discussion that you are mixing multiple approaches. I would suggest you to keep it simple first.

Most of the times your Javascript code is the culprit.I have realized over time that MII is a bit moody and its behavior may vary with the MII version, Patch level, Your browser and a lot more things. So its advisable to keep it straight and simple.

for instance, try using getElementById instead of directly using the document object name. this will rarely cause any issue.

If your prob is not yet solved then can you please mention which portion is not working now. Since you mentioned somewhere above that you are getting output now, so where are you stuck now and till what point you are done?

Thanks

Piyush Govil

Former Member
0 Kudos

Hi Piyush,

Thanks for the reply..but my problem is solved, stil ur reply also worth useful.