Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

getting *** illegal reference *** for an object.

Former Member
0 Likes
691

Hi there,

I have implemented a BADI as per the note 907742. Now here is the detail of the BADI.

The BADI is implementing the class CL_EXM_IM_RECN_CONTRACT_FAS13.

This class has an attribute MO_OBJECT instance private.

Now when I am executing a peace of code

SUBSTITUTECONDITIONS_FAS13( io_object = io_object

id_activity = id_activity ).

which is a method of the above class the attribute should have the value . where as in debugging I am getting *** illegal reference *** .

Any clue why this is happning.

Your quick response will be highly appriciated.

Best regards,

Vikash.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
584

Hello Vikash

I assume you are mixing things up.

Not the BAdI is implementing the class but the class implements the BAdI (interface).

Somewhere in the standard transaction method IF_EX_RECN_CONTRACT~SUBSTITUTE is called. Now within this method you have to write your coding to change conditions:


DATA:
  lo_contract   TYPE REF to cl_recn_contract.


  lo_contract ?= io_contract.  " casting to contract instance

  CASE id_activity.
    WHEN '...'.
      " do something
 
    WHEN others.
      " do something else
    ENDCASE.

Regards

Uwe

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
585

Hello Vikash

I assume you are mixing things up.

Not the BAdI is implementing the class but the class implements the BAdI (interface).

Somewhere in the standard transaction method IF_EX_RECN_CONTRACT~SUBSTITUTE is called. Now within this method you have to write your coding to change conditions:


DATA:
  lo_contract   TYPE REF to cl_recn_contract.


  lo_contract ?= io_contract.  " casting to contract instance

  CASE id_activity.
    WHEN '...'.
      " do something
 
    WHEN others.
      " do something else
    ENDCASE.

Regards

Uwe

Read only

0 Likes
584

Hi Uwe,

Thanks for your reply. I did manage to resolve the issue. The BADI was not implemented properly and hence causing the problem.

Any wan thanks for your response.

Best regards,

Vikash.