Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Home grown BAdI (Enhancement Spot) - Method "SEND_MESSAGE" is unknown or PROTECTED or PRIVATE

$
0
0

Hi,

 

I am trying to create home grown BAdI .

 

Using SE18 I created:

 

Enhancement Spot: Y_EITAN_ENHANCEMENT_SPOT_01 .
Enhancement implementation: Y_ENHANCEMENT_IMP_01
Interface for a BAdI: Y_EITAN_BADI_01_INT
BAdI Definition: Y_EITAN_BADI_01
BadI Implementation: Y_EITAN_BADI_01_IMP_01
Implementing Class: Y_EITAN_BADI_01_IMP_01

 

Screens:

 

screenshot_01.png

screenshot_02.png

 

screenshot_03.png

 

screenshot_05.png

No problem so far....

 

I created a test program Y_R_EITAN_TEST_51_18 .

 

*----------------------------------------------------------------------*
FORM test_02 .

 

  DATA: ob_y_eitan_badi_01 TYPE REF TO y_eitan_badi_01 .

 

  GET BADI ob_y_eitan_badi_01 .

 

* Does not compile....
* Complain about: Method "SEND_MESSAGE" is unknown or PROTECTED or PRIVATE


  CALL METHOD ob_y_eitan_badi_01->send_message
    EXPORTING
      message = 'Hi there from test 02 .'.

 

  BREAK-POINT .

 

ENDFORM .                                                   "test_02
*----------------------------------------------------------------------*

 

I get this syntax message: Method "SEND_MESSAGE" is unknown or PROTECTED or PRIVATE

 

screenshot_06.png

 

To verify that method "send_message" is public I have created this piece of code and it is

compiling and working with no problem.

 

As you can see I am using the interface and the class from the BadI .

*----------------------------------------------------------------------*
FORM test_01 .

 

* A class that implement Y_EITAN_BADI_01_INT interface
  DATA: ob_y_eitan_badi_01_imp_01 TYPE REF TO y_eitan_badi_01_imp_01 .

 

  CREATE OBJECT ob_y_eitan_badi_01_imp_01 .

 

* Interface
  DATA: ob_y_eitan_badi_01_int TYPE REF TO y_eitan_badi_01_int .

 

  ob_y_eitan_badi_01_int ?= ob_y_eitan_badi_01_imp_01 .

 

  CALL METHOD ob_y_eitan_badi_01_int->send_message
    EXPORTING
      message = 'Hi there from test 01 .'.

 

ENDFORM .                                                   "test_01

*----------------------------------------------------------------------*

 

Am I missing somthing here ?

 

Regards.


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>