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

Need error message in foregorund,when its executed in background

Former Member
0 Likes
748

Hi

I have a program which runs in background every hour, so when the background job is active and if the same program is executed in foreground, i should throw an error in the selection screen.

Is there any table which has this information, one more thing, the status of the job should be active and not released that I should throw an error.

Pls respond.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
634

Hi,

You can do this be checking the table TBTCO with start date and Job status as 'R'.

Thanks,

Vikram.M

Hi

I have a program which runs in background every hour, so when the background job is active and if the same program is executed in foreground, i should throw an error in the selection screen.

Is there any table which has this information, one more thing, the status of the job should be active and not released that I should throw an error.

Pls respond.

Thanks

3 REPLIES 3
Read only

Former Member
0 Likes
635

Hi,

You can do this be checking the table TBTCO with start date and Job status as 'R'.

Thanks,

Vikram.M

Read only

Former Member
0 Likes
634

You have to use ENQUE and DEQUEUE function modules.

In INITIALIZATION event, add the following code:


  CALL FUNCTION 'ENQUEUE_ESVARIANT'
       EXPORTING
            mandt          = sy-mandt
            report         = g_repid         "copy of SY-REPID
       EXCEPTIONS
            foreign_lock   = 1
            system_failure = 2
            OTHERS         = 3.
  IF sy-subrc <> 0.
*  Somehow display your error message here.
  ENDIF.

In END-OF-SELECTION event, dequeue using the following code:


  CALL FUNCTION 'DEQUEUE_ESVARIANT'
       EXPORTING
            mandt  = sy-mandt
            report = g_repid.

Read only

Former Member
0 Likes
634

solved