‎2019 Jan 04 9:05 PM
Hi all
I would like to know, how can I create a singleton class pattern with parameters?
In other programming language I can overload the class-constructor but since in ABAP overloading a method is not possible, how can I pass the parameters?
Thanks
‎2019 Jan 05 8:24 AM
Hi Anujit,
Why do you want to pass a parameter to the singleton class constructor ??. Can you please elaborate it ??..
‎2019 Jan 05 10:56 AM
This has already been answered several times in the forum: use optional parameters to mimic the overloading. Be careful when you use the term "class constructor", it has a special meaning in ABAP (it can't have any parameter), so I guess you mean simply "constructor".
‎2019 Jan 05 11:28 AM
A class-constructor in ABAP is like a static class initialiser in Java.