cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing SPC Results

Former Member
0 Kudos

Is there a way to programmatically access the contents of the SPC Results Data?

For example given a SPC chart, have a button that will read the alarms from the SPC Results and automatically send them by email to a predefined recipient.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

jcgood25
Active Contributor
0 Kudos

The emailing will need to come from within a transaction, and depending upon what aspect of the alarms you need you could either loop through the datapoints in javascript (getUpperNumberOfDataPoints / getUpperAlarmCount / getUpperAlarmAt) and send information directly into the transaction, or you could use the SPC/SQC action block (http://help.sap.com/saphelp_mii121/helpdata/en/44/600a0296d808f8e10000000a422035/frameset.htm) which produces the same resultset as the right click menu xml spc detail (multiple rowsets - alarms are found in two different rowsets, one for upper and one for lower). To use the action block you would need to pass in all of the corresponding settings for the active applet view, including any query properties or template settings that are not part of the base templates used.

Former Member
0 Kudos

Hi Jeremy,

I'm using MII Version 12.1.4 Build(36).

The SPC/SQC action block seems to have some substantial problems?

1. First, I link in the query template and SPC display template to use within the SPC/SQC block. I then set the input parameters that I want the query template to use as Param.1, Param.2, Param.3. When I test the transaction I get the following error:

[ERROR] [SPC_Analysis] Link ('SPC_Analysis.Param.2' [Assign] from "Transaction.strUnitProcedure") execution threw an exception. Exception: [Variable not found: SPC_Analysis.Param.2]

I then can not access the results of the SPC/SQC action block. This seems to occur if I try to assign any parameters to the Query Template within the Action Block.

2. If I then don't assign any variables and just hard code the values and dates within the query template and run it then it does not throw an error but a tracer with SPC_Analysis.UpperAlarmCount after the action block returns no results.

3. Finally, if I assign a startDate and endDate to the queryTemplate within the SPC/SQC transaction block and run it then it returns correctly and returns with the correct number of alarms in the UpperAlarmCount. So you can't pass parameters to the Query template in the block but you have to pass dates or they get overwritten?

4. As a sidenote, what does the TOTALDEFECTS variable supposed to return? I have 4 upper chart alarms, 0 lower chart alarms, 37 overall rows and 36 rows that have values. The TOTALDEFECTS returned the value 36. When I changed the date range it seemed to match the number of rows with values from the query template.

When I run the SPC chart within an IRPT page or the Dynamic Page generator with the hardcoded values it works fine and I have no problems.

Are these known issues and fixed in a later version of MII (12.1.5 or 12.1.6)? Is there any workarounds to be able to pass variables to a query template used in an SPC/SQC action block or do all the values except dates have to be hardcoded?

Thanks alot for the help.

Kerby

jcgood25
Active Contributor
0 Kudos

See 12.1.4 patch 2: SAP Note 1416740

Former Member
0 Kudos

Hi Jeremy,

Thanks for the help. We upgraded to SP6 and I tried the SPC/SQC action block there. It seems to have fixed the problem with the passing variables to the query templates and the other concerns, but there also seems to still be some funny behavior.

Namely, passing the dates in the action block does not effect the dates used and it only uses the Default dates in the query.

I have a query template that takes 3 parameters and a SD and ED. If the 3 parameters and dates are passed from the SQC/SPC action block and the dates are set within the query template, then it returns the results and the upper chart alarms returns the correct alarms for the dataset. If instead I pass the dates from the Transaction and do not have default dates set in the query template, then it doesn't return the correct results.

This can be worked around by passing dates as a normal parameter and changing how the query works to not use [SD] and [ED].

Additionally, another annoyance is that you can't pass parameter with single quotes around them and have the result return. Example: Param.2 is a Unit Procedure "N-1". If the query has where Unit_Procedure = [Param.2] and you pass Param.2 with 'N-2' then it doesn't throw any errors but doesn't return the correct results. Instead if the query has Unit_Procedure = '[Param.2]' and you pass Param.2 with N-2 then it works correctly.

I think right now both of these can be worked around once I realized what's broken with the action block but certainly took awhile to figure out the behavior and it'd be nice if it functioned like normal query templates in the future. We'll see how the rest of it goes.

Thanks,

Kerby