SAP ME provides a configurable feature to do data collection from the POD and record it for SFC numbers, resources, and work centers. The data collected will be stored in SAP ME WIP database which can be accessed and processed for further analysis. The collected data can be of type Numeric, Boolean, Formula, Text, and Data Field List.
In this blog, we will see how to use formula in the data collection process. When we use Formula as the DC data type, then user defined formula will be used to calculate the value for the DC parameter instead of the user keying-in the value.
High-Level Overview
- Using formula in Data collection with data collected from same DC group
- Using formula in Data collection with data collected from different DC group
- Using formula in Data collection with data being collected at different operation
Prerequisite:
- To use the data collection formula capabilities, you may need to enable the use of Java
Script on the SAP ME server.
SAP ME supports the below methods in DC formula:
- callEJB() : use this method to call the Enterprise JavaBeans
- executeQuery() : use this method to execute an SQL query on the SAP WIP database.
- findSingleParameter() : use this method with arguments to read a value. Each argument must be enclosed either with single or double quotes.
- getEJBProperties() : Use this method to retrieve one or more properties from the EJB.
- print() : Use this method to print the string value of the variable. Use it for the debugging/testing purpose only. The print result can be seen in Log Viewer (Developer Traces view).
- printAll() : Use this method to print all the variables available to the script. Use it for the debugging/testing purpose only. The printAll result can be seen in Log Viewer (Developer Traces view).
- exit() : use this method to stop the script execution.
Using formula in Data Collection:
1. Using formula in Data collection with data collected from same DC group
- Create a DC group
- Create required DC parameters (with data type as Numeric) and associate it to the dc group
- Create one parameter with data types as Formula to calculate the value
- Associate the dc group to the operation
- Open standard POD-SFC and start and stop the operation by collecting the DC
- The system automatically calculates the Volume Z_VOLUME (4th DC Parameter) using the formula L * W * H
- Verify the calculated parameter from Data Collection Results Report
2. Using formula in Data collection with data collected from different DC group
- Create DC Group Z_LENGTH (Parameter Z_LENGTH)
- Create DC Group Z_WIDTH (Parameter Z_WIDTH)
- Create DC Group Z_HEIGHT (Parameter Z_HEIGHT)
- Create DC Group Z_VOLUME (Parameter Z_VOLUME)
- All 4 DC groups must be assigned in the same operation
- From the Pod-SFC, start the SFC and collect the DC
- The user will enter the value in the 3 parameters at the same operation for Length, Width & Height
- The system automatically calculates the Volume Z_VOLUME (4th DC Parameter) using the formula L * W * H
- Verify the calculated parameter from Data Collection Results Report
Note:
To read the value of the parameter from different DC group, we will use the findSingleParameter() method.
Syntax:
findSingleParameter(“parameterName”, “this”, “itemName”, “itemRevision”, “operationName”, “operationRevision”, “resourceName”, “last”)
Example:
Z_LENGTH = findSingleParameter(“Z_LENGTH”, “this”, FG Item (with in double quotes), “*”, Operation step (within double quotes), “A”, “DEFAULT”, “last”);
3. Using formula in Data collection with data collected from different operation
- Create a DC Group Z_LENGTH (Parameter Z_LENGTH) – Assign it to operation 1
- Create a DC Group Z_WIDTH (Parameter Z_WIDTH) – Assign it to operation 2
- Create a DC Group Z_HEIGHT (Parameter Z_HEIGHT) – Assign it to operation 3
- Create a DC Group Z_VOLUME (Parameter Z_VOLUME) – Assign it to operation 4
- From the Pod-SFC, start the SFC and collect the DC
- The user will enter the value for 3 parameters – Length, Width & Height
- The system automatically calculates the Volume in Z_VOLUME (4th DC Parameter) using the formula L * W * H
- Verify the calculated parameter from Data Collection Results Report
Note:
1) To read the value of the parameter from other DC group, we will use the findSingleParameter() method:
2) Different operation name is mapped to read each of the parameter value.
Input DC values as 5 for Z_LENGTH, Z_WIDTH, Z_HEIGHT.
Conclusion:
To sum up, this blog details the use of a formula to automatically calculate the DC parameter out of the operator provided DC parameter values in various data collection scenarios.
Thank you for taking the time to read this post, and I hope this blog is useful to those who are new to SAP ME.
I look forward to hearing your feedback related to the blog, and if you need any clarification, please feel free to post your questions.