Sales Order with Ref to  Sales Contract using BAPI

Hi ,
I am using BAPI_SALESORDER_CREATEFROMDAT2 for creating the Sales order with ref to Sales Contract.
but problem is that , Its not validating the quantity.
I am passing following values to Header  & item
ORDER_HEADER_IN-REF_DOC   =  <Sales contract>
ORDER_HEADER_IN-REFDOC_CAT = 'G'.
& item
ORDER_ITEMS_IN-REF_DOC   = <Sales contract>
ORDER_ITEMS_IN-REF_DOC_IT   = <item>
ORDER_ITEMS_IN-REF_DOC_CA  = 'G'
Thanks
Jitendra

Keshav.T wrote:
What do you mean by but problem is that , Its not validating the quantity. generally to populate qty we follow like below
Hi Keshav,
Suppose Contract -> 1000 L
First Order -> 500 L wrt to that contract.
and again create a order wrt contract with quantity  700 L
It should throw a waring Or Error message  but It creates the Order with 700 L quantity which is not correct.
Thanks
Jitendra

Similar Messages

  • Purchase order with ref to central contract

    we have created centrallly agreed contract with one vendor , but client wants to create purchase order using  that contract but with different vendor.(vendor field only ) (not through partner roles and vendor sub range)pl suggest if there is way.

    >
    ramjdee wrote:
    > my queston is,  Is it possible to create the purchase order with different vendor  while creating  w.r to   centrally created contract . The contract is having another vendor . example .  CENTRALLY CREATED CONTRACT VENDOR IS  X , but while creating po with ref to the contract can i use other vendor like Y.
    >
    > vendor sub range and partner roles not to be used .
    Is your problem related to contract and support (in terms of "SAP contract and support"), or are you rather talking about relations between different data objects / tables inside your application? If the latter, being a little more verbose (and, especially, posting table definitions) surely would help.
    Cheers,
    Kristian

  • Order with referance  to a contract using BAPI_SALESORDER_CREATEFROMDAT2

    Hi All,
      I tried to create an order with reference to a sales contract .
    1) I passed the  contract number to the field REF_DOC at header level , But I got the error message" Document 4000003639 doesn't have document " where 4000003639 was the contract number .  am i missing anything ? Is there any other values that has to be passed ?Can anyone help me on this ?
    2) I also tried passing the contract number at  item level as suggested in earlier posts on this subject , but the sales order was created without any reference to the contract .
    Please help me on this issue .
    Thanks & Regards
    Beena

    Hi Beena,
    You can use this piece of code as reference,
    *Fill the header information for the order.
      wa_order_header_in-doc_type           = Sales Doc type of order to be created.
      wa_order_header_in-sales_org          = sales org.
      wa_order_header_in-distr_chan         = distribution channel.
      wa_order_header_in-division           = division.
      wa_order_header_in-ref_doc            = contract number(This is the contract u refer to).
      wa_order_header_in-refdoc_cat         = 'G' (G stands for contract).
    *Fill the item level information for the order.
        wa_order_items_in-itm_number        = item number.
        wa_order_items_in-material          = material number.
        wa_order_items_in-ref_doc           = contract number(This is the contract u refer to).
        wa_order_items_in-ref_doc_it        = Item number of contract u create.
        wa_order_items_in-ref_doc_ca        = 'G'.
        APPEND wa_order_items_in TO i_order_items_in.
    *Fill the schedule line information for the order.
        wa_order_schedules_in-itm_number    = item number.
        wa_order_schedules_in-sched_line    = 1.
        wa_order_schedules_in-req_qty       = order quantity.
        APPEND  wa_order_schedules_in TO i_order_schedules_in.
        CLEAR: lwa_order_items_in,
               lwa_order_schedules_in.
    *Fill the partner information for the order.
        wa_order_partners-partn_role        = partner function.
        wa_order_partners-partn_numb        = partner number.
        APPEND wa_order_partners TO i_order_partners.
               wa_order_partners.
      CLEAR w_vbeln.
    *Call the order creation BAPI.
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
      salesdocumentin               =
          order_header_in             = wa_order_header_in
      order_header_inx              = wa_order_header_inx
      sender                        =
      binary_relationshiptype       =
      int_number_assignment         =
      behave_when_error             =
      logic_switch                  = lv_logic_switch
      testrun                       =
      convert                       = ' '
        IMPORTING
          salesdocument               = w_vbeln
        TABLES
          return                      = i_return
          order_items_in              = i_order_items_in
      order_items_inx               =
          order_partners              = i_order_partners
          order_schedules_in          = i_order_schedules_in
      order_schedules_inx           =
      order_conditions_in           =
      order_conditions_inx          =
      order_cfgs_ref                =
      order_cfgs_inst               =
      order_cfgs_part_of            =
      order_cfgs_value              =
      order_cfgs_blob               =
      order_cfgs_vk                 =
      order_cfgs_refinst            =
      order_ccard                   =
      order_text                    =
      order_keys                    =
      extensionin                   =
      partneraddresses              =
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
             wait =
    IMPORTING

  • Create Purchase Order with reference to Purchase Requisition using BAPI's

    Hello Experts,
    I need to create a Purchase order with reference to a Purchase Requisition.
    All the above has to be done by using BAPI's.
    For creating PR, I am using BAPI_REQUISITION_CREATE.
    and for PO, I am using BAPI_PO_CREATE.
    I am not able to use the requistion number in the PO. BAPI throws the following exception
    "Requisition 1014396 00010 not selectable"
    "Document contains no items"
    Query's:
    1. Do I need to release the PR for using it in PO?
    2. If so how can I work with the "BAPI_REQUISITION_RELEASE_GEN" to release PR?
    I have tried using the BAPI getting the following error "Release outside filed of responsibility".
    Please help I am in critical Postion...
    Thanks,
    Suma

    Hi Meenakshi,
    When, I try to release error I am getting the following the error " Purchase Requisition can not be released".
    Is this problem because of authorization or data issue?
    Thanks
    Suma

  • How to create a Sales order with ref to Contract using Function Module

    How to create a Sales order with ref to Contract using Function Module BAPI_SALESDOCU_CREATEFROMDATA ?

    We have a unique situation where we like change the sold-to customer of the sales order
    once order has been created. These orders have been created using either by function module
    BAPI_SALESDOCUMENT_COPY or using BDC (VA01, Copy with reference).
    These two processes work abosolutely fine except someone might have change the sold-to
    customer of the ship-to customer of the original sales order. If this the case then the new
    sales order will be created with the old sold-to and with not the new sold-to.
    We tried using BAPI_SALESDOCUMENT_CHANGE and commit afterwards. We checked
    the returned parameteres of the BAPIs and they are all successful but sold-to remains the
    same old one.
    Any help would be much more appreciated.

  • How to create a Sales order with ref. with serial number using BAPI

    Hi Gurus...
    I have a requirement where,  i need to create an order with reference to serial number using a BAPI.
    The inputs will be the Order type..Sales area..Sales office..Sales group..Sold-To-party..Material number...Serial number...
    When i create the order using VA01 the configuration data will be automatically copied from the BUMP order which will have all the required information.
    But to create using a BAPI, i am struck ed..Please help
    Thanks in advance..
    Srinu

    You can use this BAPI.
    You can pass ITM_NUMBER to the ORDER_ITEMS_IN parameter. I think this will act as serial number.
    Regards,
    Murali

  • BAPI for creation of Production Order with Ref to sales order

    Hi all,
    we are using BAPI_PRODORD_CREATE  for creating Production Order with ref to sales order.
    As per the Business Scenario, we are not creating any masters like BOM and Routing, instead
    we are creating Routing directly into the Production Order under operation overview screen.
    during creation of routing system is generating a default operation.
    the following is the error results after running the Bapi.
    "No routing selected"
    Best Regards.
    GTNRNR.

    Hi GTNRNR,
    with out creation of BOM you created routing and in routing for the operations which components did you allocated so that can be used to manufacture the final product. Can you be please specific?
    Regards,
    Madhu.G

  • 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

  • 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

  • Create Sales Order With Reference to Billing Document Using BAPI_SALESORDER

    Hi,
    How can i create a sales order With Reference to Billing Document Using BAPI_SALESORDER_CREATEFROMDAT2?
    Thanks in advance,
    Alejandro.

    I have to create sales order with reference to existing billing document. I have tried to following bapis.
    1. BAPI_SALESORDER_CREATEed
    I have successfully created document with following details.
    -->ORDER_HEADER_IN:
    DOC_TYPE =                  ZRK
    SALES_ORG =              3000
    DISTR_CHAN   =            00
    DIVISION =                    00
    ORD_REASON =            100
    SD_DOC_CAT   =          L
    CURRENCY       =         EUR
    REF_DOC          =         100000028
    REF_DOC_CA    =         M
    -->ORDER_ITEMS_IN:
    ITM_NUMBER    =           000010
    MATERIAL          =          701791
    TARGET_QTY     =          0000000001000
    CURRENCY        =          EUR
    REF_DOC           =          100000028
    REF_DOC_CA     =          M
    -->ORDER_PARTNERS:
    PARTN_ROLE      =          SP
    PARTN_NUMB      =         W12001
    COUNTRY             =         NL
    by providing this input i am able to create the document but it is not picking up the net value. so i have passed some extra paramters in  ORDER_ITEMS_IN
    COND_TYPE          =        PNET
    COND_VALUE        =        14,56
    COND_D_UNT        =         PC.
    folowing error is occured: Condition PNET is missing in pricing procedure A V Z0000.
    is it something related to configuration problem?
    2.BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2
    I have used same test data that is used for BAPI_SALESORDER_CREATEFROMDATA (where in i coudl succefully create doc). but here i encounterd following error.
    Unpermitted combination of business object BUS2032 and sales doc. category L.

  • Problem creating process order with ref of sale order

    Dear all,
    Kindly give solution for this scenerio..............................
    I am creating Process Order with ref of sale order manually in cor1. In the COR1 screen copy from field i gave my ref sale order, so that particualr order and batch is assigned to that order only.
    My problem was suppose if sale order is created for 10 tonns, but my batch size and resource capacity is 2 tonns only. so first time i change my batch quantity 2 tonns instead of 10 tonns and created my order and confirmed.
    if i go to second time the same process i am doing creating process order with ref of same sale order but it comes again 10 tonns instead of 8 tonns. why it comes like this already i confirmed 2 tonns in this sale order?
    my requirement is if any process order is created with ref of any sale order and again if i am creating any process order with ref of same sale order left quantity only system should show.
    for this what i have to do kindly help to this
    regards,
    s.sakthivel

    Dear KK,
    Pls check whether ZKIN, ZKQT, ZKOR have all the properties similar to IN, QT, OR respectively. If they are different, please ensure that you know the reason why they are different. This check has to be done at tcode VOV8
    Some fields like sales document category, Transaction group, screen seq group, Doc pricing procedure need to be similar to the parent document unless you know why you have changed them.
    Once this check is done, check the copy controls in VTAA. Before that try creating these documents separately without reference. This shoudl work fine only after which you need to check copy control. If this is not working fine, then there is some problem with the document type settings in VOV8. Testing this is possible only if Reference mandatory field is left empty. Make sure that is properly configured.
    Once this is done, check copy controls in VTAA. You can just copy the copycontrol between IN and QT and QT and OR and create for ZKIN to ZKQT and ZKQT to ZKOR.
    Once this is done, check whether your item category settings are properly done , also the schedule line settings. The tcodes are VOV7, VOV6, VOV4, VOV5 etc.
    Now check whether your material master and customer master are consistent with the item category settings(Item category group).
    Now create the transaction. It shoudl work fine.
    Reward if this helps.

  • Return sales order( with ref. to Invoice) need to have less quantity

    Hi Friends,
    Here one issue is coming while creating a return sales order with ref. to  invoice.
    Example is:
    In original invoice an article X is of price 10 having 10 quantity and hence total price 100.
    but now customer wish to return only 5 articles and creating this Retun sales order with refernce to this invice
    now in return sales order quantity is coming correct i.e 5 but the amount is still the same i.e 100.
    But this should be 50( 5*10).
    Please can someone help to find the reason why the price is not changing while quantity is changing.
    I have already check the copy control but there also setting seems to be correct.
    Also when i try to update the pricing via condition tab the price got changed. but that is manually.
    Thanks
    Punit.

    Thanks Jignesh,
    But can you please tell which pricing input should be the best.
    As "price redetermine" option can't be selected as price keep changing.
    also i did that for "same price and redetermine tax" but doesn't seems to be working.
    Please if you can suggest any option where the price of the article will be same (the old one when article was sold) as proportionate to quantity without redetermining the price.
    like article x has qty 10 and price 10 hence amount 100
    but later price of article change to 11
    then if i chose redetermine price then for five article this will be 55 which is again wrong( it should be 50 as at the time of sale the price was 10)
    Hope I made the issue clear enough. Which setting in pricing one can recommend.
    Regards
    Punit
    Thanks

  • Order with ref to quotation

    Hi All,
    When i create order with ref to a quotation i give create with ref and give the quotation number and click on items for choosing the quantity(OPEN QUANTITY) , here i want to know the quantity which i choose , where does this get updated ? VBAPD in field name ORFMNG . but while debugging we are not able to find in BAPI SALES ORDER CREATE on where is this getting updated. Please reply.
    thanks

    Hi,
    When he is creating sales order  with reference to same sales order type he can do that in VA01 by clicking "create with reference",here system will not prompt you to create with reference window automatically.But if you set Reference Mandatory set as "C" in VOV8 transaction then system will prompt automatic window.
    But make sure all the dates are copied from existing sales order only.
    Regards,
    Chandra

  • 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

Maybe you are looking for