Application Development 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: 

Method Call

Former Member
0 Kudos

Hi Folks,

I want to use the following method code in my BADI enhancement,

CALL METHOD MESSAGE_HANDLER->ADD_MESSAGE

EXPORTING

IM_TYPE = 'E' "Type of Message

IM_CL = 'XXX' "Message class that you created

IM_NUMBER = 'XXX' "Message no

IM_PAR1 = 'SIMULATE_VIA_BLOP'

IM_PAR2 = 'IF_EX_PT_ABS_REQ~SIMULATE_VIA_BLOP' "Method name as in our impl.

IM_PAR3 = 'BLOP'

IM_CONTEXT = ''

IM_SUBCONTEXT = ''

IM_CLASSNAME = 'CL_PT_ARQ_BLOP_ADAPTER'

IM_METHODNAME = 'MESSAGE'.

Please let me know what declarations I should use and implement so this function call will run smoothly.

5 REPLIES 5

shishupalreddy
Active Contributor
0 Kudos

Hello,

Here U need to create an instance of the class I mean Object using

DATA : MESSAGE_HANDLER TYPE REF TO <CLASS NAME>

CREATE OBJECT MESSAGE_HANDLER .

Then u can call the method with ur statements .

Regards

0 Kudos

Thanks for your reply.

After declarations now I'm getting the following error message

"Method ADD_MESSAGE is unknown or PROTECTED or PRIVATE"

0 Kudos

This means, you can't access this method from outside of the (sub)class. This probably means that this particular method is called from within another method of the class. Try and find out if there is such a method.

0 Kudos

Correct!!! This method (ADD_MESSAGES) is under class CL_PT_REQ_MESSAGE_HANDLER

So should I declare this class also?

0 Kudos

Thanks Shishupal and Micky

Please let know the way to declare this add_message method which is apart of class CL_PT_REQ_MESSAGE_HANDLER.