Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_CONTRACT_CREATEFROMDATA

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,929

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,643

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'

5 REPLIES 5
Read only

Former Member
0 Likes
1,643

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

Read only

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,643

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

Read only

Former Member
0 Likes
1,643

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

Read only

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,643

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.

Read only

Former Member
0 Likes
1,644

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'