Add components to production order using FM bapi_a... - SAP Community
source link: https://community.sap.com/t5/enterprise-resource-planning-q-a/add-components-to-production-order-using-fm-bapi-alm-order-maintain/qaq-p/13672053
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Tuesday
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 =
.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK