cancel
Showing results for 
Search instead for 
Did you mean: 

creation of Sales Contract

Former Member
0 Kudos

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              =
           .

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thank you for reply , this time I got probleme related to quantity , but it resolved , I referd to a contract wich exist and I mentiend the valid term , , now I get this message "no pricing procedure could be determinated" , I think pricing it's not a requiered field that I have to mention

former_member213975
Active Participant
0 Kudos

please look at your ls_header structure and find out if there any pricing procedure for your sales area in T683V table.

Reagards,

Maria

Former Member
0 Kudos

in my structure ls_header that have same fields of BAPISDHD1( whitch represent header of my contract)  there is no pricing procedure .

Regards,

Former Member
0 Kudos

any answer please , I still could not solve this probleme for creating contract ??

former_member213975
Active Participant
0 Kudos

Hi mou,

please post how your T683V table looks like for sales org, dist channel and division from ls_header.

Former Member
0 Kudos

Hi ,

thank s for reply , this is my table for sales org = 1000 , distr chann = 10 and div = 10 .

former_member213975
Active Participant
0 Kudos

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

Lakshmipathi
Active Contributor
0 Kudos

no pricing procedure could be determinated

If you search with the above text in Google or here, you will find en number of times this has been discussed.  Please search before posting any query.

G. Lakshmipathi

former_member213975
Active Participant
0 Kudos

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