05-20-2009 10:50 AM
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.
05-20-2009 10:54 AM
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
05-20-2009 10:59 AM
Thanks for your reply.
After declarations now I'm getting the following error message
"Method ADD_MESSAGE is unknown or PROTECTED or PRIVATE"
05-20-2009 11:11 AM
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.
05-20-2009 11:15 AM
Correct!!! This method (ADD_MESSAGES) is under class CL_PT_REQ_MESSAGE_HANDLER
So should I declare this class also?
05-20-2009 11:31 AM
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.