Skip to Content
0
Former Member
Mar 31, 2009 at 10:52 AM

Order confirmation and goods movement in CO11n

688 Views

Dear Friends,

I am an abaper. I would like to know wat are the sufficient inputs that need to pass for BAPI to process production order confirmation and goods movement using BAPI: BAPI_PRODORDCONF_CREATE_TT

In my process of automating Production order confirmation and Goods movement in CO11n, i am facing the following problem.

Actually this BAPI I am using in my Zprogram for the operation confirmation. I am able to execute the BAPI and it is doing the operation confirmation. But it is not performing the Goods movements. I am not getting any error also. I am passing the following data to this BAPI.

wa_good_mvt-material    = lv_matnr. 
  wa_good_mvt-plant       = '1000'.
  wa_good_mvt-stge_loc    = '1103'.
  wa_good_mvt-move_type   = '261'.
  wa_good_mvt-entry_qnt   = p_bri_i.
  wa_good_mvt-entry_uom   = 'EA'.
  wa_good_mvt-orderid     = p_aufnr.
  wa_good_mvt-activity    = '0010'.
  wa_good_mvt-mvt_ind     = 'F'.
  APPEND wa_good_mvt TO it_goods_mvt.
  CLEAR wa_good_mvt.

  wa_good_mvt-material    = lv_matnr.  
  wa_good_mvt-plant       = '1000'.
  wa_good_mvt-stge_loc    = '1103'.
  wa_good_mvt-move_type   = '531'.
  wa_good_mvt-entry_qnt   = p_bri_o.
  wa_good_mvt-entry_uom   = 'EA'.
  wa_good_mvt-orderid     = p_aufnr.
  wa_good_mvt-activity    = '0010'.
  wa_good_mvt-mvt_ind     = 'F'.
  APPEND wa_good_mvt TO it_goods_mvt.
  CLEAR wa_good_mvt.

  wa_good_mvt-material    =  '8504'.      
  wa_good_mvt-plant       = '1000'.
  wa_good_mvt-stge_loc    = '1301'.
  wa_good_mvt-move_type   = '531'.
  wa_good_mvt-entry_qnt   = lv_spoil.
  wa_good_mvt-entry_uom   = 'EA'.
  wa_good_mvt-orderid     = p_aufnr.
  wa_good_mvt-activity    = '0010'.
  wa_good_mvt-mvt_ind     = 'F'.
  APPEND wa_good_mvt TO it_goods_mvt.
  CLEAR wa_good_mvt.


  CLEAR wa_timetickets.

* append first operation to table
  wa_timetickets-orderid         = p_aufnr.
  wa_timetickets-operation       = '0010'.
  wa_timetickets-yield           = p_cupper.
  wa_timetickets-conf_quan_unit  = 'EA'.
  wa_timetickets-zschgrup        = '11'.
  wa_timetickets-zkaptprog       = p_shift.
  wa_timetickets-fin_conf        = 'X'.
  wa_timetickets-postg_date      = p_post.
  APPEND wa_timetickets TO it_timetickets.
  CLEAR wa_timetickets.

* ~~~ Passing conf - goods mvt link data
  wa_link-index_confirm   = 1.
  wa_link-index_goodsmov  = 1.
  APPEND wa_link TO it_link.

  wa_link-index_confirm   = 1.
  wa_link-index_goodsmov  = 2.
  APPEND wa_link TO it_link.

  wa_link-index_confirm   = 1.
  wa_link-index_goodsmov  = 3.
  APPEND wa_link TO it_link.


* BAPI for production order confirmation
  CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'
* EXPORTING
*   POST_WRONG_ENTRIES       = '0'
*   TESTRUN                  =
* IMPORTING
*   RETURN                   =
    TABLES
      timetickets              = it_timetickets
      goodsmovements           = it_goods_mvt
      link_conf_goodsmov       = it_link
     detail_return             = lt_return.

* commit the data in to database
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

  WAIT UP TO 4 SECONDS.

This code confirms operation wise production but it is not posting goods movement.

Please let me know, if anybody is having the idea where i need to update.

Also suggest what are the inputs i need to provide for it_link (link_conf_goodsmov structure)?