Skip to Content

Abending a job when data is locked

We are working in APO DP. there are some jobs that show a Finished status (successfully) even when the log says that data was locked. hence the process that typically takes 10 minutes finishes successfully in 1 sec. Is there a way through some user parameter or lock object setting to abend or stop the job if it finds that the object that it is supposed to work on is found locked by another user?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 04:05 PM

    Issue an error message.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 30, 2007 at 04:17 PM

    Hi

    My best guess is,

    when sap is trying to read data and it found locked at that stage you write a program to check for locking concept for the table, then you will need to raise an error

    sample code

    DATA: l_varkey TYPE rstable-varkey.

    l_varkey = sy-mandt.

    CALL FUNCTION 'ENQUEUE_E_TABLE'

    EXPORTING

    mode_rstable = 'E'

    tabname = '/VWNA/WHRS_MULTI'

    varkey = l_varkey

    EXCEPTIONS

    foreign_lock = 1

    system_failure = 2

    OTHERS = 3.

    IF sy-subrc <> 0.

    MESSAGE E038.

    ELSE.

    CALL FUNCTION 'DEQUEUE_E_TABLE'

    EXPORTING

    mode_rstable = 'E'

    tabname = '/VWNA/WHRS_MULTI'

    varkey = l_varkey.

    ENDIF.

    Thanks

    Pavan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.