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

problem with ZBAPI_CONTRACT_CREATEFROMDATA

Former Member
0 Likes
497

I made test data in this bapi in se37' and it's work and i get contract that i can see in va42.

i put this data in parameters ( look with the debug that

i get the same data)

and i get this message :

please insert sold-to-party or ship to party.

This is the data:

***CONTRACT_HEADER_IN

lt_CONTRACT_HEADER_IN-doc_type = 'ZCON'.

lt_CONTRACT_HEADER_IN-sales_org = '1000'.

lt_CONTRACT_HEADER_IN-distr_chan = '10'.

lt_CONTRACT_HEADER_IN-division = '00'.

lt_CONTRACT_HEADER_IN-ct_valid_f = sy-datum. "wa_record-ct_valid_f.

lt_CONTRACT_HEADER_IN-ct_valid_t = sy-datum. "wa_record-ct_valit_t.

lt_CONTRACT_HEADER_IN-PURCH_NO_C = wa_record-znum.

lt_CONTRACT_HEADER_IN-PURCH_NO_S = wa_record-znum.

***CONTRACT_PARTNERS

iw_con_partners-partn_role = 'SP'.

iw_con_partners-partn_numb = lv_kunnr .

iw_con_partners-ITM_NUMBER = '000000'.

append iw_con_partners to it_con_partners.

  • CONTRACT_ITEMS_IN

iw_con_itm_in-itm_number = '000010'.

iw_con_itm_in-material = lv_matnr.

iw_con_itm_in-plant = '1000'.

iw_con_itm_in-target_qty = wa_record-quant .

append iw_con_itm_in to it_con_itm_in.

thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
455

Hi,

Internally Partner Role 'SP' is 'AG'. So you have to pass AG as Sold to's Partner Role.

Here in your code..

<b>****CONTRACT_PARTNERS

*iw_con_partners-partn_role = 'SP'.

iw_con_partners-partn_role = 'AG'.</b>

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

3 REPLIES 3
Read only

Former Member
0 Likes
456

Hi,

Internally Partner Role 'SP' is 'AG'. So you have to pass AG as Sold to's Partner Role.

Here in your code..

<b>****CONTRACT_PARTNERS

*iw_con_partners-partn_role = 'SP'.

iw_con_partners-partn_role = 'AG'.</b>

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

Read only

Former Member
0 Likes
455

Hi liat,

While passing data through parameters to the BAPI, just make it sure that the you append the leading zeroes to all the field values wherever required.

This will solve your problem.

Lokesh

Pls. reward appropriate points

Read only

0 Likes
455

Hi liat,

Srini is right that could be the problem..

Lokesh