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

Error while calling a BADI

JJosh
Active Participant
0 Likes
1,387

Hi,

I have implemented one badi /POSDW/ACTION. But, when I am trying to call the BADI Implementation inside the program, it is giving the below error.

CLASS XX does not contain an interface.

Can you give some inputs pls.

Code:

DATA: lw_handler TYPE REF TO /POSDW/ACTION.

****

   GET BADI LW_HANDLER

     FILTERS

       /POSDW/ACTIONFILTER = '0004'.

     CALL BADI LW_HANDLER->/POSDW/IF_EX_ACTION~CALL

     EXPORTING

       FLT_VAL           = '4'

                 I_TRANSACTION     = lwa_tran

                 I_TASK            = lwa_task

                 I_RULE            = lwa_rule

                 I_CONDITIONRESULT = ''

                 IT_RULERESULT     = lt_result.

BR/ Josh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,124

Hi Josh

could you please try this approach

DATA bd TYPE REF TO badi_name.

GET BADI bd

     FILTERS

          lang = 'D'.

CALL BADI bd-> method

             exporting x= 10.

by seeing the way of calling in your program

CALL BADI LW_HANDLER->/POSDW/IF_EX_ACTION~CALL


you had included an interface too over here. Request you to please check that and see whether its really required or not while calling methods in that BADI.


Thanks

2 REPLIES 2
Read only

Former Member
0 Likes
1,125

Hi Josh

could you please try this approach

DATA bd TYPE REF TO badi_name.

GET BADI bd

     FILTERS

          lang = 'D'.

CALL BADI bd-> method

             exporting x= 10.

by seeing the way of calling in your program

CALL BADI LW_HANDLER->/POSDW/IF_EX_ACTION~CALL


you had included an interface too over here. Request you to please check that and see whether its really required or not while calling methods in that BADI.


Thanks

Read only

JJosh
Active Participant
0 Likes
1,124

Thankyou Kishore.

Issue was not just that. Since the new BADI implemented was called inside another badi implementation, there was a conflict occurring while the method is called.

I have created a spot inside and then called the badi.

New Code.

GET BADI LW_HANDLE FILTERS /POSDW/ACTIONFILTER = '0005'.

    

CALL BADI LW_HANDLE->CALL

      EXPORTING

        FLT_VAL           = '0005'

        I_TRANSACTION     = lwa_tran

        I_TASK            = lwa_task

        I_RULE            = lwa_rule

        I_CONDITIONRESULT = ''

        IT_RULERESULT     = lt_result.

This worked fine.