CO11N完工确认可以通过BAPI实现,
具体使用如下:
1. 先调用BAPI:API_PRODORDCONF_GET_TT_PROP获取确认号对应的工序工单信息,相当于在CO11N输入确认号回车的效果;
wa_timetickets-conf_no = 确认号. APPEND wa_timetickets TO it_timetickets. CALL FUNCTION 'BAPI_PRODORDCONF_GET_TT_PROP' TABLES timetickets = it_timetickets.
2. 调用BAPI:BAPI_PRODORDCONF_CREATE_TT进行报工。
“除步骤1获取的基本信息外,维护需要补充的一些信息,如下LOOP语句中所示
LOOP AT it_timetickets INTO wa_timetickets. wa_timetickets-conf_activity1 = wa_pp-ism01."人工 wa_timetickets-conf_activity2 = wa_pp-ism01."间接费用-人工 wa_timetickets-pers_no = wa_pp-pernr. "员工号 wa_timetickets-postg_date = p_date. "记账日期 MODIFY it_timetickets FROM wa_timetickets INDEX sy-tabix. ENDLOOP. CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT' EXPORTING post_wrong_entries = '1' testrun = '' "标识为 X,则为试运行 不提交至系统 IMPORTING return = g_return TABLES timetickets = it_timetickets detail_return = it_return.
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/18042.html