viernes, 26 de abril de 2013

R3: EXIT_SAPLRSAP_004: 4R_SAKNR_0000_HIER


* In this example, Sets are extracted for DataSource 4R_SAKNR_0000_HIER
* they are compounded by a value of 'TEST' (for compound 0CHRT_ACCTS)
* The exit is called for any hierarchy extracted from OLTP to BW,
* therefore we have to make sure only desired FI-SL-Sets are modified.
* This information is available in I_DATASOURCE and I_S_HIEBAS.
*
IF I_DATASOURCE = '4R_SAKNR_0000_HIER'   "<--- datasource="" o:p="" your="">
   AND I_S_HIEBAS-HCLASS = '0000'.       "Hierarchy class of FI-SL-Sets

* Add compound value to hierarchy leaves
  LOOP AT C_T_HIENODE WHERE IOBJNM <> '0HIER_NODE'.
*   Shift nodename right to get space for compound characteristic
    SHIFT C_T_HIENODE-NODENAME RIGHT BY 4 PLACES.
*   Put chart of accounts into first 4 places
    C_T_HIENODE-NODENAME(4) = 'TEST'.      "<-- compound="" o:p="" value="" your="">
    MODIFY C_T_HIENODE.
  ENDLOOP.

* Add compound value to intervals in the same fashion
  LOOP AT C_T_HIEINTV.
    SHIFT C_T_HIEINTV-LEAFFROM RIGHT BY 4 PLACES.
    C_T_HIEINTV-LEAFFROM(4) = 'TEST'.      "<-- compound="" o:p="" value="" your="">
    SHIFT C_T_HIEINTV-LEAFTO RIGHT BY 4 PLACES.
    C_T_HIEINTV-LEAFTO(4) = 'TEST'.        "<-- compound="" o:p="" value="" your="">
    MODIFY C_T_HIEINTV.
  ENDLOOP.

ENDIF.

No hay comentarios: