Skip to Content
author's profile photo Former Member
Former Member

Sales document locked by some user.

Hi friends,

I have a problem with locking issues.

I have used BAPI_SALESORDER_CHANGE for updating the details. Before this BAPI i have used the FM with the following details,

CALL FUNCTION 'SD_SALES_DOCUMENT_ENQUEUE'

EXPORTING

vbeln = t_idoc-vbeln

EXCEPTIONS

foreign_lock = 2

system_failure = 3

no_change = 4.

after the BAPI i have used the FM.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

The BAPI_SALESORDER_CHANGE proceeds only after the successfull enqueue. if the sy-subrc is not equal to 0 then it will not reach this bapi.

Actually, the problem is even after passing to the FM 'SD_SALES_DOCUMENT_ENQUEUE' it has reached the BAPI for changing and displayed a message saying "Sales document XXXXXXXXX is currently being processed (by user XXXXXXX)".

Wat could be the problem? please guide me.

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2009 at 01:14 PM

    Hi there,

    sales document you trying to update is opened by someone or check ur windows if the same sales document is opened by yourself , if it is just close it.

    Edited by: BrightSide on Feb 28, 2009 1:15 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2009 at 01:53 PM

    Hi Mullai Malar,

    Once you check if the Sales Document is locked by using FM SD_SALES_DOCUMENT_ENQUEUE, the Sales document is locked by you.

    Before calling the BAPI, pls release the lock using DEQUEUE FM.

    Pls check if there is a similar FM SD_SALES_DOCUMENT_DEQUEUE .

    Code Logic:

    1. SD_SALES_DOCUMENT_ENQUEUE

    2. Successful lock (sy-subrc = 0)

    3. SD_SALES_DOCUMENT_DEQUEUE

    4. Successful Release (sy-subrc = 0)

    5. BAPI-BAPI_SALESORDER_CHANGE

    Pls. check if this works.

    Note that the FM SD_SALES_DOCUMENT_ENQUEUE actually locks the Sales Document.

    Regards,

    harshada

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2009 at 05:46 PM

    I guess, BAPI_SALESORDER_CHANGE itself locks the sales order! i mean, there is not necessory for explicit locking code, not sure!!

    thanq

    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.