Archi - transfo pour annuler tous les kpis sans les lister
Goal of this transformation is to cancel "bad" records in this adso.
To do this we need to multiply by -1 all KPI's for the records that will be selected in the DTP linked to this Transformation.
Because there is a lot of KPI we will not do this KPI by KPI.
It will be too long to do kpi by kpi.
We will use another method :
- Create a transformation from the aDso to itself
- create simple mmaping for all infoobject 1 to 1
- in the start routine we will add this code :
-
- Get list of ALL key figures stored in this adso
- Loop on source_package and use dynamic variable and field symbols to multiply each kpi by -1
- List of kpi for this adso will be defined by a join based on :
- RSOOBJXREF : table for the fields in the adso (dimension + KPIs )
- RSDIOBJ : table to find the Key Figures
* déclaration des variables : types:begin ofkpi_list,fieldnmtype rsdiobjfieldnm,end ofkpi_list.datait_kpi_listtype table ofkpi_list.datas_kpi_listlike line ofit_kpi_list.datav_fieldname(50)type c.field-symbols:<fs_global_variable>type any.* Début du codeSELECTb~fieldnmFROM(rsoobjxrefASaINNERJOINrsdiobjASbONa~objnm_dep=b~iobjnm)WHEREa~tlogo='ADSO'ANDa~objvers='A'ANDa~objnm='ZPRD_A004'ANDa~tlogo_dep='IOBJ'ANDb~iobjtp='KYF'ANDb~objvers='A'INTOCORRESPONDING FIELDS OFTABLE@it_kpi_list.* 2) Modify each kpi in the source_package table.LOOP AT SOURCE_PACKAGEASSIGNING<source_fields>.* For each KPI in the adsoLOOP AT it_kpi_listINTOs_kpi_list.* Create the dynamic name of the kpi to modify.CLEARv_fieldname.CONCATENATE'<source_fields>-'s_kpi_list-fieldnmINTOv_fieldname.* Create the dynamic variable.ASSIGN(v_fieldname)TO<fs_global_variable>.* Modify the value.<fs_global_variable>=<fs_global_variable>*-1.ENDLOOP.ENDLOOP.