cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual characteristic: BADI not executed?

Former Member
0 Kudos

Hey together,

we are faced with a problem that can be solved by a virtual charateristic.

We went the first steps:

1.) Creating an InfoObject and bring it into the cube (it's a normal cube, no multi provider)

2.) Define a filter on the cube

3.) Creating an implementation for BAdI RSR_OLAP_BADI with the three interface methods Define, Initialize and compute

4.) Taking the InfoObject into the Query

As we started the query there was no result for the virtual characteristic. In the next step I wanted to test if the methos are executed during query runtime. So I changed the "DEFINE" method in a way that it has to write a flag into a table when it is executed:

method IF_EX_RSR_OLAP_BADI~DEFINE.

DATA t1 TYPE zaufrufexit2. "Table for test reasons

t1-lauf = '2'.

INSERT INTO ZAUFRUFEXIT2 VALUES t1-lauf.

CASE i_s_rkb1d-infocube.

WHEN '/ITRM/EPSCUBE'.

APPEND '0CALMONTH' TO c_t_chanm.

ENDCASE.

endmethod.

From my understanding the method should be executed during query runtime an write into tabe ZAUFRUFEXIT2. I tested the three lines in a normal report. It works like that.

Thank you in advance.

Any ideas how to bring the BAdI implementation to work?

Thanks in advice.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Now it's possible to execute the query and to call the class.

I found out that the Static "Define" method isn't called. That leads to an error in abort in the "Compute" method.

What could be the reason that Define is called?

Edited by: tim_bag on Dec 16, 2011 4:27 PM

former_member210615
Contributor
0 Kudos

hi,

you may have to write code to INITIALIZE method

CL_EXM_IM_RSR_OLAP_BAPI, here the P_KYF<object> and P_CHA<object> attributes are assigned their values. If you do not copy this code into your own implementation, these attributes have no value in the COMPUTE method and that could be the reason your code is probably not work.

it might resolve your error

regards

laksh

Former Member
0 Kudos

Hi Laksh Arora,

Even I have same problem, Can you elaborate on CL_EXM_IM_RSR_OLAP_BAPI, how do use it.

fyi I haven't used BADI ever before, I have created one and that is not getting called.

Answers (2)

Answers (2)

Former Member
0 Kudos

It's important and in most cases sufficient to copy the example for initialization.

Thanks for your help.

former_member223480
Active Contributor
0 Kudos

hi tim_bag

If you want to check your code put a break-point and run the query on the rsrt2 transaction.

Check the following document

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e051fda8-71a9-2a10-ac9e-8d17414a8c8c ]

If you follow all the steps, normally you will have no problem with the vkf configuration.

Regards

Yiannis