02-17-2007 11:38 AM
Hi All
I am trying to change header data for a CS Order i have created. When am passing the details to BAPI_ALM_ORDER_MAINTAIN . It throws me an error saying 'Ref number 000001 doesnt exist for the order'
If anyone has ever changed header details of a CS order ever by using this BAPI. Please help. basically i need to change the Service tab of header in IW32.
Sample Code.
CLEAR wa_methods.
wa_methods-refnumber = '000001'.
wa_methods-objecttype = 'HEADER'.
wa_methods-method = 'CHANGE'.
wa_methods-objectkey = l_order.
APPEND wa_methods TO i_methods.
CLEAR wa_methods.
wa_methods-refnumber = '000001'.
wa_methods-objecttype = 'PARTNER'.
wa_methods-method = 'CHANGE'.
wa_methods-objectkey = l_order.
APPEND wa_methods TO i_methods.
CLEAR wa_methods.
wa_methods-refnumber = '000001'.
wa_methods-method = 'SAVE'.
wa_methods-objectkey = l_order.
APPEND wa_methods TO i_methods.
CLEAR wa_methods.
CLEAR wa_header_srv.
wa_header_srv-object_no = l_order.
wa_header_srv-material = '000000000000000022'.
wa_header_srv-quantity = 1.
*wa_header_srv-BASE_UOM = 'EA'.
wa_header_srv-purch_no_c = 'test'.
APPEND wa_header_srv TO i_header_srv.
CLEAR wa_header_srv.
CLEAR wa_header_srv_up.
wa_header_srv_up-material = 'X'.
wa_header_srv_up-quantity = 'X'.
*wa_header_srv-BASE_UOM = 'EA'.
wa_header_srv_up-purch_no_c = 'X'.
APPEND wa_header_srv_up TO i_header_srv_up.
CLEAR wa_header_srv_up.
CLEAR wa_partner.
wa_partner-orderid = l_order.
wa_partner-partn_role = 'AG'.
wa_partner-partner = 'PZ0002'.
APPEND wa_partner TO i_partner.
CLEAR wa_partner.
CLEAR wa_partner_up.
wa_partner_up-partn_role = 'X'.
wa_partner_up-partner = 'X'.
APPEND wa_partner_up TO i_partner_up.
CLEAR wa_partner_up.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = i_methods
it_header = i_header
it_header_up = i_header_up
it_header_srv = i_header_srv
it_header_srv_up = i_header_srv_up
IT_USERSTATUS =
it_partner = i_partner
it_partner_up = i_partner_up
IT_OPERATION =
IT_OPERATION_UP =
IT_RELATION =
IT_RELATION_UP =
IT_COMPONENT =
IT_COMPONENT_UP =
IT_TEXT =
IT_TEXT_LINES =
EXTENSION_IN =
return = i_return_change
et_numbers = et_numbers
02-17-2007 1:42 PM
Hi
<b>First read the documenatation of this BAPI in SE37 Transaction, by pressing F9 Key.
Also do a where-used list for this BAPI and then code accordingly.</b>
Hope this will help.
Please reward suitable points.
Regards
- Atul