How to upload PM order confirmation : actual data using BAPI in SAP

964 views Asked by At

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 ) , 1

2

3

4

5

I'm in need an appropriate BAPI for these steps.

1

There are 1 answers

12
phil soady On

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.