cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove lock from CRM document?

Former Member
0 Kudos

Hi,

Any idea how do we remove lock from a Service Contract in CRM?

I am mass creating Service Contracts and attaching it to the same SPM Document.

After the 1st CRM_ORDER_MAINTAIN, the second onwards all failed. I believe the SPM Document is still locked.

I tried CRM_ORDER_INITIALIZE but didn't work.

Any suggestion is welcomed!

Regards,

Kevin

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

probably transaction SMCL if it is an integrated scenario with ECC?

Marvin

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi,

Even if it's locked, it's by the same user. So, this should not be a reason for the failure.

Regards,

Arun Prakash

Former Member
0 Kudos

even if it is the same user, the document cannot be changed when it is still locked.

i found out, that you have to provide the parameter iv_init_frame_log = 'X' in order to reset the exception-buffer of crm_order_maintain. Otherwise if the first order leads to an error, this will reject the maintain of all following documents.

arunprakash_karuppanan
Active Contributor
0 Kudos

Hi Tobias,

even if it is the same user, the document cannot be changed when it is still locked.

I think that we have a misunderstanding here. To change a document you need to lock it first. Your reply could have been better phrased as "A document cannot be changed if it's been locked by a different user or the same user in a different session."

Regards,

Arun Prakash

Former Member
0 Kudos

clearing the lock works fine when using the function modules as followed:


    CALL FUNCTION 'CRM_ORDER_SAVE'
      EXPORTING
        it_objects_to_save = lt_save
      EXCEPTIONS
       document_not_saved = 1
      OTHERS              = 2.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.

    CALL FUNCTION 'CRM_ORDER_INITIALIZE'
     EXPORTING
       IT_GUIDS_TO_INIT                 = lt_save
       IV_KEEP_LOCK                     = ''.

remember to import the actual service-guid to crm_order_initialize

I hope this helps.

Regards,

Tobias

gopalkrishna_baliga
Participant
0 Kudos

Hi Tobias,

What GUID we need to pass it to initialize FM? Is it the header GUID or the Item GUID or Both?

Please help

Thanks

Gopal