[Related tables]
Jest-Object System status (I ***) and user status (E ****)
Jsto-Status Object Information
Tj02t-System status text
-User status text
[Lock Object]: production order Lock Object
Esorder
Function:
Enqueue_esorder,
Dequeue_esorder
[Function 1]:Checks the status of multiple objects and filters them out.
CallFunction'Status _ check_multi'
Exporting
Status = cns_stat_20 "system status or user status
Flg_exclude = cns_active "X or space
Tables
Objects = gt_objnr_tab.
[Function 2]:Reads all valid text of an object.
Call Function 'Status _ text_edit'
Exporting
* Client = SY-MANDT
* Flg_user_stat =''
Objnr = <fs_aufk>-objnr
Only_active = 'X'
Spras = sy-Langu
* Bypass_buffer =''
Importing
* Anw_stat_existing =
* E_stsma =
Line = <Fs_aufk>-sttxt
* User_line =
* Stonr =
Exceptions
Object_not_found = 1
Others = 2
[Function 3]:Read the object status of a single object
Call Function 'Status _ object_read'
Exporting
Client = Sy-mandt
Objnr = up_objnr
Importing
E_jsto = ls_jsto
Exceptions
Object_not_found = 1
Others = 2.
[Function 4]:Change Object User status
Call Function 'I _ change_status'
Exporting
Objnr = up_objnr
Estat_inactive = cns_stat_20
Estat_active = cns_stat_10
Stsma = ls_jsto-stsma
Exceptions
Cannot_update = 1
Others = 2.
Note: When the user's status changes, one status is set to active, and the other needs to be set to non-active.
Function 5 ]:Change the object system status
Call Function 'Status _ change_intern'
Exporting
* Check_only =''
Client = Sy-mandt
Objnr = up_objnr
* Zeile =''
* Set_chgkz =
Importing
Error_occurred = lv_error
Object_not_found = lv_object_not_found
Status_inconsistent = lv_status_inconsistent
Status_not_allowed = lv_status_not_allowed
Tables
Status = tp_jstat
Exceptions
Object_not_found = 1
Status_inconsistent = 2
Status_not_allowed =3
Others = 4
Note: In the tables parameter status, you need to prepare two sets of statuses for mutual switchover. One is set to active, and the other is set to non-active.
Function 6 ]:Order technology disabled
Call Function 'Bapi _ prodord_complete_tech'
* Exporting
* Scope_compl_tech = '1'
* Work_process_group = 'cowork _ bapi'
* Work_process_max = 99
Importing
Return = Ls_return
Tables
Orders = lt_aufnr
Detail_return = lt_detail
* Application_log =
.