‎2009 Apr 15 2:35 PM
Hi Friends,
i am facing one problem while preparing code in proxy class method. i need to use same code so many places in my class method for that purpose i was trying to use perform statements but system is giving syntax error 'Forms can not be defined in a class pool For this reason, there are no perform statements for internal FORM'S'.
With out perform statements how to handle the repetative logic in same program. Any help will be highly appreciated.
Thanks a lot in advance.
‎2009 Apr 15 2:39 PM
A better approach wuld be to use methods instead of forms.
the methods should ideally be in Private Visibility (Chose the option Private for Visibility field)
Regards,
Ravi Kanth Talagana
‎2009 Apr 15 2:39 PM
A better approach wuld be to use methods instead of forms.
the methods should ideally be in Private Visibility (Chose the option Private for Visibility field)
Regards,
Ravi Kanth Talagana
‎2009 Apr 15 2:42 PM
Hi ,
Thanks for your reply. Can you pl tell me how to use methods with one example. Do you mean to say we need to create methods separetly for each reusable logic?
‎2009 Apr 15 3:00 PM
If you are talking about global classes,
then go to SE24 and create your class.
In the class go to Methods tab, give a name to your method, Define it as a static method, if you want the values to be persisted and not specific to the instances that are created based on your class.
Give the visibility as private, becuase you want these private methods only to be called in your class only.
Then click on parameters and define your exporting and importing parameters.
Double click on the method name and have your repetitive code there.
YOu can call this method in other methods of the class using
call method <method name>statement.
Regards,
Ravi
‎2009 Apr 15 2:44 PM
Hi Babji,
Create private methods for each subroutine you have at the moment in the same CLASS where you are creating the public methods. Then instead of calling the subroutines .... call the private methods.
Cheers,
Aditya
‎2009 Apr 15 2:56 PM
Hi,
The best way is Create a private method with the repetative code in the same class and call that method in other methods of that calss wherever you need.You call that method any no. of times from any method in that class.
by
Prasad GVK.