Skip to Content
avatar image
-1
Former Member

Attribut STATIC type CLASS from a CLASS

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 09 at 03:56 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 08 at 07:31 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 08 at 03:20 PM

    It isn’t.

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

    Add comment
    10|10000 characters needed characters exceeded


    • 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?