cancel
Showing results for 
Search instead for 
Did you mean: 

virtual key figure

Former Member
0 Kudos

Hi guys,

I am looking for a document on how to create virtual key figure and virtual characteristic. Can anybody please mail me the document at zsapbw@gmail.com

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Transaction SMOD ENHANCEMENT RSR00002

See documentation

In CMOD you'll have to create a projet in order to activate the exists

included in RSR00002

All the includes to change are include in previous exemple

Best regards,

Christophe

Former Member
0 Kudos

Does that mean in the Democube,

field PRICE_TP is empty (because it is virtual)

and rest of the fields PRODUCT, ACT_PRICE and QUANTITY has values (becuase they are not virtual).

I am really confused by the following statement,

In the enhancement, the product from the current price for PRODUCT and the key figure QUANTITY should be determined

Answers (2)

Answers (2)

Former Member
0 Kudos

thnx

Former Member
0 Kudos

Here is some sample code from service marketplace.

Ravi Thothadri

User Exit Virtual Characteristics and Key figures

Example: InfoCube DEMOCUBE has the characteristic PRODUCT PRICE_TP and the key figure ACT_PRICE and QUANTITY. In the enhancement, the product from the current price for PRODUCT and the key figure QUANTITY should be determined. If successful, the characteristic PRICE_TP should contain the characteristic value '1'.

The include ZXRSRU02: Definition

***INCLUDE ZXRSRU02

DATA: L_S_CHANM TYPE RRKE_S_CHANM.

CASE I_S_RKB1D-INFOCUBE.

WHEN 'DEMOCUBE'.

L_S_CHANM-CHANM = 'PRODUCT'.

L_S_CHANM-MODE = RRKE_C_MODE-READ.

APPEND L_S_CHANM TO E_T_CHANM.

L_S_CHANM-CHANM = 'PRICE_TP'.

L_S_CHANM-MODE = RRKE_C_MODE-NO_SELETION.

APPEND L_S_CHANM TO E_T_CHANM.

APPEND 'ACT_PRICE' TO E_T_KYFNM.

APPEND 'QUANTITY' TO E_T_KYFNM.

ENDCASE.

The include ZXRSRTOP: global data

***INCLUDE ZXRSRTOP .

DATA: G_POS_DEMOCUBE_PRODUCT TYPE I.

DATA: G_POS_DEMOCUBE_PRICE_TP TYPE I.

DATA: G_POS_DEMOCUBE_ACT_PRICE TYPE I.

DATA: G_POS_DEMOCUBE_QUANTITY TYPE I.

The Include ZXRSRZZZ: Changing the data

***INCLUDE ZXRSRZZZ .

FORM USER_DEMOCUBE USING I_S_RKB1D TYPE RSR_S_RKB1D

CHANGING C_S_DATA TYPE ANY.

FIELD-SYMBOLS <L_PRODUCT>.

FIELD-SYMBOLS <L_PRICE_TP>.

FIELD-SYMBOLS <L_ACT_PRICE>.

FIELD-SYMBOLS <L_QUANTITY>.

ASSIGN COMPONENT G_POS_DEMOCUBE_PRODUCT

OF STRUCTURE C_S_DATA TO <L_PRODUCT>.

ASSIGN COMPONENT G_POS_DEMOCUBE_PRICE_TP

OF STRUCTURE C_S_DATA TO <L_PRICE_TP>.

ASSIGN COMPONENT G_POS_DEMOCUBE_ACT_PRICE

OF STRUCTURE C_S_DATA TO <L_ACT_PRICE>.

ASSIGN COMPONENT G_POS_DEMOCUBE_QUANTITY

OF STRUCTURE C_S_DATA TO <L_QUANTITY>.

  • Routine to get the price

  • PERFORM GET_PRICE USING <L_PRODUCT>

  • CHANGING <L_ACT_PRICE>.

IF <L_ACT_PRICE> GT 0.

<L_ACT_PRICE> = <L_ACT_PRICE> * <L_QUANTITY>.

<L_PRICE_TP> = '1'.

ENDIF.

ENDFORM.

Former Member
0 Kudos

Can somebody tell me where you put it and some logic behind the code.

Former Member
0 Kudos

Instead this example I recommend create you own implementation RSR_OLAP_BADI. (se18 se19). search forum for example.