Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

production order, change/update batch

0 Kudos
1,934

Hello,

I need to change the batch of a produciton order.

Is there a BAPI that can do the job?

3 REPLIES 3

Former Member
0 Kudos
342

Hello,

Did you find how to change the batch number in production order ?

I don't see the batch parameter in BAPI BAPI_PRODORD_CREATE or BAPI_ALM_ORDER_MAINTAIN...

Thank you,

Former Member
0 Kudos
342

Hi,

try this way..




CALL FUNCTION BAPI_PRODORD_GET_DETAIL'
"is used to get the Production order detials later call the below fm to update the batch

  w_poitem-po_item       = '0001'.
  CONCATENATE 'External Services - Batch-' w_e_7b1_view-batch_number INTO w_poitem-short_text.  "here Update Batch
  w_poitem-quantity      = w_menge.
  w_poitem-preq_no       = w_banfn.                 "w_child-trans_doc_id .
  w_poitem-preq_item     = w_bnfpo.                 "w_child-trans_line_id.
  APPEND w_poitem TO t_poitem.

* Do up to X times only when locking error
  DO w_i_retry_count TIMES.

    REFRESH t_po_return.

  CALL FUNCTION BAPI_PRODORD_CHANGE'
    EXPORTING
      purchaseorder = w_expProductionOrder
    TABLES
      return        = t_return
      poitem        = t_poitem
      poitemx       = t_poitemx.

prabhudas

0 Kudos
342

Hello,

Thank you, but I don't see these parameters in function module BAPI_PRODORD_CHANGE :

FUNCTION bapi_prodord_change.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(NUMBER) LIKE BAPI_ORDER_KEY-ORDER_NUMBER

*" VALUE(ORDERDATA) LIKE BAPI_PP_ORDER_CHANGE STRUCTURE

*" BAPI_PP_ORDER_CHANGE

*" VALUE(ORDERDATAX) LIKE BAPI_PP_ORDER_CHANGEX STRUCTURE

*" BAPI_PP_ORDER_CHANGEX

*" EXPORTING

*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2

*" VALUE(ORDER_TYPE) LIKE BAPI_ORDER_COPY-ORDER_TYPE

*" VALUE(ORDER_STATUS) LIKE BAPI_ORDER_STATUS STRUCTURE

*" BAPI_ORDER_STATUS

*" VALUE(MASTER_DATA_READ) LIKE BAPIFLAG-BAPIFLAG

*"----