on 04-24-2013 10:13 AM
Hi experts ,
I want to create a sales contract and I am using BAPI_CONTRACT_CREATEFROMDATA ,I use this code but I get error message :" please entre sold to party or ship to party"
data : ls_header type BAPISDHD1,
ls_farmer type bapiparnr,
lt_farmer like table of ls_farmer,
ls_items type bapisditm,
lt_items like table of ls_items,
lv_doc_num like BAPIVBELN-VBELN ,
ls_return like bapiret2,
lt_return like table of ls_return.
ls_header-doc_type = is_header-doc_type.
ls_header-sales_org = is_header-sales_org.
ls_header-distr_chan = is_header-distribution_channel.
ls_header-division = is_header-division.
ls_header-CT_VALID_F = is_header-date_start.
ls_header-CT_VALID_T = is_header-date_end.
ls_farmer-PARTN_NUMB = is_farmer-customer_number.
ls_farmer-name = is_farmer-name.
insert ls_farmer into table lt_farmer.
ls_items-material = is_items-material.
ls_items-plant = is_items-plant.
ls_items-target_qty = is_items-quantity.
insert ls_items into table lt_items.
*ev_numero = lv_doc_num.
et_return = lt_return .
CALL FUNCTION 'BAPI_CONTRACT_CREATEFROMDATA'
EXPORTING
SALESDOCUMENTIN = ev_numero
contract_header_in = ls_header
* CONTRACT_HEADER_INX =
* SENDER =
* BINARY_RELATIONSHIPTYPE = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* BEHAVE_WHEN_ERROR = ' '
* LOGIC_SWITCH =
* TESTRUN =
* CONVERT = ' '
* IMPORTING
* SALESDOCUMENT =
tables
RETURN = et_return
CONTRACT_ITEMS_IN = lt_items
* CONTRACT_ITEMS_INX =
contract_partners = lt_farmer
* CONTRACT_CONDITIONS_IN =
* CONTRACT_CONDITIONS_INX =
* CONTRACT_CFGS_REF =
* CONTRACT_CFGS_INST =
* CONTRACT_CFGS_PART_OF =
* CONTRACT_CFGS_VALUE =
* CONTRACT_CFGS_BLOB =
* CONTRACT_CFGS_VK =
* CONTRACT_CFGS_REFINST =
* CONTRACT_DATA_IN =
* CONTRACT_DATA_INX =
* CONTRACT_TEXT =
* CONTRACT_KEYS =
* EXTENSIONIN =
* PARTNERADDRESSES =
.
You have to set the partner role...
ls_farmer-PARTN_ROLE = 'AG'. "for example
Depending on your customizing you have to declare 'WE' too...
Regards
Miro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mou,
please check what Document pricing procedure is assigned to your sales document type in table TVAK (TVAK-KALVG) and what Customer pricing procedure is assigned to your customer in table KNVV (KNVV-KALKS) and then check if there any appropriate record in table T683V. If there is no record maintain it in tcode OVKK
Regards, Maria
Hi Mou Merou,
the problem seems to be in the lt_farmer table. Please post here the table how it looks like at the time of BAPI call.
Regards,
Maria
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.