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

BADI, TYPE REF TO INTERFACE

0 Likes
1,128

Dear ABAP Gurus,

I am new to OOP Programming and need your valuable help in implementing the BADI (BADI Definition WCB_HEADER_PBO_BADI, Method: IF_WCB_HEADER_PBO_BADI~PBO  .

My issue is in fetching the value from the interface IF_WCB_HEADER_PBO_BADI,by using the method GET_DATA.

My issue is class CL_WCB_CC requires mandatory paramenters to create object (constructor method). Syntax error on statement ("create object OBJ.") And these parameters are then referred to another class(Type Ref To). So i'm not sure how to declare these mandatory parameters. As per my understanding, i dont think its possible to call method in interface, without creating object.My objective is to access the structure E_KOMWCOCOH which is accessible from method GET_DATA in interface IF_WCB_HEADER_PBO_BADI.


Below is my code, let me know if you need further details.

METHOD if_wcb_header_pbo_badi~pbo.
  
data: l_getdata Type komwcocoh,
         REF1 TYPE  WCB_TEXT_DESCRIPTION.

data: OBJ REF TO CL_WCB_CC.


create object OBJ.

call METHOD obj->if_wcb_header_ro~get_data
  IMPORTING
   e_komwcocoh   =  l_getdata   " Communication Structure for Condition Contract Header
   e_description =  REF1   " Text Fields
.

ENDMETHOD.

'


Thanks in advance,


George

1 ACCEPTED SOLUTION
Read only

0 Likes
811

solved by myself. Thank you all

1 REPLY 1
Read only

0 Likes
812

solved by myself. Thank you all