当前位置:   article > 正文

SAP 生产订单缺料下达_co_zf_order_read

co_zf_order_read

BAPI_PRODORD_RELEASE 这个BAPI 只能下达不缺料的生产订单

客户的需求是要缺料也可下达订单

查阅资料后发现可调用下面的程序完成

  1. DATA: lwa_aufnr TYPE ord_pre,
  2. lwa_tca11 TYPE tca11,
  3. lwa_caufvd TYPE caufvd,
  4. lt_aufnr TYPE STANDARD TABLE OF ord_pre.
  5. lwa_aufnr-aufnr = g_aufnr.
  6. APPEND lwa_aufnr TO lt_aufnr.
  7. lwa_tca11-flg_alt =
  8. lwa_tca11-flg_seq =
  9. lwa_tca11-flg_opr =
  10. lwa_tca11-flg_sop =
  11. lwa_tca11-flg_aob =
  12. lwa_tca11-flg_fhm =
  13. lwa_tca11-flg_mst =
  14. lwa_tca11-flg_phas = 'X'.
  15. CALL FUNCTION 'CO_ZF_ORDER_READ'
  16. EXPORTING
  17. flg_dialog = space
  18. flg_enqueue = 'X'
  19. objects_imp = lwa_tca11
  20. flg_prot_imp = 'X'
  21. TABLES
  22. aufnr_tab_imp = lt_aufnr
  23. EXCEPTIONS
  24. order_not_found = 1
  25. release_no_change = 2
  26. OTHERS = 3.
  27. IF sy-subrc EQ 0.
  28. CALL FUNCTION 'CO_BT_CAUFV_READ_WITH_KEY'
  29. EXPORTING
  30. aufnr_act = g_aufnr
  31. no_dialog_info = 'X'
  32. IMPORTING
  33. caufvd_exp = lwa_caufvd
  34. EXCEPTIONS
  35. not_found = 1
  36. OTHERS = 2.
  37. IF sy-subrc EQ 0.
  38. CALL FUNCTION 'CO_ZR_HEADER_RELEASE_NEW'
  39. EXPORTING
  40. caufvd_imp = lwa_caufvd
  41. prot_init_imp = 'X'
  42. write_prot_imp = 'X'
  43. no_dialog_imp = 'X'
  44. no_avail_check_imp = 'X'
  45. IMPORTING
  46. caufvd_exp = lwa_caufvd
  47. EXCEPTIONS
  48. free_failed = 1
  49. end_task = 2
  50. OTHERS = 3.
  51. IF sy-subrc EQ 0.
  52. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  53. EXPORTING
  54. wait = 'X'.
  55. ENDIF.
  56. ENDIF.
  57. ENDIF.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/323801
推荐阅读
相关标签
  

闽ICP备14008679号