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

Background job

former_member182337
Participant
0 Likes
736

Hi,

I have a program which is running slow in the foreground. The transaction has two buttons - Save and Continue. If i choose some entry and click on the save

button it works fine but the problem is with the continue button.IF i choose some entry and click on the continue button it should give me an alv output but instead

it gets timed out. Is it possible to schedule background job for the COntinue button alone? IF so, can you please tell me how.

Thanks,

Prem

Moderator message: please use more descriptive subject lines for your posts.

Edited by: Thomas Zloch on Apr 27, 2011 3:35 PM

6 REPLIES 6
Read only

Former Member
0 Likes
692

Hi,

Using ABAP runtime analysis (SE30), try to find out the piece of code which is consuming more time. Try to correct the particular code and execute the transaction in foreground itself.

Otherwise using the transaction input scenarios, create a report program to display the ALV output and schedule this report program in the background.

Or else try by developing a BDC program for your transaction with the CONTINUE button and schedule this BDC program in the background to get the report output.

Thanks & Regards,

Harish

Read only

Former Member
0 Likes
692

Hi,

Try to improve the performance of the report.

regards,

Sakshi

Read only

0 Likes
692

Thanks for your inputs. Can you please tell me how to create background job for the CONTINUE button. Like isn't there a way by which all the set of statements that gets executed on clicking the CONTINUE button should be done in background

Read only

0 Likes
692

Hi,

When you press the CONTINUE Button you can use the Function Modules JOB_OPEN & JOB_CLOSE.


DATA: w_jobacount TYPE tbtcjob-jobcount,
        w_jobname   TYPE tbtcjob-jobname.

    w_jobname = 'jobname'.

*$ Creates Job 
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = w_jobname
      IMPORTING
        jobcount         = w_jobacount
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.

" Your Processing

CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount             = w_jobacount
        jobname              = w_jobname
        strtimmed            = c_x  "Immediate start.
      EXCEPTIONS
        cant_start_immediate = 1
        invalid_startdate    = 2
        jobname_missing      = 3
        job_close_failed     = 4
        job_nosteps          = 5
        job_notex            = 6
        lock_failed          = 7
        OTHERS               = 8.

    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

Regards,

Ernesto.

Read only

Former Member
0 Likes
692

Hi Prem,

Instead of Scheduling BG Job Try this FM 'SAPGUI_PROGRESS_INDICATOR'

Eg :

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

PERCENTAGE = 30

TEXT = 'please wait data extracting '.

Regards

Rajashiva Ramalingam

Read only

Clemenss
Active Contributor
0 Likes
692

Hi premkumarwow

create a batch-input session for this, run as job. Use transaction SHDB to create program.

Regards,

Clemens