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

Sub class constructor

Former Member
0 Likes
395

Hi Folks,

I have created an exception class ZCX_SANJEEV_TEST1 which has a super class CX_STATIC_CHECK. As soon as I created the class, the following components came in automatically for the ZCX_SANJEEV_TEST1 class:

A. Two interfaces - IF_SERIALIZABLE_OBJECT and IF_MESSAGE

B. A constructor method CONSTRUCTOR and 3 other methods - IF_MESSAGE~GET_TEXT, IF_MESSAGE~GET_LONGTEXT and GET_SOURCE_POSITION.

As per my understanding, this constructor method is nothing but should only call Superclass's constructor, and that is exactly what it is doing. Now I have two questions over here:

1. When I inserted one more  interface IF_T100_MESSAGE in the class ZCX_SANJEEV_TEST1, the code in the constructor changed. Now along with calling the superclass constructor, there is some more code below it. Where is this code coming from? Moreover, the call to super->constructor has been changed. Now its just passing one parameter in the call rather than two as earlier.

2. I want to change this code a bit, how should I do it?

3. I want to add one more import parameter to this method. How should I do it?

<removed by moderator>

Regards,

Sanjeev

Message was edited by: Matthew Billingham

1 REPLY 1
Read only

matt
Active Contributor
0 Likes
358

I've removed your text about a quick reply. Such comments are generally considered rude. Everyone wants a quick reply to their question.

1) When you activate an exception class the constructor and other parts of the class are generated.

2) You can't edit the constructor of your class (you can enhance it, which is useful for some scenarios).

3) If you want another import parameter, then create a new public attribute and activate the class.