cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BTP - In which scenario would you define a local class inside a Global class?

amitgoyal
Explorer
0 Kudos

I would like to understand under which scenario would you define a local class within a global class? Can someone give some valid scenarios?

Sandra_Rossi
Active Contributor

Why SAP BTP? It's just an ABAP question.

I create a local class when I feel that my global class is too complex but not worth creating another global class...

abo
Active Contributor

I suspect BTP is what the author has and thus mentioned it for the sake of completeness.

Anyway, another very typical example is a test class.

amitgoyal
Explorer

Thanks Sandra & Andrea for your inputs.

I was going through the new ABAP BTP Learning and that's why I asked it related to BTP but you are correct this applies to both worlds.

FredericGirod
Active Contributor
0 Kudos

test class are local

Accepted Solutions (0)

Answers (1)

Answers (1)

patrick_winkler
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

you can find scenarios for local classes here:

https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#global-by-default-local-only-wh...

Regards,

Patrick