среда, 28 мая 2014 г.

Calculation before aggregation error in 7.3

We got help from the following notes:

http://scn.sap.com/thread/3194588

we have facing the same error and found a solution within the notes

1712991:Formular before Aggegration, Lookup and FAGGR_BEFORE

1668991:BW7.30: New behaviour of Aggregation


Short: There is a new parameter FAGGR_BEFORE which has to be entered in table RSADMIN with value <INITIAL>. This will turn off the new aggegration-implementation and use the old implementation

and


Overview

Formula variables of the type 'Replacement Path' can be filled by values derived from the key or attribute key of an infoobject. There is a comprehensive consulting note which explains all details of this rather complex feature:

Note 1385580 - How does a formula variable with a replacement path work?
There are various ways of defining formula variables, the following two are the most important one:
  • FVA
    The formula variable is replaced by the values of an (key figure) attribute of a characteristic (IO1). In this case the feature 'exception aggregation for formulas' is used and IO1 is added to the drilldown characteristics (non visible drilldown characteristic). This kind of 'calculation before aggregation(only!)regarding IO1!' is done automatically. See also Note1228378 and Note 1385580. If the variable is used alone in a formula the aggreagtion MAX is taken.
  • FVK
    The formula variable which is replaced by the key of a characteristic (IO2). In BW 3.x this formula variable is replaced before the aggregation (over the corresponding infoobject !) in calculated key figures and it is replaced after the aggregation in formulas. In BI 7.0 the replacement always occurs after the aggregation! For further information about problems in BW 3.x, see note 379832. After the upgrade a corresponding calculated key figure may deliver different results, please see note 1005772 for further details. There a report is given(RSR_VAR_REPPATH_AGGREGATION) which you can use to change the variable back to 'Calculation before Aggregation'. In the table RSZBLOBV you can then find the entry 1ATRRKEY in the field ATTRINM - meaning that this variable is technically now treated like a formula variable replaced by an attribute. As we already know, such a variable is by default (when used in a CKF) calculated before aggregation (regarding the corresponding infoobject) in contrast to a formula variable which is replaced by the key of a characteristic. So it may happen that after the upgrade you get an 'X' displayed in the query - then you can run the mentioned report in order to return to the 'old' behaviour. In the variable definition dialog you can choose between 'from','to' and 'interval' value - these settings are only taken into account if there is a filter with well defined intervall. If e.g. the infoobject IO2 isn't restricted at all you only get 'X' displayed for the result lines (where the system had to aggregate over IO2). See also note 1385580. 
    The folowing selections exist:
    (SA) from infoobject which is drilled down
    (SC) from cell editor
    (S1) from structure 1
    (SF) from global&hard filter
    (SD) soft filter (default values)
    Roughly (see note 1385580 for details) the selections are checked in the order given above.

среда, 21 мая 2014 г.

Data field from TVARVC convert

01.01.2014 to 20140101

        DATA: l_calday   TYPE D.

        DATA: l_char10   TYPE C LENGTH 10. "Для преобразования даты

        
SELECT SINGLE LOW FROM TVARVC INTO l_char10
          
WHERE NAME 'Z_PTWINC_CALDAY' .

        
"Обработка формата даты с точками
        
IF STRLENl_char10 ) = 10.
          
CONCATENATE l_char10+6(4"Год
                      l_char10+3
(2"Месяц
                      l_char10+0
(2"День
                      
INTO l_char10.
        
ENDIF.
        l_calday 
l_char10.