SAP CEV2_FORMULA_EXPLOSION Function Module for CAP formula explosion









CEV2_FORMULA_EXPLOSION is a standard cev2 formula explosion SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for CAP formula explosion processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for cev2 formula explosion FM, simply by entering the name CEV2_FORMULA_EXPLOSION into the relevant SAP transaction such as SE37 or SE38.

Function Group: CEV2
Program Name: SAPLCEV2
Main Program:
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CEV2_FORMULA_EXPLOSION pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'CEV2_FORMULA_EXPLOSION'"CAP formula explosion
EXPORTING
* EXPLOSION_TYPE = ' ' "Type of explosion
* START_NA = ' ' "Start name
* START_NR = 0 "Start number

IMPORTING
RECURS = "Step no. of recursion

TABLES
HI = "Hierarchy table

EXCEPTIONS
START_MISSING = 1 WRONG_TYPE = 2
.



IMPORTING Parameters details for CEV2_FORMULA_EXPLOSION

EXPLOSION_TYPE - Type of explosion

Data type: VFORP-PAHSC
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_NA - Start name

Data type: VFORK-FOMNR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_NR - Start number

Data type: VFORK-FOINN
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CEV2_FORMULA_EXPLOSION

RECURS - Step no. of recursion

Data type: SY-TABIX
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for CEV2_FORMULA_EXPLOSION

HI - Hierarchy table

Data type: CEV_HIER
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

START_MISSING - Information on start of explosion is missing

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

WRONG_TYPE - Wrong type of explosion

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CEV2_FORMULA_EXPLOSION Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lt_hi  TYPE STANDARD TABLE OF CEV_HIER, "   
lv_recurs  TYPE SY-TABIX, "   
lv_start_missing  TYPE SY, "   
lv_explosion_type  TYPE VFORP-PAHSC, "   SPACE
lv_start_na  TYPE VFORK-FOMNR, "   SPACE
lv_wrong_type  TYPE VFORK, "   
lv_start_nr  TYPE VFORK-FOINN. "   0

  CALL FUNCTION 'CEV2_FORMULA_EXPLOSION'  "CAP formula explosion
    EXPORTING
         EXPLOSION_TYPE = lv_explosion_type
         START_NA = lv_start_na
         START_NR = lv_start_nr
    IMPORTING
         RECURS = lv_recurs
    TABLES
         HI = lt_hi
    EXCEPTIONS
        START_MISSING = 1
        WRONG_TYPE = 2
. " CEV2_FORMULA_EXPLOSION




ABAP code using 7.40 inline data declarations to call FM CEV2_FORMULA_EXPLOSION

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single TABIX FROM SY INTO @DATA(ld_recurs).
 
 
"SELECT single PAHSC FROM VFORP INTO @DATA(ld_explosion_type).
DATA(ld_explosion_type) = ' '.
 
"SELECT single FOMNR FROM VFORK INTO @DATA(ld_start_na).
DATA(ld_start_na) = ' '.
 
 
"SELECT single FOINN FROM VFORK INTO @DATA(ld_start_nr).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!