英文:
How to upload PM order confirmation : actual data using BAPI in SAP
问题
如何使用SAP中的BAPI上传PM订单确认实际数据并进行物料移动?
我尝试使用了很多BAPI,但没有像这样的工作:
MAP2E_RIWOL_TO_ALM_ORDER_OLIST,BAPI_ALM_ORDER_MAINTAIN,BAPI_PRODORDCONF_GET_TT_PROP
这些是用户在使用(T-Code IW41)输入数据时按照的步骤,
我需要一个适用于这些步骤的合适的BAPI。
英文:
How to upload PM order confirmation actual data and post goods movement using BAPI in SAP ?
I tried to use a lot of BAPI but it didn't work like this:
MAP2E_RIWOL_TO_ALM_ORDER_OLIST , BAPI_ALM_ORDER_MAINTAIN , BAPI_PRODORDCONF_GET_TT_PROP
These are the steps that the user follows in entering the data using (T-Code IW41 ) ,
I'm in need an appropriate BAPI for these steps.
答案1
得分: 1
To post Time confirmations use BAPI_ALM_CONF_CREATE
.
To post goods movement, use BAPI_GOODSMVT_CREATE
with Goods movement code of 03 and a movement type 261.
The Object LIST is maintained via the ORDER, see BAPI_ALM_ORDER_MAINTAIN
. The object list is part of this function.
Example for your test program to post confirmations:
DATA: ls_timetickets TYPE bapi_alm_timeconfirmation.
ls_timetickets-orderid = i_aufnr.
ls_timetickets-operation = i_vornr.
ls_timetickets-sub_oper = i_uvorn.
IF is_timec_up-split IS NOT INITIAL.
ls_timetickets-capa_category = '002'. "Person
ls_timetickets-split = is_timec_up-split.
ENDIF.
ls_timetickets-fin_conf = is_timec_up-aueru.
ls_timetickets-clear_res = is_timec_up-ausor.
ls_timetickets-conf_text = is_timec_up-ltxa1.
ls_timetickets-plant = is_timec_up-werks.
ls_timetickets-work_cntr = is_timec_up-arbpl.
ls_timetickets-act_work_2 = is_timec_up-ismnw.
ls_timetickets-un_work = is_timec_up-ismne.
ls_timetickets-rem_work = is_timec_up-ofmnw.
ls_timetickets-un_rem_wrk = is_timec_up-ofmne.
ls_timetickets-actual_dur = is_timec_up-idaur.
ls_timetickets-un_act_dur = is_timec_up-idaue.
ls_timetickets-exec_start_date = is_timec_up-isdd.
ls_timetickets-exec_start_time = is_timec_up-isdz.
ls_timetickets-exec_fin_date = is_timec_up-iedd.
ls_timetickets-exec_fin_time = is_timec_up-iedz.
ls_timetickets-pers_no = is_timec_up-pernr.
ls_timetickets-act_type = """""" <<<< is important
ls_timetickets-calc_motive = is_timec_up-bemot.
ls_timetickets-ex_created_by = is_timec_up-ernam.
ls_timetickets-ex_created_date = is_timec_up-ersda.
ls_timetickets-dev_reason = is_timec_up-grund.
ls_timetickets-postg_date = !!!! sy-datum
APPEND ls_timetickets TO lt_timetickets.
CALL FUNCTION 'BAPI_ALM_CONF_CREATE'
EXPORTING
post_wrong_entries = ' '
testrun = i_testrun
IMPORTING
return = ls_return
TABLES
timetickets = lt_timetickets
detail_return = lt_alm_return.
COMMIT WORK. "! You can only do 1 at a time
" indeed you may need a new session each time.
Please note that the code provided is a translation of your text and may require further adaptation to fit into a specific programming context.
英文:
To post Time confirmations use 'BAPI_ALM_CONF_CREATE'
To post goods movement , is a loaded question,
but if we assume a basic MM goods issue to order , use 'BAPI_GOODSMVT_CREATE'
use Goods movement code of 03 and a movement type 261.
gm_code = '03'.
goodmvt_item-move_type = '261'
The Object LIST is maintained via the ORDER.
see BAPI_ALM_ORDER_MAINTAIN.
The object list is part of this function.
Example for you test program to post confirmations.
" map_timeconf example using variable names similar to afru
DATA: ls_timetickets TYPE bapi_alm_timeconfirmation.
ls_timetickets-orderid = i_aufnr.
ls_timetickets-operation = i_vornr.
ls_timetickets-sub_oper = i_uvorn.
IF is_timec_up-split IS NOT INITIAL.
ls_timetickets-capa_category = '002'. "Person
ls_timetickets-split = is_timec_up-split.
ENDIF.
ls_timetickets-fin_conf = is_timec_up-aueru.
ls_timetickets-clear_res = is_timec_up-ausor.
ls_timetickets-conf_text = is_timec_up-ltxa1.
ls_timetickets-plant = is_timec_up-werks.
ls_timetickets-work_cntr = is_timec_up-arbpl.
ls_timetickets-act_work_2 = is_timec_up-ismnw.
ls_timetickets-un_work = is_timec_up-ismne.
ls_timetickets-rem_work = is_timec_up-ofmnw.
ls_timetickets-un_rem_wrk = is_timec_up-ofmne.
ls_timetickets-actual_dur = is_timec_up-idaur.
ls_timetickets-un_act_dur = is_timec_up-idaue.
ls_timetickets-exec_start_date = is_timec_up-isdd.
ls_timetickets-exec_start_time = is_timec_up-isdz.
ls_timetickets-exec_fin_date = is_timec_up-iedd.
ls_timetickets-exec_fin_time = is_timec_up-iedz.
ls_timetickets-pers_no = is_timec_up-pernr.
ls_timetickets-act_type = """"" <<<<< is important
ls_timetickets-calc_motive = is_timec_up-bemot.
ls_timetickets-ex_created_by = is_timec_up-ernam.
ls_timetickets-ex_created_date = is_timec_up-ersda.
ls_timetickets-dev_reason = is_timec_up-grund.
ls_timetickets-postg_date = !!!! sy-datum
APPEND ls_timetickets TO lt_timetickets.
CALL FUNCTION 'BAPI_ALM_CONF_CREATE'
EXPORTING
post_wrong_entries = ' '
testrun = i_testrun
IMPORTING
return = ls_return
TABLES
timetickets = lt_timetickets
detail_return = lt_alm_return.
COMMIT WORK. "! You can only do 1 at a time
" indeed you may need a new session each time.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论