Beruflich Dokumente
Kultur Dokumente
1. Price Planning
In version 1 it is planned, in version 2 the prices are stored in the transaction data. The characteristics to be changed are: Version (0VERSION) Fiscal Year (0FYEAR) Customer (0CUSTOMER) The records have the special feature that the characteristics Customerand Fiscal Year have the value Not Assigned and must therefore be included in the group of characteristics to be changed. For every object to be planned in version 1, there must also be an object in version 2 from which the price can be determined. If no price is planned for an article, a notification is issued. The calculation is only executed when the combination {QUANTITY,1,FYEAR,CUSTOMER} is scheduled, therefore > 0. DATA CUSTOMER TYPE 0CUSTOMER. DATA FYEAR TYPE 0FYEAR. DATA ARTICLE TYPE 0ARTICLE. IF {PRICE,2,#,#} = 0. ARTICLE = OBJV(). MESSAGE I001(/SEM/003) WITH ARTICLE. ELSE. FOREACH FYEAR, CUSTOMER. IF {QUANTITY,1,FYEAR,CUSTOMER} > 0. {REVENUE,1,FYEAR,CUSTOMER} = {QUANTITY,1,FYEAR,CUSTOMER} * {PRICE,2,#,#}. ENDIF. ENDFOR. ENDIF. It seems surprising that the Article (0ARTICLE) is missing from the list of characteristics to be changed as the prices that are used for calculating refer to the 0ARTICLE. If specifically including the 0ARTICLE characteristic, the example would look as follows: DATA CUSTOMER TYPE 0CUSTOMER. DATA FYEAR TYPE 0FYEAR. DATA ARTICLE TYPE 0ARTICLE. FOREACH ARTICLE, FYEAR, CUSTOMER. IF {PRICE,2,#,#,ARTICLE} = 0. MESSAGE I001(/SEM/003) WITH ARTICLE. ELSE. IF {QUANTITY,1,FYEAR,CUSTOMER,ARTICLE} > 0. {REVENUE,1,FYEAR,CUSTOMER,ARTICLE} = {QUANTITY,1,FYEAR,CUSTOMER,ARTICLE} * {PRICE,2,#,#,ARTICLE}. ENDIF. ENDIF. ENDFOR. The 0ARTICLE characteristic is not actually necessary for the formula as the values of the characteristic are not changed. When calculating the planned revenue it is shown that the same article is referenced on both sides of the assignment operator.
In a case such as this, SAP recommends that you do not include the characteristic in the quantity of characteristics to be changed as it is not required for the calculation, but costs in performance when accessing the values. Another way of accelerating the formula is to save the value of the {PRICE,2,#,#} element in a help variable and then to work with this. If the value of a characteristic is needed to output an error message or to determine attribute values, the value can be read with the OBJV() function.
help.sap.com/saphelp_nw70ehp1/helpdata/en/47/8b1a64762815dce10000000a42189b/content.htm
1/5
9/3/13
3. Proportional Planning
Characteristics to be changed are key figure name, version (0VERSION), fiscal year (0FYEAR), and customer (0CUSTOMER). DATA TOTREVENUE TYPE F. DATA TOTQUANTITY TYPE F. DATA CUSTOMER TYPE 0CUSTOMER. FOREACH CUSTOMER. TOTREVENUE = TOTREVENUE + {REVENUE,2,CUSTOMER}. TOTQUANTITY = TOTQUANTITY + {QUANTITY,2,CUSTOMER}. ENDFOR. FOREACH CUSTOMER. {REVENUE,1,CUSTOMER} = {QUANTITY,1,CUSTOMER} * TOTREVENUE / TOTQUANTITY. ENDFOR.
2/5
9/3/13
7. Rolling Planning
Characteristics to be changed are version and fiscal year/period. The actual data of the current period is copied to the plan version. The difference is spread across the remaining periods. The current period is determined from a variable. DATA ACTPER TYPE FISCPER. DATA FISCPER TYPE FISCPER. DATA SUM TYPE F. DATA DELTA TYPE F. * Periods read from the variables with the technical name PERIOD ACTPER = VARV( 'PERIOD' ). * Get sum for weight FOREACH FISCPER. IF FISCPER > ACTPER. SUM = SUM + { 1, FISCPER }. ENDIF. ENDFOR. * Delta between planned value and actual value DELTA = {1, ACTPER} - {0,ACTPER}. * Set planned value to actual value {1,ACTPER} = {0, ACTPER}. * Weighted delta distribution FOREACH FISCPER. IF FISCPER > ACTPER. {1,FISCPER} = {1,FISCPER} + DELTA * {1,FISCPER} / SUM. ENDIF. ENDFOR.
8. Depreciation
Characteristics to be changed are key figure name and fiscal year. Determines the value of the 0AMOUNT key figure for five years. Cost price is 1000. Net book value is 100. Depreciation percentage rate is 20 percent. It is straight-line depreciation. In this example the DECL (straight-line depreciation) function is not of importance, but the TMVL function. This function has the value of a time characteristic as its first argument and an offset as its second. The offset specifies which next-largest value the function should deliver. You can also transfer negative offsets. Then the corresponding smaller values are delivered. It is not possible to set the same effect with a FOREACH loop because not all years have to be included in the transaction data. DATA YEARS TYPE I. DATA FYEAR TYPE 0FISCYEAR. FYEAR = VARV('ACTYEAR'). DO. YEARS = YEARS + 1. FYEAR = TMVL(FYEAR, 1). {0AMOUNT, FYEAR} = DECL( 1000, 100, 20, YEARS). IF YEARS = 5. EXIT. ENDIF. ENDDO.
help.sap.com/saphelp_nw70ehp1/helpdata/en/47/8b1a64762815dce10000000a42189b/content.htm
3/5
9/3/13
DATA D1 TYPE D. DATA D2 TYPE D. DATA I1 TYPE I. DATA I2 TYPE I. DATA FISCPER TYPE 0FISCPER. FOREACH FISCPER. * Calculate 1st day of FISCPER D1 = C2DATE( FISCPER, S ). * Calculate last day of FISCPER D2 = C2DATE( FISCPER, E ).
* Calculate the difference between last and 1st day minus two days I2 = 2. I1 = D2 - D1 - I2. MESSAGE I001(UPF) WITH 'DIFFERENCE' I1. ENDFOR.
Do you have any additional feedback? Please enter your feedback in English.
Send Feedback
help.sap.com/saphelp_nw70ehp1/helpdata/en/47/8b1a64762815dce10000000a42189b/content.htm
4/5
9/3/13
help.sap.com/saphelp_nw70ehp1/helpdata/en/47/8b1a64762815dce10000000a42189b/content.htm
5/5