cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual Characteristics NOT working, BADI is not call

Former Member
0 Kudos

Hello Experts,

I have a query built on Multiprovider, I had a requirement where I had to make use of virtual char though I haven't used it before.

I followed steps given in White paper available in SCN on virtual char but seems like BADI I written for Virtual Char is not being called.

May I have necessary checks that I need to make sure that can cause BADI not being called.

Accepted Solutions (0)

Answers (5)

Answers (5)

brian_keenan
Contributor
0 Kudos

ok the DEFINE Method is called during query generation to include the infooobjects, put a breakpoint in there and execute,

Now is the InfoProvider a standard infoProvider or infoset?  if not standard the infoobjects names may be different( technical ones)

former_member182346
Active Contributor
0 Kudos

Hi,

First thing, as you are saying the break-point is not working, did you activated the BADI.

Then as per my previous experience, you need to give some number assignment which been used in query, and that you will get during the debug only. So first time debug is must and then you will identify which number is assign to which char and based on that what ever the required char will be get assigned.

Please first check the activation of Badi and then try to make it stop at break point.

PS : BADI implementation for virtual Char is really tricky

Thank-You.

Regards,

VB

Former Member
0 Kudos

Yes, I did activated them.

and what is this number assignment ?, never heard about this yet (since I have been finding help and docs over SCN). can you give me detailed explanation on it please.

former_member182346
Active Contributor
0 Kudos

Hi sorry for delay in reply.

Did you resolved teh issue, if so please close the thread.

If not, please refer below doc and specially the Page 15 talkes about the number assignement, writeten in compute : http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60e34f63-f44c-2c10-488e-c89b04e0c...

Note: This is a simple code to put the constant value 10 in this virtual kf. We can also declare table or other data elements in define method to calculate complex logics as well.

p_kyf_zvirtkf = 16. This statement points to the location of Virtual KF in the <fs_zvirtkf> structure, generated at execution time, it is derived by code debugging at runtime. And we are modifying the value of that location by putting constant value 10 in statement <fs_zvirtkf> = '10.0'.

Thank-You.

Regards,

VB

brian_keenan
Contributor
0 Kudos

Hi,

The first thing is to go through the note in detail.

1717880    Virtual Key Figures & Characteristics

I would always start but putting breakpoints in each DEFINE, INITAIZE and COMPUTE methods, are they all getting called?

Is the query based on infoset? multiprovider?  check you are using the correct names of the infoobjects in this case.

brian_keenan
Contributor
0 Kudos

also can you show some sample of your code?

Former Member
0 Kudos

Hi Brian,

It is on InfoCube.

Just to check Virtual char is working is used following code

Definition:

METHOD

IF_EX_RSR_OLAP_BADI~DEFINE .



 
DATA: l_s_chanm   TYPE rrke_s_chanm,

        l_kyfnm    
TYPE rsd_kyfnm.

 
FIELD-SYMBOLS:

        <l_s_chanm>
TYPE rrke_s_chanm.

  BREAK
-POINT.



CASE i_s_rkb1d-infocube.

  
WHEN 'ZUCS_C06'.

     l_s_chanm
-chanm = '0UCINSTALLA'.

     l_s_chanm
-mode  = rrke_c_mode-read.

    
APPEND l_s_chanm TO c_t_chanm.



     l_s_chanm
-chanm = 'ZPRORATE'.

     l_s_chanm
-mode  = rrke_c_mode-no_selection.

    
APPEND l_s_chanm TO c_t_chanm.



ENDCASE.



ENDMETHOD

--------------------------------------------------------------------------------------------------------------------------------

Compute:

METHOD

IF_EX_RSR_OLAP_BADI~COMPUTE .



FIELD-SYMBOLS <FS_ZPRORATE>  TYPE ANY.

FIELD-SYMBOLS <FS_ucinstalla>  TYPE ANY.





  
ASSIGN COMPONENT P_CHA_ZPRORATE OF STRUCTURE C_S_DATA TO <FS_ZPRORATE>.

  
ASSIGN COMPONENT P_CHA_0UCINSTALLA OF STRUCTURE C_S_DATA TO <FS_ucinstalla>.



   <FS_ZPRORATE>
= 'Hello'.



ENDMETHOD.      

------------------------------------------------------------------------------------------------------------------------------

former_member182470
Active Contributor
0 Kudos

I am not good in ABAP. But i feel " Hello" should be populated for "FS_ucinstalla" , right?

Cross check your code and debug it.

Former Member
0 Kudos

It should write "Hello" to  <FS_ZPRORATE> but it is not, I had put break point to Define and Compute methods but it didn't stop there, I strongly believe my Implementation is NOT called at all.

Former Member
0 Kudos

If it's not called, it might be due to many reasons.

1. Have you given your infoprovider name in the attribute tab while creating BAdi?

2. Is your implementation class is active?

Your implementation looks correct. Have you checked the include ZXRSRTOP contains the infocube/virtual characteristic defintion?

To answer your other question regarding virtual characteristic, user exits are the alternatives.

You can write your code at i_step = 2, to populate field value at runtime.

Br, H

Former Member
0 Kudos
Former Member
0 Kudos

Guys,

It is not helping, I have created my query on Multiproviders it is possible to use Virtual Characteristics on query built over Multiprovider, right ?

former_member182470
Active Contributor
0 Kudos

It is definitely possible. If you want to show data by an external logic then BADI can be used. Please check your development once again.

Former Member
0 Kudos

Hi Suman,

Thanks for helping me, I followed all steps given in documents available in SCN. I even tried with just assigning a simple "Hi" value to VC but even that also not coming.

former_member182470
Active Contributor
0 Kudos

You are doing something wrong. Please show your development to your colleague and also cross check closely with all SCN docs again. Those docs will 100% help you.

Former Member
0 Kudos

Hi,

I followed same steps, I am even trying to print a simple text "Hello" that require No logic at all but I am failed to have it displayed.

FYI I have BI 7.3 system do this have anything to do with this ?

former_member182470
Active Contributor
0 Kudos

I don't think 7.3 is a reason. Please sit with your colleagues and work on this.

Former Member
0 Kudos

Okay, 1 more question.... BAdi I only way to implement Virtual Characteristics ? Don't we have other way to implement.

former_member182470
Active Contributor
0 Kudos

Yes, virtual chars/Kfs can only be populated by implementing BADI's.

former_member182470
Active Contributor
0 Kudos