SAP ABAP Data Element UPC_Y_FBDER (FM Derivation)
Hierarchy
SAP_BW (Software Component) SAP Business Warehouse
   BW-PLA-BPS (Application Component) Business Planning and Simulation
     UPC (Package) SEM-BPS: General Functions
Basic Data
Data Element UPC_Y_FBDER
Short Description FM Derivation  
Data Type
Category of Dictionary Type D   Domain
Type of Object Referenced     No Information
Domain / Name of Reference Type FUNCNAME    
Data Type CHAR   Character String 
Length 30    
Decimal Places 0    
Output Length 30    
Value Table TFDIR    
Further Characteristics
Search Help: Name    
Search Help: Parameters    
Parameter ID   
Default Component name    
Change document    
No Input History    
Basic direction is set to LTR    
No BIDI Filtering    
Field Label
  Length  Field Label  
Short 10 FM: Deriv. 
Medium 15 FM: Derivation 
Long 27 Function Module Derivation 
Heading 30 Function Module Derivation 
Documentation

Definition

The Exit function module offers the possibility to realize functions for derivation, which are not intended in the standard. The function module for initialization has the following parameters:

  1. I_AREA = the planning area (type UPC_Y_AREA ).
  2. ITO_CHA = the characteristics of planning level (type UPC_YTO_CHA ). These characteristics cannot be changed.
  3. ITO_SOURCE = the source characteristics of the step (type UPC_YTO_CHA ).
  4. ITO_TARGET = the target characteristics of the step (type UPC_YTO_CHA ). These characteristics should be derived in the step.
  5. XS_CHAS = the characteristic combination, which should be changed.
  6. FAILED = exception, which is triggered, if the derivation goes wrong.

The following example shows how the fiscal year and posting period are derived from the 7 character period and the other way round:

function z_derive_time_chas.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_Y_AREA
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_SOURCE) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_TARGET) TYPE UPC_YTO_CHA
*" CHANGING
*" REFERENCE(XS_CHAS) TYPE ANY
*" EXCEPTIONS
*" FAILED
*"----------------------------------------------------------------------
DATA: l_gjahr(4) TYPE n,
l_perde(3) TYPE n,
l_fiscper(7) TYPE n.

FIELD-SYMBOLS: <fiscper>, <fiscyear>, <fiscper3>.

ASSIGN COMPONENT '0FISCPER' OF STRUCTURE xs_chas TO <fiscper>.
ASSIGN COMPONENT '0FISCYEAR' OF STRUCTURE xs_chas TO <fiscyear>.
ASSIGN COMPONENT '0FISCPER3' OF STRUCTURE xs_chas TO <fiscper3>.
READ TABLE ito_cha TRANSPORTING NO FIELDS
WITH KEY chanm = '0FISCPER'.
IF sy-subrc = 0.
* The 7 character period is in the level
l_fiscper = <fiscper>.
READ TABLE ito_cha TRANSPORTING NO FIELDS
WITH KEY chanm = '0FISCYEAR'.
IF sy-subrc <> 0.
l_gjahr = l_fiscper(4).
<fiscyear> = l_gjahr.
ENDIF.
READ TABLE ito_cha TRANSPORTING NO FIELDS
WITH KEY chanm = '0FISCPER3'.
IF sy-subrc <> 0.
l_perde = l_fiscper+4(3).
<fiscper3> = l_perde.
ENDIF.
ELSE.
* The 7 character period is not in the level
READ TABLE ito_cha TRANSPORTING NO FIELDS
WITH KEY chanm = '0FISCYEAR'.
IF sy-subrc = 0.
l_gjahr = <fiscyear>.
READ TABLE ito_cha TRANSPORTING NO FIELDS
WITH KEY chanm = '0FISCPER3'.
IF sy-subrc = 0.
l_perde = <fiscper3>.
l_fiscper(4) = l_gjahr.
l_fiscper+4(3) = l_perde.
<fiscper> = l_fiscper.
ENDIF.
ENDIF.
ENDIF.
ENDFUNCTION.

History
Last changed by/on SAP  20130604 
SAP Release Created in 31A