cancel
Showing results for 
Search instead for 
Did you mean: 

Problem: Inspection lot block operation with Odata service calls

slanzetta
Participant
0 Kudos

Hi,

I have the following problem, I have created an Odata service which calls an RFC which does the lock operation of inspection lot.

As long as I'm in debug, in the Odata service, RFC is called and the lock on the operation is there, in fact I see it in SM12.

When the Odata service call ends, I no longer see the lock in SM12, and as if the session of the Odata service call ends, all locks on the SAP ECC session are eliminated.

For the Odata service, I redefined the following method: LOCKUNLOCKOPERAT_CREATE_ENTITY and entered the following code

CLEAR: ev_error, ev_msg.

CALL FUNCTION 'ZQM_HCO_LOCK_OPERATION'

EXPORTING

iv_prueflos = iv_insplot

iv_vornr = iv_vornr

iv_langu = iv_langu

iv_activity = iv_activity

IMPORTING

ev_msg = ev_msg

ev_error = ev_error.

MOVE-CORRESPONDING ls_request_input_data TO lr_entity_out.

lr_entity_out-ev_error = ev_error.

lr_entity_out-ev_msg = ev_msg.

er_entity = lr_entity_out.

IF ev_error IS NOT INITIAL.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

lv_subrc = 8.

lv_exc_msg = ev_msg.

me->/iwbep/if_sb_dpc_comm_services~rfc_exception_handling(

EXPORTING

iv_subrc = lv_subrc

iv_exp_message_text = lv_exc_msg ).

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = abap_true.

ENDIF.

In the RFC is the following code:

CALL FUNCTION 'ENQUEUE_EQAVO'

EXPORTING

mode_qenqavo = 'E'

prueflos = iv_prueflos

vornr = iv_vornr

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc NE 0.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

else.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = abap_true.

ENDIF.

Can anyone recommend me the solution to this problem

Thank you

Stefano

Accepted Solutions (0)

Answers (0)