cancel
Showing results for 
Search instead for 
Did you mean: 

Subtyping bus1001006

0 Kudos

On casting BUS1001006, I see that the methods used in steps from Z1001006 execute properly. However if I have created new attributes on Z1001006, in fact inherited attributes too, and use them in the steps, they do not show up. Is there something I need to do for this?

Here is my code for CreateMe method:

BEGIN_METHOD CREATEME CHANGING CONTAINER.

DATA:

OBJECTIN TYPE SWC_OBJECT,

OBJECTOUT TYPE SWC_OBJECT.

TABLES: MARA.

DATA: local_object_key LIKE MARA-MATNR.

SWC_GET_ELEMENT CONTAINER 'ObjectIn' OBJECTIN.

SWC_GET_ELEMENT CONTAINER 'ObjectOut' OBJECTOUT.

SWC_GET_OBJECT_KEY ObjectIn local_object_key.

SWC_CREATE_OBJECT ObjectOut 'ZB1001006' local_object_key.

END_METHOD.

My other observation is when I create the ObjectIn and ObjectOut parameters, the Object Type defaults to Z1001006. I can select the required 'Data Reference Type'.

Regards,

Gayathri

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi Experts,

Thanks for your replies. The reason I was trying casting was because we have the automotive best practices packages loaded in our system. This package has delegated BUS1001006 to subtype ADB1001006. I do not want to extend ADB1001006 and I want to create my own subtype. I have an other question posted about subtyping bus1001006 itself in which one expert Tom Carruth suggested casting. I tried this. I was able to access methods of the subtype, but not the attributes. If any of you have any idea about casting please let me know with sample codes.

Thanks a bunch.

Regards,

Gayathri

0 Kudos

Thanks for the catch Ronit. If I create a 'Send Mail' step type and in the message I want to display an attribute 'General Item Category Group' which is defined only in the subtype Z1001006, I see this attribute only in the subtype and not the supertype. So Manish can you please explain your statement.

Tom Carruth suggested the idea of casting. Tom can you please answer my question. Anyone else is very welcome too.

Regards,

Gayathri

Former Member
0 Kudos

Hi,

delegate the Z Bo to the bus1001006. then the attributes and method present in Z bo can be used.

Thanks,

Preethi

Former Member
0 Kudos

My mistake - When I mentioned 'Inheritance' I assumed that you would delegate the BO.

Anyways once you extend an object, do delegate it. Delegation holds the key :).

Once this is done the subtype (and its elements) can be referred to by calling the supertype.

Former Member
0 Kudos

Hi,

In your code and in your task you must use the original object type bus1001006.

In your code I saw that you used zb1001006 instead of z1001006.

Regards,

Ronit.

Former Member
0 Kudos

The best part of inheritance is that you can refer elements of subobject/subclass through the parent itself irrespective of the level of inheritance.

The reverse does not hold good.