Sales order with reference to contract using IDOC_INPUT_ORDERS

Hi all,
I had the requirement to create sales order with reference to contract based on some validations of idoc values and then passing the modified idoc data table to IDOC_INPUT_ORDERS. I have completed the coding till the modification of data in a new function module ('Z') and then calling the IDOC_INPUT_ORDERS FM inside that. Now my problem is while creating the sales order, the bdc for Txn VA01 is not populating those values to screen fields which I want to populate. I could find out that some modifs needs to be done in some user exit for reference to contract case.But finding difficulty in getting the exact place to make the modifications. Any pointer to this problem would be highly appreciated.
Regards,
Divya

Hi,
This issue is been resolved.
One of my friend helped me with resolving this issue..
Once the below mentioned configurations were done on SPRO, the Sales Order was created with reference to Contract and the Qty was reflected when tried to create a new Order referring the same contract.;
u2022     SPRO --> SD  -->Sales  --> Sales Documents  --> Sales Document Header  --> Define Sales Document Types  --> Field : Outline agreement message; from blank to u201CBu201D.
u2022     SPRO  -->SD  -->Sales  --> Sales Documents  --> Sales Document Header  --> Maintain Sales Document Types for AFS  --> Field : Outline agreement message; from blank to u201CAu201D

Similar Messages

  • Create a Sales Order with Reference to Contract using IDoc / LSMW  ( AFS )

    Hi Gurus,
    I need to crate a Sales Order with reference to a Contract. I need to upload Sales Orders with reference to contract via LSMW.
    So far, I've been able to create the Sales Order with ref to contract. But, the Sales Order Quantity is not getting deducted from the Original Qty in Referred Contract ( When try to create another Sales Order referring to the same Contract.) When a Sales Order is created manually, this is working fine.
    Please tell me if I've missed some parameter which stopping it create the link to exact schedule line ( Sizes level )
    The Details of the IDoc which is been created via LSMW are as follows;
    Message Type: ORDERS
    Basic Type     : /AFS/ORDERS05
    Process Code : ORDE / DELO
    ( Tried with both process codes.  But the Identification is the same for both: IDOC_INPUT_ORDERS )
    *_In Header;_
    Segment : E1EDK02  - IDoc: Document header reference data *
    Qualifier : '043' - Vendor Contract Number ( Tried with ' 005' - Customer Contract, but it's not working )
    Contract Order is mapped for field BELNR
    *_In Item;_
    Segment : E1EDP02  - IDoc: Document Item Reference Data *
    Qualifier : '043' - Vendor Contract Number ( Tried with ' 005' - Customer Contract, but it's not working )
    Contract Order is mapped to field BELNR
    Line Item of the Contract is mapped to field ZEILE
    I also tried passing the Schedule line of Contract in Segment :  E1J3P01 AFS IDoc: Doc.item general data
    to following fields;
    J_3AETENV
    J_3AVGETE
    /AFS/UETENR
    Still its not getting updated in the VBEP also..
    Please help me with regard to this. Points will be awarded for your valuable contribution.
    Thanks.

    Hi,
    This issue is been resolved.
    One of my friend helped me with resolving this issue..
    Once the below mentioned configurations were done on SPRO, the Sales Order was created with reference to Contract and the Qty was reflected when tried to create a new Order referring the same contract.;
    u2022     SPRO --> SD  -->Sales  --> Sales Documents  --> Sales Document Header  --> Define Sales Document Types  --> Field : Outline agreement message; from blank to u201CBu201D.
    u2022     SPRO  -->SD  -->Sales  --> Sales Documents  --> Sales Document Header  --> Maintain Sales Document Types for AFS  --> Field : Outline agreement message; from blank to u201CAu201D

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

  • BAPI to create Sales Order with reference to contract

    Hi All,
    I am trying to create Sales Order with reference to Contract, but although the
    order gets created, it does not contain reference document information. 
    The BAPI I am using is BAPI_SALESORDER_CREATEFROMDAT2. 
    Would someone know which parameters I have to papulate,or have any other suggestion
    how to accomplish my task? 
    Thank you so much, 
    Mayank

    Hi - Try Filling these three fields in the Item details.
    REF_DOC
    REF_DOC_IT
    REF_DOC_CA
    Reward points if helpful

  • Doubt in creating a sales order with reference to contract

    Hi all,
    when I create the sales order with reference to contract, in the table VBFA, the field PLMIN is set to zero some times and set to '+' some times. May I know whats the functionality behind this. Any pointers on this will be helpful.
    Regards,
    A.Rathinaprakash

    Hello A.Rathinaprakash,
    This is an Indicator which indicates the quantity or value in the target document(means Sales order) has a negative effect, positive effect, or no effect at all on the quantity still to be completed in the source document(means contract).
    Example from the Help file..
    In sales documents, for example, you can expect the following results:
    Quotation   -> Sales order: positive effect
    Contract    -> Return: negative effect
    Sales order -> Sales order: no effect
    In billing documents, for example, you can expect the following results:
    Delivery    -> Invoice: positive effect
    Delivery    -> Cancellation: negative effect
    Delivery    -> Pro-forma invoice: no effect
    Hope it helps..
    Regards,
    HP

  • Sales order with reference to contract

    Hi experts,
    I'll like create a sales order with reference to contract.
    In VA01, when I select "create with reference", system visualize a pop-up windows opened in offer view.
    Is it possible open that pop-up windows in contract view as default?
    Thanks to all.
    Angelo

    Hi,
    If you want it automatic at creation of order then go to VOV8
    Select your order type >>> Details >>> Under transaction flow Tab
    Message: Mast.contr - C (Check & baranch directly to selection list)
    Now when ever you create sales order for perticular customer & material, sytem give pop up screen, for this part open contract is available along with contract number,copy it directly.
    Kapil

  • Problem with creation of Sales Order with reference to Contract

    Hi,
    I have a problem when creating Sales order with reference to Contract , shipping condition was not copied. Is there any existing copy routines suitable to accomodate this?
    Thanks!

    your functional team can help you in finding one.

  • EDI: creating a sales order with reference to contract

    Dear gurus,
    we would like to create a sales order with reference to a SD contract from an ORDERS IDoc.
    OSS say we have to populate the E1EDx02 segments with the contract number to do this.
    We tested this in our system by manually editing the incoming IDoc and this is what we found:
    - qualifier u201C005  : Customer Contract Numberu201D set and BELNR = u201Cthe customeru2019s outline agreement number in his MMu201D (= normal MM behaviour) -> reference is not processed at all, sales order is created without reference
    - qualifier u201C043: Vendor Contract Numberu201D set and BELNR = our contract number in SD -> Sales order successfully created. BUT where can I store an external outline agreement number in MM so that the BELNR in the IDoc is populated with it?
    - qualifier u201C058: Customer Contract Numberu201D set and BELNR = the customeru2019s outline agreement number in his MM -> Error:
    The system could not determine a contract number
    Message no. VG226
    Diagnosis
    The system could not determine a contract number for the selection criteria: external contract number 5100000020 and customer number 0044000004.
    This error appears although we maintained the external number 5100000020 in the PO number field (VBKD-BSTKD) in our SD contract.
    Could anyone please explain what we do wrong?
    Cheers
    Alicia

    Hi again,
    @Lakshmipathi: Thank you, but it is VG226, like I wrote. But still, the OSS note is interesting: "You create a sales order with reference to an MM contract using EDI." Where's the sense in that? Why would I ever want to create a sales order with reference to an outline agreement in MM???
    @Rags: Sure we could do that, but I find it hard to believe that there is no standard way to do this. Especially given there are plenty of OSS notes stating that this is possible, e.g. note 562710.
    Any other ideas?
    Cheers
    Alicia

  • Creation of sales order with reference to Quotation using BAPI

    Hi All,
    I am using BAPI "BAPI_SALESORDER_CREATEFROMDAT2" for creating sales order. Can you please tell how can I create a sales order with reference to a Quotation.

    Vinit,
    In your header structure, set like this:
      hdr-REF_DOC = i_order-vbeln.  "assign quotation # to sales order
      hdr-REFDOC_CAT = 'B'.         "assign Quotation to VBTYP_N.
    For each line item, set as follows:
    Assigning ref doc to create line item entries in VBFA.
        itm-REF_DOC    = i_order-vbeln.  "quote number
        itm-REF_DOC_IT = i_vbap-posnr.   "quote line item #
        itm-REF_DOC_CA = 'B'.
      data: ret_text type BAPIRET2.
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          ORDER_HEADER_IN           = hdr
          convert                   = 'X'
        IMPORTING
          SALESDOCUMENT             = salesdoc
        TABLES
          return                    = ret_tbl
          ORDER_ITEMS_IN            = itm
          ORDER_PARTNERS            = prtnr
          ORDER_ITEMS_inx           = itmx
          ORDER_CONDITIONS_IN       = conds
          ORDER_CONDITIONS_INX      = condsx
          order_schedules_in        = schd_lin.
    Don't forget those points.

  • Create sales order with reference to contract

    Hi,
    I have to create sales orders with reference to a contract. When I do the recording on lsmw the line items in the sales order are assigned a number from sap. I need to keep the line item numbers the same as per the contract.
    Any advice appreciated.
    Regards,
    Warren.

    found answer

  • CREATE SALES ORDER WITH REFERENCE TO INVOICE USING RECORDING

    Hi,
    I wanted to know if it was possible to create a sales order with reference to an invoice using recording(SHDB transaction).If there is some other method please explain the method in detail(Its very urgent)

    Hi,
    You should be able to use BAPI_SALESORDER_CREATEFROMDAT2 instead of doing a BDC and you can populate the reference document in the relevant header field.
    Gareth.

  • Creating sales order with reference to contracts

    Hi Gurus,
    I am creating a sales order with reference to a contract.I am making sales order sold-to-party as release order.
    so my Contract sold-to-party and the sales order sold-to-party are different but both belong to same sales area. In the above case i am able to create sales order.
    In other case though my Contract sold-to-party and the sales order sold-to-party are different but if they both belong to different sales area, i am unable to create a sales order.It says no contracts exits for sold-to-party.
    i made both the customers as partners .
    Any guidance on this is fully rewarded with points.

    Each and everytime your both SOLD-TO should be in same sales area.
    Enhance the  Contract sold-to-party's customers sales area specific data in XD02 so, it could come in to sales area of the Order's Sold-to-party.
    Regards,
    Naimesh Patel

  • Sales order with reference to Contract and another sales order

    Hi Gurus,
    I would like your suggestions on one of the business requirement i have.
    We are creating a new EDI interface with few of our customers to create sales orders. While creating sales orders, it should validate if there are any open contracts available and if yes, then the sales order should be created with reference to it. so far good but there are chances that sold to party on the contract could be different from sold to party on the EDI order sent by customer (customer can have more than one sold to party on their system). IDOC's are failing in this scenario and not able to create a sales order since sold to partys are not matching. I need your help.
    Can we do some thing in customer master to handle this scenario?
    or
    Create a new sales doc type (YEDI or some thing) and create sales order from IDOC without reference to contract. Business will look into all YEDI order and create the actual sales order out of it but the challenge here is i cannot refer contract to the actual sales order or YEDI order.
    Is it possible to create sales order with ref to a contract and another sales order?
    Please help
    Thanks
    Venkat

    Hello Venkat
    What is the linkage between sold to party of contract and sold to party of order..If customer has more than one sold to party.
    Why don't you use customer hierarchy....link all sold to party of a customer to hierarchy node.for example...you create a hierarchy  node 1000 and assigned customers 2000 and 3000 to it.you have contract for 2000..so when you create a sales order for 3000 check in knvh table it's customer hierarchy 1000 and get all sold tos assigned to hierarchy...which is 2000....check if contract exist for sold to's..If yes then create order with reference.
    Let us know if it works for you.
    Thanks
    Amit Gupta

  • Variant Matching  during Creation of Sales Order with reference to Contract

    Hi All,
    I have a following scenario. Sales Contract is created on a Configurable Material ' A' and its has a Material Variant "B" with following Charac Values X = X1, Y= Y1 & Z=Z1.
    The value of Z= Z1 is set using a Procedure when Sales Document Type = OR ( This is the Document type For sales Order). So, this means variant matching will finally happen at Sales Order creation level, coz all the three reqd. charc. are availabe  at that time.This is also our reqmt.
    But, now what is happening, a Sales Contract is created for Material A, with Charc values X = X1 & Y= Y1. When a sales order is created with reference to this Contract, immediately during Copying of selected item, Variant Matching gets triggered & Material A is replaced by Material Variant B. Even we dont get into the Configuration Window.
    Actually, during copying itself Object Depencies are called and thats leading to variant Matching.
    Our requirement is that, it should not get triggered at such early stage. It should happen when Config. window is clicked.
    Kindly help. Copy Control of Sales Doc has setting 'No Control' We are in ECC 6.0. Are there some other settigs too.
    regards,
    Stuti

    your functional team can help you in finding one.

  • A problem about create sales order with reference to contract.

    Hello,everyone,
    when I create sales order va01,there is user exit in MV45AFZB to check the vbkd-bstkd,unique and fixed  length.
    but there is no such in contract  creation va41.
    when I create a contract and copy the data to sales order ,the check code is prevent me from copying
    message error:the vbkd-bstkd check is wrong.
    how to solve the problem, if I have to use the check in sales order.

    The Simple thing may be put a check at contract stage it self, then whatever data is in contract will copy in sales order. So you wont face this problem.
    Thanks,
    Raja

Maybe you are looking for