cancel
Showing results for 
Search instead for 
Did you mean: 

Add components to production order using FM bapi_alm_order_maintain.

Pritam
Explorer
0 Kudos

Hi All,

I want to add multiple components in production order in CO02 tcode. for this i am using BAPI_ALM_ORDER_MAINTAIN in exit (ZXCO1U11). But not able to do so as it is giving below error:

Purchasing organization 1000 not responsible for plant
Error during processing of BAPI methods.

kindly let me know how to solve the error.

wa_method-refnumber = '000001'.
wa_method-objecttype = 'COMPONENT'.
wa_method-method = 'CREATE'.
wa_method-objectkey = '000001138317'.
APPEND wa_method to it_method.
CLEAR wa_method.
wa_method-refnumber = '000000'.
wa_method-method = 'SAVE'.
wa_method-objectkey = '000001138317'.
APPEND wa_method to it_method.
CLEAR wa_method.

*wa_header-orderid = i_caufvd-aufnr.
*wa_header-planplant = wa_data-werks.
*wa_header-plant = wa_data-werks.
*APPEND wa_header to itab_header.

ls_components-material = wa_data-component.
ls_components-plant = wa_data-werks.
ls_components-stge_loc = '1001'.
ls_components-batch = wa_data-charg.
ls_components-item_cat = 'N'.
ls_components-activity = wa_operations-counter.
ls_components-backflush = wa_data-bf.
APPEND ls_components to itab_components.
CLEAR ls_components.


CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
* EXPORTING
*   IV_MMSRV_EXTERNAL_MAINTENACE       = 'X'
  TABLES
    it_methods                         = it_method
   IT_HEADER                          = itab_header
*   IT_HEADER_UP                       =
*   IT_HEADER_SRV                      =
*   IT_HEADER_SRV_UP                   =
*   IT_USERSTATUS                      =
*   IT_PARTNER                         =
*   IT_PARTNER_UP                      =
*   IT_OPERATION                       =
*   IT_OPERATION_UP                    =
*   IT_RELATION                        =
*   IT_RELATION_UP                     =
   IT_COMPONENT                       = itab_components
*   IT_COMPONENT_UP                    =
*   IT_OBJECTLIST                      =
*   IT_OBJECTLIST_UP                   =
*   IT_OLIST_RELATION                  =
*   IT_TEXT                            =
*   IT_TEXT_LINES                      =
*   IT_SRULE                           =
*   IT_SRULE_UP                        =
*   IT_TASKLISTS                       =
*   EXTENSION_IN                       =
   RETURN                             = itab_return
*   ET_NUMBERS                         =
*   IT_REFORDER_ITEM                   =
*   IT_REFORDER_ITEM_UP                =
*   IT_REFORDER_SERNO_OLIST_INS        =
*   IT_REFORDER_SERNO_OLIST_DEL        =
*   IT_PRT                             =
*   IT_PRT_UP                          =
*   IT_REFORDER_OPERATION              =
*   IT_SERVICEOUTLINE                  =
*   IT_SERVICEOUTLINE_UP               =
*   IT_SERVICELINES                    =
*   IT_SERVICELINES_UP                 =
*   IT_SERVICELIMIT                    =
*   IT_SERVICELIMIT_UP                 =
*   IT_SERVICECONTRACTLIMITS           =
*   IT_SERVICECONTRACTLIMITS_UP        =
*   ET_NOTIFICATION_NUMBERS            =
*   IT_PERMIT                          =
*   IT_PERMIT_UP                       =
*   IT_PERMIT_ISSUE                    =
*   IT_ESTIMATED_COSTS                 =
*   IT_ADDITIONAL_TEXT                 =
          .
IF line_exists( itab_return[ type = 'E' ] ).
    RETURN.
  ENDIF.
 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    WAIT          = 'X'
*  IMPORTING
*    RETURN        =
           .
View Entire Topic
Dsk
Active Contributor
0 Kudos

Hi,

Greetings,

1. I Understand that you want to change the Component details inthe Production order.

2. I see that you are using the BAPI-  BAPI_ALM_ORDER_MAINTAIN

Kindly note this BAPI is not for Production order change this BAPI used to change maintenance or service orders and their sub-objects. 

Also we dont have any BAPI to change the Components in the order, we need to try other options.

Br,

Dsk

Pritam
Explorer
0 Kudos
Thank you for your inputs. What other options do we have?
Pritam
Explorer
0 Kudos
Kindly note i do not want to change the existing components. I want to just add some components.