Hi Debdatta,
Remove the OBJECTKEY and OBJECTTYPE from SAVE method population. It will do the trick.
WA_METHODS-REFNUMBER = '000001'.
WA_METHODS-OBJECTTYPE = ''.
WA_METHODS-METHOD = 'SAVE'.
WA_METHODS-OBJECTKEY = work_order.
append WA_METHODS to IT_METHODS.
My working code snippet for the similar requirement..
lwa_methods-refnumber = lv_ref. "Reference number
lwa_methods-objecttype = 'HEADER'. "Which object you want
lwa_methods-method = 'CHANGE'. "Type of method i.e.change, update, Save etc.
lwa_methods-objectkey = wa_aufnr-aufnr. "Pass object key for that operation
APPEND lwa_methods TO lt_methods. "Append work area to internal table
MOVE-CORRESPONDING wa_header TO lwa_head.
lwa_head-priority = p_priok.
APPEND lwa_head TO lt_head.
lwa_head_up-priority = abap_true.
APPEND lwa_head_up TO lt_head_up.
CLEAR lwa_methods. "Clear wa_methods
lwa_methods-refnumber = lv_ref. "Reference number
lwa_methods-method = 'SAVE'. "Method type
APPEND lwa_methods TO lt_methods.
"Append workare to internal table
REFRESH lt_return.
CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
TABLES
it_methods = lt_methods
it_header = lt_head
it_header_up = lt_head_up
return = lt_return.
Regards,
Raju.