Skip to Content
-1

Attribut STATIC type CLASS from a CLASS

Mar 08 at 03:04 PM

59

avatar image
Former Member

Hi Gurus,

I would like to know, how it is possible to have a STATIC CLASS as an attribut from another CLASS as below:

ZCL_STATIC_01=>ZCL_STATIC_02=>method_01( ) .

I would like a stuff like that (and only in STATIC class and method):

Thank you in advance.

jpg.jpg (114.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Horst Keller
Mar 09 at 03:56 PM
0

There is no nesting of classes in ABAP Objects.

If you want to model that, use Interfaces. Interfaces can be nested. But the benefits also appear with instantiated objects and interface reference variables only.

Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi Mar 08 at 07:31 PM
1

But why not ZCL_CAD_SERVICES=>sd->billing->bapi_billingdoc_display ? It doesn't cost a lot to instantiate a few objects. If there are too many objects to instantiate, then use methods: ZCL_CAD_SERVICES=>sd( )->billing( )->bapi_billingdoc_display

Share
10 |10000 characters needed characters left characters exceeded
Mike Pokraka Mar 08 at 03:20 PM
0

It isn’t.

If you explain the problem you’re trying to solve, someone may be able to offer an alternative solution.

Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member
It isn’t.

Why ?

Basically, I would like something like that without any instanciations.

jpg.jpg (114.5 kB)
0

I still don’t see the point. If you want to make billing static the you no longer need the parts in front and can just use zcl_billing directly.

0
Former Member
Mike Pokraka

To benefit an online tree structure based on the functional design with an entry point "ZCL_SERVICES" ...

0

Sorry to be blunt here, but if there is no functional reason and the purpose is having pretty code / editor capability is one of the worst possible reasons for choosing an OO design

Personally I would find this a pain to work with and harder to read. Those that work at that level should know what a billing document is, so what’s the point of making it longer and adding unnecessary info?

1