cancel
Showing results for 
Search instead for 
Did you mean: 

Using attribute of supertype in subtype ???

Former Member
0 Kudos

hi there,

i have a SUPERTYPE called LSO_TRAINI. i created a subtype Z_LSO_TRAIN and delegated supertype to subtype.

so far, so well.

but: in supertype there is a attribute lso_traini.begindate. i have to use this attribute in my subtype, how is this possible ?

the generated code for my program in Z_LSO_TRAIN in SWO1-transaction includes only the object-key from supertype ! not the attributes of it.

any ideas ?

reg, Martin

Accepted Solutions (1)

Accepted Solutions (1)

KKilhavn
Active Contributor
0 Kudos

Hmm... I checked the thread Ravi was pointing to and couldn't see the question you ask here in that thread. So I'll give you an answer, but also request that you try to study some SAP code to learn from it before posting your next question here. When you are new to workflow there are many things you don't know the answer to. Quite often you will find the answer by looking at SAP code. (Actually, also when you have been working with workflow for more than 5 years there will still be many things you don't know the answer to - but at least you will then know most of the basics regarding object types, delegation, events etc.)

The answer is that you should access attributes the same way always, by using the SWC_GET_PROPERTY macro. Anything else is unsafe. In the attribute code you (or SAP) will either use a value that has been retrieved already, or retrieve the value. Then the container element will be filled with the value. If you access the object-* elements directly the value may not have been retrieved yet (no-one has requested it).

<i>Message was edited by Kjetil Kilhavn:</i>

Always.... it's a dangerous word. If the attribute is a multiline attribute you need to use SWC_GET_TABLE_PROPERTY of course.

Former Member
0 Kudos

@ravi,

new problem = new tread

my other question has nothing to do with this !

@Kjetil

THANK YOU so much ! my problem is solved !

full points for you !

Former Member
0 Kudos

@Martin

Here's a response...

hemalatha nagha...

Posts: 30

Questions: 4

Registered: 6/7/07

Forum points: 22

Re: changing workflow for LSO

Posted: Dec 11, 2007 9:20 PM in response to: Martin Svik Reply E-mail this post

Hi Martin

You have to create a subtype...the i'll <b>automatically inherits all the attributes,methods and events from the supertype(SAP Standard Business object).

Then you have to create your own attribute or method or event...After that you should delegate the subtype to supertype</b>...

Regards,

Hemalatha

The attributes are available to the subtype. I felt you would get the hint...

Ravi

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Can you check answers in the other thread that you have open for the same issue?

Also, update that ... and close it if you have found an answer..

Ravi