SAP CUBE_SAMPLE_CREATE_NEW Function Module for Generates a data packet with random data for a cube









CUBE_SAMPLE_CREATE_NEW is a standard cube sample create new SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Generates a data packet with random data for a cube 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 cube sample create new FM, simply by entering the name CUBE_SAMPLE_CREATE_NEW into the relevant SAP transaction such as SE37 or SE38.

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



Function CUBE_SAMPLE_CREATE_NEW 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 'CUBE_SAMPLE_CREATE_NEW'"Generates a data packet with random data for a cube
EXPORTING
I_INFOCUBE = "InfoCube name
* I_SAMPLESIZE = 100 "Amount of requested data
* I_FISCVARNT = 'K1' "FIX Value of Fiscal Variant
* I_USE_MASTERDATA = RS_C_TRUE "Boolean
* I_RANDOM_SEED = 0 "
* I_MODUS = 1 "Mode
* I_DATES_CLOSE = RS_C_FALSE "True = local data with relation to time

IMPORTING
E_T_DATA = "SAP demo sales: overview

EXCEPTIONS
ILLEGAL_INPUT = 1 INHERITED_ERROR = 2 MASTERDATA_ERROR = 3
.



IMPORTING Parameters details for CUBE_SAMPLE_CREATE_NEW

I_INFOCUBE - InfoCube name

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

I_SAMPLESIZE - Amount of requested data

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

I_FISCVARNT - FIX Value of Fiscal Variant

Data type: T009B-PERIV
Default: 'K1'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_USE_MASTERDATA - Boolean

Data type: RS_BOOL
Default: RS_C_TRUE
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_RANDOM_SEED -

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

I_MODUS - Mode

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

I_DATES_CLOSE - True = local data with relation to time

Data type: RS_BOOL
Default: RS_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CUBE_SAMPLE_CREATE_NEW

E_T_DATA - SAP demo sales: overview

Data type: STANDARD TABLE
Optional: No
Call by Reference: Yes

EXCEPTIONS details

ILLEGAL_INPUT -

Data type:
Optional: No
Call by Reference: Yes

INHERITED_ERROR -

Data type:
Optional: No
Call by Reference: Yes

MASTERDATA_ERROR -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for CUBE_SAMPLE_CREATE_NEW 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:
lv_e_t_data  TYPE STANDARD TABLE, "   
lv_i_infocube  TYPE RSD_INFOCUBE, "   
lv_illegal_input  TYPE RSD_INFOCUBE, "   
lv_i_samplesize  TYPE I, "   100
lv_inherited_error  TYPE I, "   
lv_i_fiscvarnt  TYPE T009B-PERIV, "   'K1'
lv_masterdata_error  TYPE T009B, "   
lv_i_use_masterdata  TYPE RS_BOOL, "   RS_C_TRUE
lv_i_random_seed  TYPE I, "   0
lv_i_modus  TYPE I, "   1
lv_i_dates_close  TYPE RS_BOOL. "   RS_C_FALSE

  CALL FUNCTION 'CUBE_SAMPLE_CREATE_NEW'  "Generates a data packet with random data for a cube
    EXPORTING
         I_INFOCUBE = lv_i_infocube
         I_SAMPLESIZE = lv_i_samplesize
         I_FISCVARNT = lv_i_fiscvarnt
         I_USE_MASTERDATA = lv_i_use_masterdata
         I_RANDOM_SEED = lv_i_random_seed
         I_MODUS = lv_i_modus
         I_DATES_CLOSE = lv_i_dates_close
    IMPORTING
         E_T_DATA = lv_e_t_data
    EXCEPTIONS
        ILLEGAL_INPUT = 1
        INHERITED_ERROR = 2
        MASTERDATA_ERROR = 3
. " CUBE_SAMPLE_CREATE_NEW




ABAP code using 7.40 inline data declarations to call FM CUBE_SAMPLE_CREATE_NEW

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.

 
 
 
DATA(ld_i_samplesize) = 100.
 
 
"SELECT single PERIV FROM T009B INTO @DATA(ld_i_fiscvarnt).
DATA(ld_i_fiscvarnt) = 'K1'.
 
 
DATA(ld_i_use_masterdata) = RS_C_TRUE.
 
 
DATA(ld_i_modus) = 1.
 
DATA(ld_i_dates_close) = RS_C_FALSE.
 


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!