Hi All,
My requirement is: while creating and saving new sales order for a customer(say 100014), system will check is any credit memo request( i.e. sales order) already exist with this customer 100014. If so, system will first releas this credit memo by clearing the billing block and then create new sales order. To change the billing block of credit memo request i am accumulating header and item info and passing it to the BAPI_SALESORDER_CHANGE inside the user exit USEREXIT_SAVE_DOCUMENT in VA01 so that it will change the billing block of the credit memo reuest before saving the new sales order.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = wa_vbak-vbeln
order_header_in = wa_hdr
order_header_inx = wa_hdrx
behave_when_error = 'P'
TABLES
return = i_ret
order_item_in = i_itm[]
order_item_inx = i_itmx[]
PARTNERS = i_order_partners[].
Its not changing the credit memo request.
Even if i am testing the BAPI_SALESORDER_CHANGE stanalone from SE37 passing header and item info and clearing the header billing block, it is not changing the billing block of the credit memo request (sales order) though its giving me succesfful message that 'Sales order is saved' from RETURN Table.
Can some one help me for the same.
Thanks a lot.