cancel
Showing results for 
Search instead for 
Did you mean: 

Check the Freight order locked status in TM 8.0

joseph_manjiyil
Participant
0 Kudos
1,150

Hi All,

Is there any method to check whether the Freight order is locked for processing, other than the messages obtained when the

Freight order is called for update and it returns a message, the Order is locked and cannot be processed.

Also can you please provide me the links, where I can find useful information regarding the TM 8.0

Regards,

Joseph M

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

perform action LOCK_ROOT on the FO instance.

if there is a failure then you assume that this FO is locked.

joseph_manjiyil
Participant
0 Kudos

Hi Murugesh,

I called the LOCK_ROOT as stated by you.

Please find the code snippet below:

call method lo_srvmgr_tor->do_action

EXPORTING

iv_act_key = /scmtms/if_tor_c=>sc_action-root-lock_root

it_key = lt_tor_key

IMPORTING

eo_change = lo_change

eo_message = lo_message

et_failed_key = lt_failed_key

et_failed_action_key = lt_failed_action_key

But this code goes for a dump.

In the class /BOBF/CL_TRA_SERVICE_MGR, method /BOBF/IF_TRA_SERVICE_MANAGER~DO_ACTION at line 43 since the

IF mo_conf->ms_last_action-act_cat <> /bobf/if_conf_c=>sc_action_standard.

set_application_error( ).

ENDIF.

It is setting an application error. As a result it is going for dump. The Freight order is kept open in another session to return failed keys. If I skip this particular statement, then I am able to achieve the failed keys. But how to mitigate the dump.

Please help me, let me know where I am going wrong.

Regards,

Joseph M

Former Member
0 Kudos

hmm..

ok then try the RETRIEVE of the transaction manager.

with EDIT MODE as EXCLUSIVE_LOCK.

if you get an error message then your object is locked.

joseph_manjiyil
Participant
0 Kudos

Hi Murugesh,

I tried the exclusive mode,

call method go_srvmgr_tor->retrieve

Exporting

iv_node_key = /scmtms/if_tor_c=>sc_node-root

it_key = lt_tor_key

iv_edit_mode = /scmtms/if_tor_c=>sc_edit_exclusive

iv_fill_data = ABAP_FALSE

Importing

eo_message = lo_message

et_failed_key = lt_failed_key.

But the lt_failed_key and lo_message are returned empty, even when the freight order is opened in edit mode.

Is there any mistake in my code. Please help me

Regards,

Joseph M

Edited by: Dranzer on Nov 16, 2011 12:44 AM

Former Member
0 Kudos

Go to EDIT Freight order link, open the FO

DATA: lo_srvmgr_tor TYPE REF TO /bobf/if_tra_service_manager,

lt_tor_key TYPE /bobf/t_frw_key,

lo_message TYPE REF TO /bobf/if_frw_message,

ls_tor_id TYPE /scmtms/tor_id,

lt_tor_id TYPE /scmtms/t_tor_id.

lo_srvmgr_tor = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( iv_bo_key = /scmtms/if_tor_c=>sc_bo_key ).

ls_tor_id = '00000000000000010037'.

APPEND ls_tor_id TO lt_tor_id.

CALL METHOD lo_srvmgr_tor->convert_altern_key(

EXPORTING

iv_node_key = /scmtms/if_tor_c=>sc_node-root

iv_altkey_key = /scmtms/if_tor_c=>sc_alternative_key-root-tor_id

it_key = lt_tor_id

IMPORTING

et_key = lt_tor_key ).

CALL METHOD lo_srvmgr_tor->retrieve

EXPORTING

iv_node_key = /scmtms/if_tor_c=>sc_node-root

iv_edit_mode = /bobf/if_conf_c=>sc_edit_exclusive

it_key = lt_tor_key

iv_fill_data = abap_false

IMPORTING

eo_message = lo_message

.

lo_message will have MT_MESSAGE that will be filled with message.

/SCMTMS/MSG 251 252 253

joseph_manjiyil
Participant
0 Kudos

Hi all,

To retrieve the messages obtained in the object lo_message in the above code,

call method /scmtms/cl_common_helper=>msg_convert_bopf_2_bapiret2

EXPORTING

io_message = lo_message

CHANGING

ct_bapiret2 = lt_bapiret2.

lt_bapiret2 will have the messages raised. By looking across the internal table you can get the relevant message id.

Regards,

Joseph M

Answers (0)