SAP ABAP Data Element PA_EXIT_NR (CO-PA exit number)
Hierarchy
BBPCRM (Software Component) BBPCRM
   CRM (Application Component) Customer Relationship Management
     CRM_APPLICATION (Package) All CRM Components Without Special Structure Packages
       KE (Package) Profitability Analysis
Basic Data
Data Element PA_EXIT_NR
Short Description CO-PA exit number  
Data Type
Category of Dictionary Type D   Domain
Type of Object Referenced     No Information
Domain / Name of Reference Type EXIT_NR    
Data Type CHAR   Character String 
Length 3    
Decimal Places 0    
Output Length 3    
Value Table      
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 Exit no. 
Medium 15 Exit number 
Long 20 Exit number 
Heading Exit 
Documentation

Definition

In valuation for Profitability Analysis (CO-PA), you can supplement the standard valuation functions with your own user-programmed "exits".

There are two ways to do this:

  • program the exit in an SAP standard enhancement
  • program the exit in a special program

Note that all exits created in Release 3.0 or higher use the former method. The latter option is only supported for the sake of upward compatibility.

User exit in valuation using the SAP standard enhancement

Enter the enhancement COPA0002 in a project in SAP project management for enhancements (transaction CMOD). The enhancement contains two function modules -- one for plan and one for actual data transfer -- in which you can program your own source code. Once you have finished programming, activate the project. You can then use the user exit in valuation.

The following example demonstrates which conventions you need to observe when you program the exit.

Example:

You want to use a user exit U01 in your valuation strategy in operating concern S001. This exit is supposed to calculation a deduction of 5% of revenues. In another operating concern, S002, it should calculate commission of 2% of revenues.

The valuation strategy is used for actual data. Therefore you need to maintain the enhancement component EXIT_SAPLKEAB_001 in Include ZXKKEU03 as follows:

DATA: LINE_ITEM_S001 LIKE CE1S001,
      LINE_ITEM_S002 LIKE CE1S002.
 CASE ERKRS.
  WHEN 'S001'.
    LINE_ITEM_S001 = EP_SOURCE.
    CASE EXIT_NR.
      WHEN 'U01'.
        LINE_ITEM_S001-DISCN = LINE_ITEM_S001-REVEN * 5 / 100.
    ENDCASE.
    EP_TARGET = LINE_ITEM_S001.
  WHEN 'S002'.
    LINE_ITEM_S002 = EP_SOURCE.
    CASE EXIT_NR.
      WHEN 'U01'.
        LINE_ITEM_S002-PROVI = LINE_ITEM_S002-REVEN * 2 / 100.
    ENDCASE.
    EP_TARGET = LINE_ITEM_S002.
 ENDCASE. 

In planning, you want to use the exit U01 to calculate a different deduction in different plan versions -- for example, 5% in version 001 and 7% in version 002. In this case, you need to maintain enhancement component EXIT_SAPLKEAB_002 in Include ZXKKEU04 as follows:

DATA: LINE_ITEM_S001 LIKE CE1S001.
 CASE ERKRS.
   WHEN 'S001'.
     LINE_ITEM_S001 = EP_SOURCE.
     CASE EXIT_NR.
       WHEN 'U01'.
         CASE VERSI.
           WHEN '001'.
             LINE_ITEM_S001-DISCN = LINE_ITEM_S001-REVEN * 5 / 100.
           WHEN '002'.
             LINE_ITEM_S001-DISCN = LINE_ITEM_S001-REVEN * 7 / 100.
         ENDCASE.
     ENDCASE.
     EP_TARGET = LINE_ITEM_S001.
 ENDCASE. 

Note that the statement "CASE ERKRS ..." is required, because the user exit is active in every operating concern in your system as soon as you activate the enhancement COPA0002.

User exit in valuation in program RKE5xxxx

In Release 2.2, you can insert a user exit for valuation in program RKE5xxxx as a form routine (xxxx = name of the operating concern in which you want to activate the user exit). The system generates this program automatically when a new operating concern is generated. From then on, SAP makes no further changes, so that any source code you define remains untouched. These can be copied and used as the basis for your company's own exits.

The form routines must have the following syntax:

The routine must be called zzz_EXIT_ACTUAL for actual data, where zzz stands for the user exit ID.

Note that the ID must begin with the letter "U". The CO-PA line item in structure "CE1xxxx" (where xxxx = operating concern) is transferred to the form routine.

Example for operating concern 'S001' and user exit 'U01' for an actual valuation routine:

*----------------------------------------------------------------------*
*       FORM U01_EXIT_ACTUAL
*----------------------------------------------------------------------*
*       This Form routine is a User Exit, which runs in the valuation
*       routine in CO-PA. The routine runs if an entry 'U01' for this
*       exit is in table T258A for actual data.
*----------------------------------------------------------------------*
*  <--> LINE_ITEM     CO-PA line item
*----------------------------------------------------------------------*
FORM U01_EXIT_ACTUAL USING LINE_ITEM STRUCTURE CE1S001.
  LINE_ITEM-DISCN = 0,05 * LINE_ITEM-REVEN.
ENDFORM. 

For valuation of plan data, the plan version is also transferred. The routine must be called zzz_EXIT_PLAN (zzz = name of user exit).

Example for operating concern 'S001' and user exit 'U01' for plan valuation routine:

*----------------------------------------------------------------------*
*       FORM U01_EXIT_PLAN
*----------------------------------------------------------------------*
*       This Form routine is a User Exit, which runs in the valuation
*       routine in CO-PA. The routine runs if an entry 'U01' for this
*       exit is in table T258A for plan data.
*----------------------------------------------------------------------*
*  <--> LINE_ITEM     CO-PA line item
*  ---> PLAN_VERSION  CO-PA plan version
*----------------------------------------------------------------------*
FORM U01_EXIT_PLAN USING LINE_ITEM STRUCTURE CE1S001
                         PLAN_VERSION.
  LINE_ITEM-DISCN = 0,05 * LINE_ITEM-REVEN.
ENDFORM. 

The exits are processed in the order in which they are entered in the valuation strategy.

History
Last changed by/on SAP  19940208 
SAP Release Created in