cancel
Showing results for 
Search instead for 
Did you mean: 

Locking Issue in TM

Former Member
0 Kudos

Hello Experts,

I am changing the status of custom field of /SCTMS/TOR BO via custom report.

I am facing the locking issue in this report. When I execute the report and leave the screen as it is, all the FOs are locked for others. Is there any mechanism by which we can unlock the Fos without pressing the BACK button.

Thanks in advance!

Pratibha

Accepted Solutions (0)

Answers (4)

Answers (4)

johnny_zhan2
Explorer
0 Kudos

Hi Shukla,

   You should use retrieve_by_association with parameter iv_edit_mode = /bobf/if_conf_c=>sc_edit_exclusive.

Former Member
0 Kudos

Hello Pratibha,

Could you check the change using the transaction /BOBF/TEST_UI?

I think that have a method to check if the document is in "Edit' mode.

kind regards,

Vicente Picardi

Former Member
0 Kudos

Hi Pratibha

There is a standard SAP program /SCMTMS/PROCESS_TRIGGER_BGD which will help you remove locked entries.

ThomasQ
Advisor
Advisor
0 Kudos

Hi Nikhil,

The mentioned program does NOT remove locked entries.

It rather re-tries to execute actions that could not be processed BECAUSE OF locked instances before.

Please check the consulting note 1747234 for the functional details of this program.

Regards, Thomas

rajiv_kanoria
Explorer
0 Kudos

Can you please share your code how you are doing it.?

Regards,

Rajiv

Former Member
0 Kudos

Hello Expert ,

At the end of my report I am writing below code:

DATA l_t_enq          TYPE TABLE OF seqg3.
  DATA l_t_all_enq      TYPE TABLE OF seqg3.
  DATA l_subrc          TYPE sysubrc.

  CALL FUNCTION 'ENQUEUE_READ'

EXPORTING
  gclient           = sy-mandt
  gname             = ''
  guname            = sy-uname
TABLES
  enq               = l_t_enq
EXCEPTIONS
  communication_failure = 1
  system_failure    = 2
  OTHERS            = 3.

  CALL FUNCTION 'ENQUE_DELETE'

    EXPORTING

      check_upd_requests    = 0

      suppress_syslog_entry = ' '

    IMPORTING

      subrc = l_subrc

    TABLES

      enq   = l_t_all_enq.

Thanks !

Pratibha

Bimal_S
Active Participant
0 Kudos

Have your tried using transaction SM12?

rajiv_kanoria
Explorer
0 Kudos

Hi Pratibha,

I meant how are you changing the Status of TOR BO..

Are you passing modification Entries are or have you created a Custom Action for it(Since you are updating a Custom Status).

I would Recommend going for Creating Custom Action on the BO and Changing Status in its EXECUTE method and call this method using Service Manager in your Custom Report.

Actions Handle the Locking mechanism Automatically and you would not require your code above to explicitly handle your Locking Mechanism.

Regards,

Rajiv

bharath_k6
Active Participant
0 Kudos

Dear Pratibha,

From the above code snippet that you have pasted, i do not see DEQUE.

Have you done it properly.

Every time after run of the program, you can see in SM12 if number of lock entries are increased.

If that is happening, try debugging or paste the complete code here. Will be able to help you.

Thanks,

Bharath.

former_member194343
Participant
0 Kudos

I'd like to make this a bit stronger 🙂 When dealing with BOPF, just NEVER write your own enqueue/dequeue logic, but let the BOPF handle this. I never tried this myself but I guess that you risk to run into inconsistencies if you do...