本文主要是介绍ABAP 新增PO计划行时 新增行交货日期默认当前最大交期,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
ABAP 新增PO计划行时 新增行交货日期默认当前最大交期
DATA: ls_poitem TYPE mepoitem.
DATA: ls_jhh TYPE meposchedule.
DATA: ls_poitemc TYPE REF TO if_purchase_order_item_mm.
DATA: is_persistent TYPE mmpur_bool.
DATA: lt_eket TYPE TABLE OF eket.
DATA: ls_eket TYPE eket.
DATA: lv_lfdat TYPE eban-lfdat.ls_jhh = im_schedule->get_data( ). "当前执行行的计划行is_persistent = im_schedule->is_persistent( ).CALL METHOD im_schedule->get_itemRECEIVINGre_item = ls_poitemc.ls_poitem = ls_poitemc->get_data( ).IF is_persistent = '' AND ( sy-tcode = 'ME23N' OR sy-tcode = 'ME22N' OR sy-tcode = 'ME54N' OR sy-tcode = 'ME29N' ) AND ls_jhh-ebeln <> ''. "新增计划行SELECT COUNT(*) FROM eket WHERE ebeln = ls_jhh-ebeln AND ebelp = ls_jhh-ebelp AND etenr = ls_jhh-etenr.IF sy-subrc NE 0. "为新增计划行SELECT SINGLE lfdat INTO lv_lfdat FROM eban WHERE banfn = ls_poitem-banfn AND bnfpo = ls_poitem-bnfpo.IF sy-subrc = 0.IF lv_lfdat = ls_jhh-eindt."系统默认为PR需求日期,要改为当前PO最大交期REFRESH lt_eket.SELECT * INTO TABLE lt_eket FROM eket WHERE ebeln = ls_jhh-ebeln AND ebelp = ls_jhh-ebelp.SORT lt_eket BY eindt DESCENDING.READ TABLE lt_eket INTO ls_eket INDEX 1.ls_jhh-eindt = ls_eket-eindt.ls_jhh-eeind = ls_eket-eindt.im_schedule->set_data( ls_jhh ).ENDIF.ENDIF.ENDIF.
ENDIF.
这篇关于ABAP 新增PO计划行时 新增行交货日期默认当前最大交期的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!