‎2011 Jun 17 2:25 PM
Hi All,
I am Using a BAPI BAPI_CONTRACT_CREATEFROMDATA for Updating the Partners in the Contract documents by passing 'U' in the field Update_flag of the structure BAPISDHD1X.
I am facing an issue as in the BAPI Return table I am getting messages : S document saved successfully
S No data was changed.
Please help or give me a solution to update only partners in the Contract documents(VA42).
Also please let me know any other BAPIs that can be used to do so.
Thanks & Regards,
Bhargav.
‎2011 Jun 20 9:15 AM
If you want to update contract order number then u use following FM
CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
EXPORTING
i_bapi_view = i_bapi_view
TABLES
sales_documents = sales_documents
order_headers_out = order_headers_out
order_items_out = order_items_out
order_contracts_out = order_contracts_out
order_billingplans_out = order_billingplans_out
order_billingdates_out = order_billingdates_out
order_partners_out = order_partners_out
order_conditions_out = order_conditions_out.
*CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
EXPORTING
SALESDOCUMENT = p_vbeln
* ORDER_HEADER_IN =
order_header_inx = ls_order_header_x
LOGIC_SWITCH = logic_switch
tables
return = lt_return
CONDITIONS_IN = lt_cond
CONDITIONS_INX = lt_cond_x
*CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
‎2011 Jun 17 3:33 PM
Hi Bhargav,
You have to commit your work before the changes are saved. Use the following code after your BAPI:
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
Hope this solves your issue.
Gill
‎2011 Jun 17 3:41 PM
Hi Gill,
Thanks for the reply, I am using test sequence in the FM Execution... First BAPI is Contract Update
Second BAPI is Commit. I am already using it. Any other suggestions are always welcome.
Regards,
Bhargav
‎2011 Jun 17 3:58 PM
Hi,
Are you creating the contract or updating the existing?
If updating,
Get the contract details using - BAPI_CONTRACT_GETDETAIL
Pass all the tables and data to the - BAPI_CONTRACT_CHANGE
Change the tables - PARTNER and corresponding update field flags in PARTNERX
Call BAPI to commit.
THis should work for updating the partner info.
The BAPI - BAPI_CONTRACT_CREATEFROMDATA is "Not Released" by SAP.
Edited by: Pranu Pranu on Jun 17, 2011 4:59 PM
‎2011 Jun 20 8:34 AM
Hi Pranu,
I am using ECC 5.0 I dont have the BAPI_CONTRACT_CHANGE in my system. Please suggest any thing else.
Thanks In advance,
Bhargav.
‎2011 Jun 20 9:15 AM
If you want to update contract order number then u use following FM
CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
EXPORTING
i_bapi_view = i_bapi_view
TABLES
sales_documents = sales_documents
order_headers_out = order_headers_out
order_items_out = order_items_out
order_contracts_out = order_contracts_out
order_billingplans_out = order_billingplans_out
order_billingdates_out = order_billingdates_out
order_partners_out = order_partners_out
order_conditions_out = order_conditions_out.
*CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
EXPORTING
SALESDOCUMENT = p_vbeln
* ORDER_HEADER_IN =
order_header_inx = ls_order_header_x
LOGIC_SWITCH = logic_switch
tables
return = lt_return
CONDITIONS_IN = lt_cond
CONDITIONS_INX = lt_cond_x
*CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'