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

Call static method in background

Former Member
5,239

Is it possible to call a static method from a public class in background??

Thanks!

Artur.

1 ACCEPTED SOLUTION
Read only

Former Member
2,532

Technically, you cannot call a method in the background mode, however you can call its content in the background, just transfer the content of the method to a parameterised report-type program and use SUBMIT VIA JOB statement.

class=>run_in_background( parameters ... ).

METHOD run_in_background.
  SUBMIT zrun_in_background ... VIA JOB...
ENDMETHOD.

4 REPLIES 4
Read only

matt
Active Contributor
0 Likes
2,532

Yes... unless the method needs interaction with the front end.

Read only

Former Member
0 Likes
2,532

Can you tell me how can I call it in background please?

Thanks!

Read only

matt
Active Contributor
0 Likes
2,532

In exactly the same way as you call it in foreground!

Your question doesn't make sense. It's like asking "Can I run a function module in background". Or "Can I run a program in background". Generally speaking, yes you can. What we need to know is which method your wanting to call. The fact that it is static, or indeed a method, is utterly irrelevant to whether you can call it in background.

What are you trying to achieve?

Read only

Former Member
2,533

Technically, you cannot call a method in the background mode, however you can call its content in the background, just transfer the content of the method to a parameterised report-type program and use SUBMIT VIA JOB statement.

class=>run_in_background( parameters ... ).

METHOD run_in_background.
  SUBMIT zrun_in_background ... VIA JOB...
ENDMETHOD.