Skip to Content
0
Jan 16, 2018 at 11:02 AM

BAPI_PRODORDCONF_CREATE_TT using storage unit type

249 Views Last edit Jan 16, 2018 at 11:58 AM 2 rev

Hi

i've got a problem using BAPI_PRODORDCONF_CREATE_TT to create a production order confirmation with 101 goods receipt into a WM Warehouse.

The confirmation is posted and the goods receipt is booked on 901. Everything looks fine so far. But then i tried to place storage unit type information in table goodsmovement.

SU_PL_STCK_1 = 1

ST_UN_QTYY_1 = 3600,000

UNITTYPE_1 = 01

The program runs fine again. Everything is posted. But when i look at the material document i couldn't find the storage unit type information.


FORM post_conf  USING  it_timetickets    TYPE bapi_pp_timeticket_t
                       it_goodsmovements TYPE bapi2017_gm_item_create_t
                         iv_rueck
                         iv_lmnga
                         iv_xmnga
                         iv_user
                         iv_shift          TYPE char20
                         iv_datum          TYPE dats
                CHANGING ev_msgtyp
                         ev_msgtxt.

  DATA: ls_return         TYPE bapiret1,
        ls_det_ret        TYPE bapi_coru_return,
        ls_timeticket     TYPE bapi_pp_timeticket,
        lt_timetickets    TYPE bapi_pp_timeticket_t,
        ls_goodsmovement  TYPE bapi2017_gm_item_create,
        lt_goodsmovements TYPE bapi2017_gm_item_create_t,
        lt_det_ret        TYPE TABLE OF bapi_coru_return.

  CLEAR: ev_msgtyp, ev_msgtxt.

"Menge einfügren

  LOOP AT it_timetickets INTO ls_timeticket.
    ls_timeticket-yield       = iv_lmnga.
    ls_timeticket-scrap       = iv_xmnga.
    ls_timeticket-conf_text   = iv_shift.
    ls_timeticket-postg_date  = iv_datum.
    APPEND ls_timeticket TO lt_timetickets.
  ENDLOOP.

  DELETE it_goodsmovements WHERE entry_qnt IS INITIAL.

  CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'
    EXPORTING
*     post_wrong_entries             = '2'
      testrun                        = ''
    IMPORTING
      return                         = ls_return
    TABLES
      timetickets                    = lt_timetickets
      goodsmovements                 = it_goodsmovements
*      link_conf_goodsmov             = lt_link
*     characteristics_wipbatch       = lt_characteristics_wipbatch
*     link_conf_char_wipbatch        = lt_link_conf_char_wipbatch
      detail_return                  = lt_det_ret.
  IF ls_return-type CA 'AEX'.
    MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number
            WITH ls_return-message_v1 ls_return-message_v2
                 ls_return-message_v3 ls_return-message_v4
            INTO ev_msgtxt.
    ev_msgtyp = 'E'.
    EXIT.
  ENDIF.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait = 'X'.
ENDFORM.                    " POST_CONF

Attachments