08-24-2015 3:05 PM
Hi,
I was thinking, why it isn't possible to schedule a method of a class?
Any idea?
Thanks,
Abhi
08-25-2015 10:58 AM
The absolute definitive answer is very simple: "SAP haven't implemented the functionality".
08-24-2015 3:36 PM
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
08-24-2015 5:03 PM
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
08-24-2015 5:34 PM
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
08-24-2015 5:38 PM
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.
08-24-2015 5:41 PM
i mean class is imaginary and object is realtime and it occupies memory
08-25-2015 10:39 AM
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
08-25-2015 10:58 AM
The absolute definitive answer is very simple: "SAP haven't implemented the functionality".
08-25-2015 11:17 AM
Hi Matthew - it's already clear but is there any specific reason for it?
Thanks,
Abhi
08-25-2015 12:02 PM
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
08-25-2015 12:30 PM
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.
08-25-2015 1:13 PM
Alex has got some valid points but not all scenarios are dependent on these points...
Anyway, thank you both Alex and Matthew.
08-25-2015 6:30 PM