cancel
Showing results for 
Search instead for 
Did you mean: 

Code for Virtual keyfigure

Former Member
0 Kudos

Hi All,

I want to try an example for creating a virtual keyfigure. For this, I want to create a virtual keyfigure Sales Revenue and want to model price as an attribute of product(product id). Can anyone please tell me what code should i write in userexit to populate the data in reports.

Infocube name - <b>VCube</b>

<u>Characteristics:</u>

ProductID - <b>Pid</b>(has master data)

CustomerID - <b>Cid</b> (some other characteristic)

<u>ProductID has following infoobjects as master data.</u>

Price - <b>price</b>

Product name - <b>pname</b> (someother attribute)

<u>Keyfigures:</u>

SalesQuantity - <b>Sid</b>

SalesRevenue(defined as virtual keyfigure and it doesn't have any data in the fact table) - <b>Srev</b>

Using the infoobject names stated in bold letters and also the infocube name can anyone please tell me what code should i write in the user exit. Please follow the infoobject names stated in bold letters so that I can understand easily. I want to multiply the

sales quantity *price.

Please let me know....

Thanks,

Sabrina.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The document given below explains creating virtual key figures. If you do a F1 on the enhancement there also you can see some sample code.

https://websmp106.sap-ag.de/~sapdownload/011000358700009299362001E/HOWTOIDENTIFYCOMPRESULTS.DOC

Thanks.

Former Member
0 Kudos

Hi all,

Can anyone please tell me how I can write the code........

Thanks,

Sabrina.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello,

thirst of all documentations are available as a how to paper as well as in the documentation if the exit itself in transaction CMOD.

In addition I would like to inform you that such kind of calculation needs to be done in the Bex with a formula variable. If you are not doing this in the Query definition itself you will have problems if you aggregate the virtulal keyfigure.

kind reg.

Michael

Former Member
0 Kudos

Hi Michael,

The reason why I want to do this is because I want to implement virtual keyfigure just for learning purposes.

thanks,

Sabrina.

Former Member
0 Kudos

Hi Sabrina,

Please look at "How to... Use variable time references in currency conversions" white paper:

https://www.sdn.sap.com/sdn/developerareas/bi.sdn?page=BW_How_To.htm

It has a code for a virtual KF.

Best regards,

Eugene

Former Member
0 Kudos

hi

Pls send a test mail to this Id

I will send u the document

chivukula_kk@hotmail.com

rgds.

kk