cancel
Showing results for 
Search instead for 
Did you mean: 

MII 15 - i5SPC Display Template Rendering Issue

sidnooradarsh
Contributor
0 Kudos

Hello Experts,

System Details:

MII 15 SP03 Patch 4 and NW 7.4

UI 5 Software Component:


UISAPUI5_JAVA 1000.7.40.8.0.20140828175800


Development Components of SCA UISAPUI5_JAVA


ui~five : 7.4008.20140806095041.0000

sc~uisapui5_java : 7.4008.20140806095041.0000


In addition, the application is overall built using jQuery 1.10.1 and jQuery UI 1.10.3 plugins for User Interface development ( we are migrating from MII 14 to MII 15 and would like to replace the Applet SPC to UI5 SPC, the application was developed during early version of MII 14 so we did not use the built in SAPUI5 libraries)


I have created an i5SPC display template and have set the Specification limits, passed the values, setup the Alarms, variety of Color coding for different Limits and so on... basically prepared my Display template with various settings and color coding for limits.

Scenario description:

1) On First Run, the Query Template returns the resultset, the SPC is drawn perfectly fine on the screen with no issues.

2) On Second Run, this time my Query returns No data ( this is very natural that sometimes queries may not have any results) in this case the SPC shows as No Data which is also good.

3) Now on the Third Run, my query returns the results but this time SPC fails to render it properly.. it loses all the colors we had set in display template, the alarms, Colors for different specification limits etc. it loses as if previously when there was no data the SPC lost all the settings that was made on Display Template and couldn't get it back when results were returned on this third run.

I tried removing the destory method or making the Object blank etc etc.. but none made much difference...  One of the solutions I am thinking of is to set all the Display Properties in code explicitly each time I draw the SPC but I think this defeats the purpose of having DisplayTemplate.

Please advise with following:


1) Am I missing any piece of code?

2) What is the correct approach of generating the SPC whenever my Inputs to Query change, Do I need to destroy the object and re-draw it or can I just update the existing object? If so please advise how to do it? ( I tried few things but no luck so decided to destroy and recreate the object)

3) Does it sound like a bug within SPC

Below are some screenshots to depict my explanation and the high level code piece used for drawing the SPC


// SelectedSPCType = 1 : X-BAR, 2: Histogram

function DrawFeatureSPCChart() {

  SelectedSPCType = $("input:radio[name='spc_type']:checked").val();

  var DisplayTemplate = "" , QueryTemplate = "<Query Template Path>";

  if(SelectedSPCType === "1") {

  DisplayTemplate = "<Display Template Path for XBAR SPC>";

  }else if(SelectedSPCType === "2") {

  DisplayTemplate = "Display Template Path for Histogram SPC";

  }

  if (typeof i5spc_feature !== "undefined" && i5spc_feature !== null) {

  i5spc_feature.destroy();

  }

  i5spc_feature = new com.sap.xmii.chart.hchart.i5SPCChart(DisplayTemplate, QueryTemplate);

  i5spc_feature.setChartWidth("500px");

  i5spc_feature.setChartHeight("240px");

  i5spc_feature.getQueryObject().setParameter("Param.1", Selected_OrderNo);

  i5spc_feature.getQueryObject().setParameter("Param.2", Selected_WorkCenter);

  i5spc_feature.draw("feature_spc_chart");

}

Run 1: Query Returns results and SPC is awesome

Run 2: When Query Returns NO Data, SPC says no Data

Run 3: When Query Returns results with Data after second run and we can see that SPC is white washed and lost all the display properties that was originally set.

Any advises are very much appreciated...

Regards,

Adarsh Sidnoor

Message was edited by: Adarsh Sidnoor

Accepted Solutions (0)

Answers (1)

Answers (1)

Private_Member_14935
Active Participant
0 Kudos

Hi Adarsh,

Let me first try to explain my understanding of your requirement: You are creating an i5SPCChart js object by configuring a DT and QT. The data from your QT keeps changing and you want to show the updated data in your chart.

In such a scenario you don't have to create a new chart object every-time. By each run do you mean you trigger a js function to re-render the chart... ? If so then in this js method you could set the required query parameters and call chart's refresh/update(true) method.

I tried a similar example and it works fine on MII 15.0 SP4.

Please try this and let me know if you still have questions.

Thanks and Best Regards,

Ria

sidnooradarsh
Contributor
0 Kudos

Hello Ria,

Thank you for your inputs.. I am not facing issue with updating the SPC with new data, Yes I initialize object once and later perform Update(true).

Basically, it works fine as long as the Query returns some data but sometimes for some inputs Query may not return the output in which case the Chart shows as No Data which is good but then in my immediate next run when I supply inputs to query which now returns some data but at this point the SPC loses all the settings that was done in display template.

For example:

Run 1: Inputs to Query is say Order = 1111 and it has data so my SPC generates good

Run 2: Input to Query is say Order = 2222 and it has no data so SPC says No Data

Run 3: Input to Query is say Order = 1111 again so it has data so SPC generates but this time it loses all its Display template properties ( as shown in my 3rd screenshot)

Lastly another issue I am facing is, setDisplayTemplate doesn't seem to work either..

Regards,

Adarsh

Private_Member_14935
Active Participant
0 Kudos

Hi Adarsh,

Thanks for providing more information, helped replicate the issue. Please open a ticket with SAP.

I checked setDisplayTemplate method, but it seems to work.

Thanks and Best Regards,

Ria