Product orders (production order) status function bapi

Source: Internet
Author: User

[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 =
.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.