cancel
Showing results for 
Search instead for 
Did you mean: 

job sceduling for web dynpro application

Former Member
0 Kudos

Hello everyone,

Can we by any means execute a web dynpro application periodically? does anyone have any idea regarding the job scheduling functionality in web dynpro application? any tool within SAP which supports it or any other way for executing the applciation within particular intervals. if any WAS changes or configuration does the job. Please help, its a bit urgent,

Thank you,

Regards,

Gita K Chhatri.

Accepted Solutions (1)

Accepted Solutions (1)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi,

why dont you try this

/people/prakash.singh4/blog/2005/04/20/did-you-know-you-can-schedule-jobs-in-portal-using-kms-scheduler-task

Regards,

Naga

Former Member
0 Kudos

Hi Kelly,

Thank you for the idea. Can you please provide me with some more information about the same, like how the application is called once i include this class in my component. Where exactly do I have to include this class and other details.

Thank you,

Regards,

Gita K Chhatri.

Former Member
0 Kudos

Gita,

Create a Java class in an appropriate package under the "src" folder in your WD project. Have the class extend the Thread class. That part is basic Java that is described in any text book or Sun tutorial. Then, specific to your application logic, at the appropriate place/time, create an instance of that class and start it. Keep the Thread reference in local variable or something so you can interrupt it if need be.

I have not yet done this in WD but will be soon. I'm considering starting the thread in the init method of the application's component controller. In other straight J2EE projects, I have started threads in the servlet init method, which is the same idea. If you want to start the thread on user demand, you can, for example, start it in the action method of a pushbutton or something. All alternative might be to start it in a static block, which gets executed when the class is loaded by class loader. A caveat here would be that behavior might depend on the particular class loader implementation; I believe SAP provides their own class loader implementation.

Thread safety is something to be very careful about, especially if you have multiple threads. So make sure you understand those multi-threading issues before you go very far with your implementation.

Hope that provides the details you need.

Best regards,

Kelly

Former Member
0 Kudos

Gita,

If you want to "roll your own", use the threading facilities built into Java. I've decided to do that with my application. Simply create a class that extends Thread. In the run method of your class, implement an infinite loop something like the following:

  public void run() 
    {
        while ( ! isInterrupted())    {
            try {
                 // Do your work here then sleep for a while.
                 Thread.sleep (SLEEP_INTERVAL_SECONDS * 1000);
            }
            catch (InterruptedException e)  {
               // Thread was interrupted
            } 
        }   // while
    } // run()

I can provide additional details if you decide to take this route. Simply create and start the thread in the appropriate place in your Web Dynpro code.

Regards,

Kelly

Former Member
0 Kudos

chk it

/people/sap.user72/blog/2005/12/27/the-new-sap-netweaver-job-scheduler-a-redwood-oem-tool