Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Like this document? Why not share!

- EDM Activation of RTP Components I by Rakesh Dasgupta 4865 views
- EDM Activation of RTP Components II by Rakesh Dasgupta 3149 views
- EDM Use of RTP Interface in Rate by Rakesh Dasgupta 4489 views
- EDM Synthetic Profile in Action by Rakesh Dasgupta 4413 views
- EDM Overview of Formula Profile by Rakesh Dasgupta 4282 views
- EDM Overview of Synthetic Profile by Rakesh Dasgupta 4068 views

6,265 views

Published on

Creating Formula for Formula Profile and RTP Interface

http://wp.me/p1Ci5j-5h

No Downloads

Total views

6,265

On SlideShare

0

From Embeds

0

Number of Embeds

3,936

Shares

0

Downloads

113

Comments

0

Likes

3

No embeds

No notes for slide

- 1. ISU EDM: Creating formulas for use inFormula Profiles & RTP InterfaceThis post is about creating your own formula for use in Formula profiles and RTPInterface.Formulas are predefined by SAP.But one can define formulas with specific functions in Customizing for SAP Utilities,Tools -> System Modifications -> User Defined Enhancement for Energy DataManagement -> Formulas.For each formula, a function module needs to defined first with the following interface,CHANGINGREFERENCE (XY_CNTR) TYPE EEDMFORMULACTRREFERENCE (XY_INP) TYPE TEEDMFORMPARLIST_IREFERENCE (XY_OUT) TYPE TEEDMFORMPARLIST_OEXCEPTIONSGENERAL_FAULT.One can also use template function modules provided for this purpose.ISU_EDM_FORMULA_EASY orISU_EDM_FORMULA_XXXX.I intend to create a formula similar to LIMIT04 but with some difference.My formula has 4 input parameters and 6 Output Parameters.Input Parameters1. Measured Consumption (kwh)2. First Limit for Consumption (kwh)3. Second Limit for Consumption (kwh)4. Limit for Demand (KW)
- 2. Output Parameters1. Portion below First Limit (kwh)2. Portion above First Limit (kwh)3. Portion above second Limit (kwh)4. Net Demand (Just for Evaluation)(KW)5. Demand below Limit (KW)6. Demand above Limit (KW)So first I created a function module by copying the template function module.Here I give snippets of the code • The 4 Input Parametersedm_read_input 1.edm_read_input 2.edm_read_input 3.edm_read_input 4. • Check if Measured Consumption exceeds First Limit and then if Measured Consumption exceeds Second LimitIF xval1 > xval2. yval1 = xval2. yval2 = xval1 - xval2.ELSE. yval1 = xval1. yval2 = 0.ENDIF.IF xval1 > xval3. yval3 = xval1 - xval3.ELSE. yval3 = 0.ENDIF. • Converting Measured Consumption into Net Demandyval6 = xval1.edm_quant_to_demand yval6.
- 3. • Calculating Below and Above Limit for Demand if yval6 > xval4. yval4 = xval4. else. yval4 = yval6. endif. if yval6 > xval4. yval5 = yval6 - xval4. else. yval5 = 0. endif. • Appending the result to the Output Parametersedm_append_output 1.edm_append_output 2.edm_append_output 3.edm_append_output 4.edm_append_output 5.edm_append_output 6.This is how the RTP Formula : Input Parameters Looks like. As you can see thefunction module is mentioned and the 4 input parameters are also mentioned.
- 4. While allocating input parameters we also have to allocate the Calculation ModeThe calculation mode determines how a value is processed when a formula isexecuted. It could, for example, enable calculation based on the status of the inputprofile value.SAP has already predefined a number of calculation modes:•01 – Value included in calculation•02 – Value not included in calculation•99 – Value results in cancellation of calculationWhen implementing formulas, you can use the constantsco_calcmod_use type e_formulamod value 01,co_calcmod_not_use type e_formulamod value 02,co_calcmod_abort type e_formulamod value 99.Below are the Output Parameters
- 5. now I executed this formula in a formula profile.The values of the input profiles were like this.
- 6. First Limit for Consumption was at 2000 kwhSecond Limit for Consumption was at 5000 kwhDemand Limit was at 10000 KW.The calculation run was executed for the formula.
- 7. The profile values generated were.So you see that not much coding is necessary once the logic is clear :)This is also available in my blog at http://wp.me/p1Ci5j-5hDo leave a feedback. :D

No public clipboards found for this slide

×
### Save the most important slides with Clipping

Clipping is a handy way to collect and organize the most important slides from a presentation. You can keep your great finds in clipboards organized around topics.

Be the first to comment