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

Attribut STATIC type CLASS from a CLASS

Former Member
0 Likes
1,848

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.

1 ACCEPTED SOLUTION
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,738

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.

7 REPLIES 7
Read only

pokrakam
Active Contributor
0 Likes
1,738

It isn’t.

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

Read only

Former Member
0 Likes
1,738
It isn’t.

Why ?

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

Read only

pokrakam
Active Contributor
0 Likes
1,738

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.

Read only

Former Member
0 Likes
1,738

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

Read only

pokrakam
Active Contributor
1,738

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?

Read only

Sandra_Rossi
Active Contributor
1,738

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

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,739

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.