BAPI_SALESORDER_CREATEFROMDAT2 with reference to a contract item

Hi all,
i'm having troubles creating an order with reference to a contract item on item level.
My order is created and also a reference to the contract item is created on item level, but no conditiions are copied from the contract item (no conditions at all are filled)!
Anyone with an idea?
Many thanks!
Siegfried
Here my code:
Order Header data
  ls_order_header_in-doc_type        = 'TA'.
  ls_order_header_in-sales_org       = i_basket_head-vkorg.
  ls_order_header_in-distr_chan      = i_basket_head-vtweg.
  ls_order_header_in-division          = i_basket_head-spart.
  ls_order_header_in-incoterms1      = i_basket_head-inco1.
  ls_order_header_in-incoterms2      = i_basket_head-inco2.
  ls_order_header_in-po_method       = 'INT'.
  ls_order_header_in-req_date_h      = i_basket_head-ketdat.
  ls_order_header_in-purch_no_c      = i_basket_head-bstnk.
  ls_order_header_in-purch_date      = sy-datum.  
  ls_order_header_in-refdoctype      = 'KM'.
Order partners
  ls_order_partners-partn_role    = 'WE'.
  ls_order_partners-partn_numb    = i_basket_head-kunnr_we.
  APPEND ls_order_partners TO lt_order_partners.
  ls_order_partners-partn_role    = 'AG'.
  ls_order_partners-partn_numb    = i_basket_head-kunnr_ag.
  APPEND ls_order_partners TO lt_order_partners.
  CLEAR: lv_counter_posnr, lv_counter_sched.
  LOOP AT it_basket INTO ls_basket.
    lv_counter_posnr = lv_counter_posnr + 10.
    lv_counter_sched = lv_counter_sched + 1.
Order items
    ls_order_items_in-itm_number    = lv_counter_posnr.
    ls_order_items_in-po_itm_no     = lv_counter_posnr.
    ls_order_items_in-material      = ls_basket-matnr.
    ls_order_items_in-ref_doc_ca = 'G'.
    ls_order_items_in-ref_doc       = ls_basket-vbeln.
    ls_order_items_in-ref_doc_it    = ls_basket-posnr.
   ls_order_items_in-target_qty    = ls_basket-quant.
    ls_order_items_in-target_qu    = 'TO'.
    ls_order_items_in-purch_date    = sy-datum.
    APPEND ls_order_items_in TO lt_order_items_in.
Scheduling lines
    ls_order_schedules_in-itm_number = lv_counter_posnr.
    ls_order_schedules_in-sched_line = lv_counter_sched.
    ls_order_schedules_in-req_date   = i_basket_head-ketdat.
    ls_order_schedules_in-req_qty    = ls_basket-quant.
    APPEND ls_order_schedules_in TO lt_order_schedules_in.
  ENDLOOP.
  CLEAR: lv_salesdocument.
Create R/3 sales order
  CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
      order_header_in    = ls_order_header_in
    IMPORTING
      salesdocument     = lv_salesdocument
    TABLES
      return                  = lt_return
      order_items_in     = lt_order_items_in
      order_partners     = lt_order_partners
      order_schedules_in = lt_order_schedules_in.

Hi
how many contracts you have for this material / material group .
if you have only one contract system automatically assigned to sc.
assume that you dont assign any source of supply and cart came to cockpit
take your item into cockpit and click propose source of supply . now all avaialble contract must be available for sourcing or
you can manually enter the contract and item number in the cockpit and create a PO
if you dont get a respective contract  for respective material - there is something wrong on the contract. what type of contract . what is the status of the contract
muthuraman

Similar Messages

  • Create sales order with reference to a contract

    Hi,
    Is there any BAPI/FM which can be used to create a sales order with reference to a contract.
    Regards,
    Saji.

    Hi Maninder/Srinivas ,
    Could you please provide your valuable inputs on the below query . I have posted a new thread , but haven't got any reply till now . Sorry for posting it again.
       I want to  create an order with reference to a sales contract using BAPI_SALESORDER_CREATEFROMDAT2  .
    1) I passed the contract number to the field REF_DOC at header level , But I got the error message in return table  " Document 4000003639 doesn't have document category " where 4000003639 was the contract number . am i missing anything ? Is there any other values that has to be passed ?
    2) I also tried passing the contract number at item level  but the sales order was created without any reference to the contract .
    Thanks in advance
    Beena

  • How can I create multiple sales orders with reference to one contract?

    Hello Gurus,
    Can you please how can I create multiple sales orders with reference to one contract?
    thanks!
    Rakesh

    hi
    Lets consider example
    In your contract for line item 1 you have entered qty 100
    You careated sales order with 70 quantity, and now you want to creat another sales order for 30
    For this first you need to check what is your item category in contract (VA42)
    Goto VOV7
    SPRO - IMG  - Sales and distribution - Sales - Sales document item - Define item categories - Go to change mode
    Make the completion rule = B Item is completed after full quantity has been referenced

  • Error  : Sales order 'create with Reference' to the contract

    We have made a value contract. Now we are trying to make a Sales order 'create with Reference' to the contract.
    when we do that, we am getting error 'copying material in any value contract item is not permitted'
    Any help or directions would be greatly appreciated . We are on Ecc 6.0
    Rohit

    As of now my value contract has just one material. so i dont need assortment module settings. right?
    in VTAA settings are as follows
    Target type: OR  
    Source type: ZK1
    there is only on item category
    Target item category: TAN   
    Source item category: WKN
    Copying requirement : 301
    update doc flow : 2
    pricing type : C
    cont item copy mode : A
    DataT am using 151,102,002
    There are no schedule line.
    Rohit
    Edited by: rohit kumar on May 15, 2008 7:36 PM

  • Creation of Sales order with reference to SOW contracts(VA01 )

    I had created sales order using BAPI_SALESORDER_CREATEFROMDAT2 and now i want to attach the document link for each line item.I could not do it in my program or recording.How can i enter these document type?pls help......

    Dear Machoy,
    In IMG under
    Sales and Distribution -> Sales -> Sales Documents -> Maintain Copy Control for Sales Documents -> Copying Control: Sales Document to Sales Document
    or Transaction VTAA
    http://help.sap.com/erp2005_ehp_02/helpdata/en/70/a7853478616434e10000009b38f83b/frameset.htm
    If you create a sales document with reference to a preceding document, the system copies nearly all the data from the preceding document. The data in the preceding document originally comes from the customer and material master records. Because the data is copied from the preceding documents into the sales document, any changes that have been made to the master data records since the preceding document was created are not included in the sales document. If, when you create with reference, you add another item to the document that was not in the preceding document, the system determines the data for it from the master records, such as the material master or info record.
    You have created an inquiry and a quotation with reference to this inquiry. Before you created the quotation, you changed some data in the material and customer master records.
    You have changed the material description in the material master record. This description is stored in the sales document at item level.
    You have changed the terms of payment in the customer master record from ZB01 to ZB03. These are stored in the sales document at header level.
    When you created the inquiry, the system copies the original material description to the item. If you enter another item in the quotation for the same material, the system displays the new material description for the new item.
    However, the system continues to propose the original term of payment, that is, ZB01, for all items including the new one. This is because it is copied from the header of the preceding document into the header of the quotation, and the change in the customer master record has no affect on the quotation.
    Regards,
    Naveen.

  • BAPI's for creation of sub Contract with reference to main contract

    Hi,
    Can any body tell me the available bapi for the creation zlsl contract with reference to main contract zgsl
    Regards
    Rajkumar

    1.Logistics--Materials Management--Purchasing ---Purchase Requisition --Follow-on functions --- Assign and Process
    2.ME57
    3.Select the Assigned Purchase Requisitions checkbox if you also want to see requisitions already assigned, and choose Execute.
    4.On the Assign and Process Purchase Requisitions screen, select the requisition lines for your material.
    5.Choose Assign Manually if the info record already exists.
    6.On the pop-up Assign Source of Supply Manually dialog box, make the following entries:
    Agreement     46XXXXX            Agmt item     10          
    7.Choose Assign Source of Supply.
    For assign the source of supply, you can also choose Assign Automatically (only if not already assigned by MRP due to existing source list). If more than one source exists, select the contract in the Source Overview for Purchase Requisition 100XXXXX window and confirm with Enter.
    When assigning a source, make sure to select the contract.
    8.Choose Save.
    9.Select the line item, and then choose Assignments Overview (SHIFT+F5).
    10.On the Assign and Process Requisitions: Overview of Assignments screen, select the line below Vendor (you can only select one at a time), then choose Process Assignment.
    11.On the Process Assignment: Create PO window, check and make sure the Order Type (NB), Purchasing Group and Purch. Organization fields then choose Continue (Enter) to confirm.
    12.On the Create Purchase Order screen, select the requisition in the Document Overview section and choose Adopt in the left part of the Document Overview screen.
    13.Choose Save.

  • Issue while creating an order with reference to a contract

    When I try to create an order with reference to a contract having KMATs at line item using VA01, it works fine. But when we try to record the same using SHDB, it comes out after accepting the Contract Number on the pop up screen.
    If some one can throw light as to if it the config issue or any setting that needs to be looked into?

    No special settings. This is a typical problem. SHDB (SM35, or call transaction) can be different to "normal" transaction.
    You can only follow the special sequence given by the transaction running in BDC mode (if you are using exits check on these fields: sy-binpt, sy-calld).
    Kind regards,
    JP

  • Sales Order is not creating with reference to Quantity Contract.

    Dear SAP Experts,
    I am creating a Sales Order with reference to quantity contract but system showing an error *"""Material SUG10051 does not exist in RG1 Table for Excise Group 42 - Message no. ZCOMM002"""* i am not getting y system showing this error because all the necessary configuration for series group is maintained already.
    Please advise me what should i do.
    Looking forward for your quick response on the same.
    Regards
    Parul Deshwal

    Hi
    As per STD SAP, all billing items will be updated in RG1 register.
    The control is in J1ID where you have to select "Material and Chapter ID combination" and choose the tab "Material type".
    There against the billing material code, maintain "F"
    Also check setting
    IMG --> Logistics General --> Taxes on Goods movements --> India Check Basic Settings, Master Data, A/c deteremination, Business transactions and Tools.

  • Credit memo with reference to a sales order with reference to a contract?

    Hello All
    Now I created a quantity contract and the customer paid the Amount that means the billing is done then I started creating sales orders with reference to the contract, can I create credit memos with reference to these sales orders?
    Regards
    Jacopo Francois

    Hi,
    You can create a contract for a longer duartion say 1 year, andyou can create sales order in reference to your contract. This would be an ideal scenario in case of service materials.
    You can now surely create credit memo's in reference to this sales order.
    You will invoice the sales order first and create a credit memo request in reference to your sales invoice and then invoice the credit memo request to raise your credit memo for the customer.
    Reward if helpful.
    Regards
    Ravi

  • Sales order creation with reference to a contract....urgent

    Hi all,
    I am creating a sales order with reference to a contract, but purchase order no. and date are not copying to the sales order due to standard sap settings, is there any solution to copy these two from contract to order ?
    Useful solutions will be rewarded.

    Hi Jithendra,
    You need to edit the copy control settings. Path
    IMG Screen/Sales & Distribution/Sales/Maintain Copy control for Sales Documents.
    In this Goto Copying Control for Sales Documents to Sales Documents. And you need to change the header settings for the given selection.
    I think this might help you.
    Regards,
    Sreekanth

  • Service PO with reference to Service Contract "Qty appearing as '1' in PO"

    Hello Gurus,
      I am creating a service PO with reference to a service contract. For service line there is lets say "1500" qty but while adopting the service lines from the contract to PO, system pick the qty as "1" only eventhough "1500" is remaining for PO release.
    No other PO is created for this qty and for this contract.
    Thanks in advance....
    Malviya....

    Hi,
    Usually a contract is created for establishing a price with the vendor.              
    This is the reason for is the only purchasing document which can be                  
    created without quantities. The quantity in contract has the purpose of              
    limitation, as a guideline for all orders created with reference to                  
    that contract and is not an immediate requirement like a quantity in                 
    purchase requisition, for example.
    When a purchase order is created with             
    reference to a contract, the services selected from that contract will               
    have ALWAYS  the proposed quantity 1, and was designed and hard coded to              
    be like that.   
    Regards,
    Edit

  • One order with reference to multiple contracts

    Hi,
    As we create one invoice(consolidated invoice) for multiple orders where condition is header data should be same for all the orders.In the same way can we create one order with reference to multiple contracts?
    Please suggest.
    Regards,
    SATYA

    Hi,
    Thanks alot for the information.
    Is this the only way to create one order for multiple contract? Why i am asking because in SAP we are creating contracts but the release order we are getting it uploaded from other software.I am in a service industry project where we do DP91(resource related billing) for all the contract.But in dp91 we can give only one contract at a time.
    But we want to create order where multiple contract can be used .
    And where in order we can see the contract number?
    In the table it is visible as ref doc but not in the order.
    Regards,
    SATYA

  • BAPI-To create production orders with reference to sales order & item

    Hi,
    Can anyone tell me which is the best method to create open production orders?
    Is there any BAPI available for creating production orders with reference to sales order & item.
    I tried this BAPI "BAPI_PRODORD_CREATE".
    I am getting pop up to enter serial number while executing the custom program.
    Which table contains the serial number(effectivity parameters)?.

    I have custom screen fields on notification service!
    i think a bdc is better.

  • Report for PGI & billing value with reference to SO Line item

    Dear all,
    Please guide me whether there is any standard report available to check the PGI value and billing at a time with reference to a sales order (line item).
    Thanks & regards.
    Pranab

    as far as I know there is NO such standard report.
    you would try to build sap query based on VBAK/VBAP using VBFA checking LIKP/LIPS and VBRK/VBRP...
    but you may request abaper for more professional report with MKPF/MSEG and BKPF/BSEG

  • Creation of a PO with reference to a contract - change of company code

    Hi experts,
    When a PO is made with reference to an existing contract, the company code is copied automatically from the contract into the PO.
    Do you have an idea if it's possible to modify this in the PO? So that we can choose another company code?
    Thanks,
    Michaë

    Ofcourse you can change the company code in the purchase order.
    However please check that same purchase organization is responsible for both the company codes.
    However it might give you an error that plant is not assigned to the company code.
    Therefore the best way is to create the PO without reference of that contract OR you can create a contract for the company code in PO and then create a PO with the same.

Maybe you are looking for

  • HP Support assistant not working after upgrading to Windows 8.1

    Product Name: HP ProBook 450 G1 Notebook PC Serial number: (Personal information removed) Product number: G1Q53UT HP SysInfo, HP Support Assistant, HP Trust Circles, HP Client Security - none of the HP products are working since the Windows 8.1 upgra

  • Error while renewing the certificate in SSLM

    Hi, While renewing the certificate on SSLM I am getting the following error % failed to parse or verify imported certificate. I am able to upload root certificate successfully. I am sure that I renewed the certificate using the correct parameters. Pl

  • Windows compatibility; Delete key, view, Office for Mac and  Hassels

    Dear Friends I liked the style of the Mac powerbook, and after years of happy use of a Samsung notebook, I decided to take the plunge and buy a Mac. I amlo liked the idea of contributing to diversiy and not putting all my bucks in Gates's basket! Peo

  • Time Machine application no longer opens

    My Time Machine application has suddenly stopped launching.  When I double-click on the icon or use the "open" command there is just a brief increase in the icon size and then nothing mmore happens.  I reinstalled the 10.8.4 update but that didn't he

  • Query regarding WorkManager

    Hi All, I would like to know the following: 1.What is the maxthread constraint associated with a default workmanager? 2.If an mq or jms proxy service invokes an SB layer(proxy service with sb prootocol) where all the layers are associated with defaul