2012 Jun 14 9:24 AM
Hi,
i'm working on a local class, and I have a message class defined for this local class.
How can i assign this message class in the local class definition or implementation ?
with kind regards,
Hans
2012 Jun 14 3:05 PM
Hi,
i'm working on a local class, and I have a message class defined for this local class.
How can i assign this message class in the local class definition or implementation ?
with kind regards,
Hans
2012 Jun 14 1:20 PM
Hello Hans,
I'm not too sure if i understand your question.
Are you talking about assigning a Message class to a local class (something similar to the addition MESSAGE-ID for the REPORT statement). AFAIK there is no such corres. addition available for local classes - you've to use the long form to issue the message.
BR,
Suhas
2012 Jun 14 1:40 PM
Hi Hans,
or are you talking about exception classes?
You're right global exceptions classes have the feature to assign a message class, local exception classes don't as far as I know.
Maybe this can be implemented somehow using interface IF_T100_MESSAGE.
Regards,
Dirk
2012 Jun 14 2:41 PM
Hello Dirk,
Dirk Wittenberg wrote:
You're right global exceptions classes have the feature to assign a message class ...
I don't think you can assign a particular Message Class to an exception class. You've to explicitly mention the Message Class & number when defining the message texts for the exception class.
Please correct me if i'm wrong!
BR,
Suhas
PS: I'm currently working on an ECC6.0 EhP3 system.
2012 Jun 14 3:15 PM
Hi Suhas,
I was referring to the field "Message class" on the "Properties tab" in SE24:
But you're right, when implementing interface IF_T100_MESSAGE the type of the parameter TEXTID of the constructor changes to IF_T100_MESSAGE=>T100KEY which contains the message class also.
So what is this field in the general data for?
Regards,
Dirk
2012 Jun 15 5:03 AM
Hello Dirk,
This option is available for all class types (read: not restricted to Exception classes only).
When you specify a message class in this field, this behaves as the default message class (similar to the MESSAGE-ID addition).
BR,
Suhas
2012 Jun 15 9:29 AM
Hi Dirk, i'm not talking about exception classes, but normal message classes (T100)
2012 Jun 15 9:59 AM
2012 Jun 14 3:05 PM
2012 Jun 15 5:11 AM
Hello Raymond,
A very valid point Raymond.
I would rather not say "redundant" in this case. I will rephrase it as, "cause conflict with the MESSAGE-ID associated with the REPORT/FUNCTION-POOL".
Cheers,
Suhas
2012 Jun 15 9:20 AM
2012 Jun 15 9:28 AM
yes, that is what i want. I'm not using the message-id of the report, because if i have 3 local classes (with 3 different message classes), i can assign a different message class to each local class.
2012 Jun 15 9:32 AM
Hi all,
thanks for all your answers.
The best approach is probably to use the MESSAGE-ID of the REPORT/PROGRAM statement.
But i would prefer to add it to the local class itself between CLASS x DEFINITION. and ENDCLASS. With this solution i would be able to assign specific/different message classes (T100) to different local classes in my program.
with kind regards,
Hans
2012 Jun 15 9:55 AM
You could declare a constant in the declaration section of the class (so static attribute) message_id and use the me=>message_id in your message statements.
Regards,
Raymond
2012 Jun 15 10:15 AM
Hi Hans,
definining a message-id btw. class and endclass would be a nice feature but only necessary for local classes as global classes seem to have there own invisible program wrapping them ( classname==CP ).
And obviously the message-id option for this wrapping program is used to store the message class you can enter in global classes as this can neither be seen in the public, protected nor private section.
But anyway, what about posting this in the idea place here in the SCN?
Regards,
Dirk
2012 Jun 15 10:50 AM
Dirk Wittenberg wrote:
But anyway, what about posting this in the idea place here in the SCN?
Yes, that's a good idea 😉
Done :
see https://cw.sdn.sap.com/cw/ideas/11246
Hans