Application Development 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: 

Job Scheduling

Former Member
0 Kudos

Hi,

I was thinking, why it isn't possible to schedule a method of a class?

Any idea?

Thanks,

Abhi

1 ACCEPTED SOLUTION

matt
Active Contributor
0 Kudos

The absolute definitive answer is very simple: "SAP haven't implemented the functionality".

12 REPLIES 12

Former Member
0 Kudos

Hi Abhi,

One of the reasons will be that the SAP job scheduler pre-dates ABAP objects, and has not changed greatly since the early versions of R/3.

There will likely be others, but I'll throw that in for starters.

Regards,

Nick

0 Kudos

job can be scheduled on complete entities or  programs like reports not on incomplete entities since methods are just an individual entity of  class and class cant perform entire functioning of its own . it can be used by putting it into some  programs . so its not possible to schedule jobs on methods and classes

0 Kudos

Thanks for the reply Nick and Prakash.

@Prakash: I disagree. The class can perform entire functioning on its own (Only except the functionality that involves Dynpros). You can code entire functionality within class and assign it to a transaction (like u do it in MVC). Also, you will not require a Dynpro for a functionality, that you would want to schedule in background. So, basically it should be allowed to schedule any method of a class. or?

Rgds,

Abhi

0 Kudos

Dear Abhi,

            Class is not an objects its just blue print. it can be used only via objects i.e instantiation a class is nothing but creating an object. Now can you explain me how it will be instantiated. this is only possible to use aprogram or report and the instantiate the class.

0 Kudos

i mean class is imaginary and object is realtime and it occupies memory

0 Kudos

Hi Prakash,

When you call an OO-transaction (created for the method of a class), the object of that class gets created automatically in the background and then the call to the method is made. You do not have to explicity create an object for it. Alternatively, you can use static methods to carry out the execution.

The same way it is possible with the Job Scheduling but still we do not have the option of scheduling a method of a class. Why?

Rgds,

Abhi

matt
Active Contributor
0 Kudos

The absolute definitive answer is very simple: "SAP haven't implemented the functionality".

Former Member
0 Kudos

Hi Matthew - it's already clear but is there any specific reason for it?

Thanks,

Abhi

0 Kudos

Hi,

I agree with Matthew. You sometimes see reports running in batch that consist of single (static) method calls. That way you can indeed use your beloved OO ABAP code from a background report.

Let me give some reasons why transferring background execution from report to method is not trivial:

1) Parameters for reports are persisted as (report) variants. To my knowledge, there is no such infrastructure for arbitrary method parameters.. (becomes interesting when parameters are object instances).

2) Print parameter determination for batch steps is related to report syntax (report xyz line-size c line-count l). Report-specific print parameter defaults can be set  (note 323855).

Regards,

  Alex


matt
Active Contributor
0 Kudos

There presumably is a reason. The most likely one, in my opinion, is that SAP haven't got around to it yet.

If you want to know why they've not done it so far is, then you'd need to talk to ABAP product managers and developers.

Former Member
0 Kudos

Alex has got some valid points but not all scenarios are dependent on these points...

Anyway, thank you both Alex and Matthew.

Jelena
Active Contributor
0 Kudos

If this is your biggest problem with SAP then I truly envy you.