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

Error in class method

Former Member
0 Likes
1,557

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,320

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

5 REPLIES 5
Read only

Former Member
0 Likes
1,321

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

Read only

0 Likes
1,320

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?

Read only

0 Likes
1,320

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

Read only

Former Member
0 Likes
1,320

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

Read only

Former Member
0 Likes
1,320

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.