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.

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

  • 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

  • Error while creating sales order with ref to contract

    while creating sales order, with refernce to contract system is giving a message
    Configuration not possible for material : Reason 3 --> Help
    Message no. V1360
    and the message is as follwed can any one explain
    Diagnosis
    This may have been caused by one of the following:
    1. The configuration profile for the material allows or requires the bill of materials to be exploded during order processing. However, a plant has not been specified in the item.
    2. The configuration profile of the material allows or requires the bill of materials to be exploded during order processing, but the order quantity in the item must be greater than 0.
    3. A configuration profile has not been maintained
    or
    A configuration is not permitted for the material
    or
    4. The configuration profile of the material allows or requires the bill ofmaterials to be exploded during order processing. However, the system could not determine a date because important data is missing from the item (see incompletion log).

    Hi
    I think you have both Variant configuration and BOM.
    Pls ensure the following.
    1. BOM masterdata is maintained for the variants
    2. Variant configuration is configured correctly
    Configuration profile is created for the material
    Knowledge base object and run time version are available
    3. Maintain materials as not relevant for delivery or dont give delivery quantity as 0
    Once you are sure that these are in proper shape, you can start creating order. The problem wont come.
    Reward points if it helps you.

  • 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

  • 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

  • Can we create Return Sales Order with Ref to Delivery

    Dear Friends,
    Can we create a Return sales order (RE) with reference to Delivery (LF)?
    If yes,how?
    If not,why?
    Regards,
    Shrikant

    Hi there,
    As per the standard process we donot refer RE with LF. 1 reason may be coz for returns order, we need to copy pricing either from OR or F2. Coz in LF pricing is not copied from OR. If you check the copy control from OR to LF in VTLA, at item level, you will not have any control for pricing type.
    In most of the cases we refer returns to F2 sothat it will be easy to raise a credit memo to refund the customer. This is also because not all items in the order are delivered & invoiced (in partial delivery scenarios when all items are not confirmed)
    Regards,
    Sivanand

  • How to create a Sales Order with external number using BAPI

    Hi People,
    I am wonderning how to create Sales order using external number range by BAPI (SALESORDER_CREATEFROMDAT202).
    I tried search but could not succeed in finding the solution.
    Please share if anyone has some info.
    Thanks in advance.
    Regards,
    Praveen

    As per my understanding, the BAPI
    SALESORDER_CREATEFROMDAT202
    mentioned by you, is not BAPI. In fact, that is basic IDoc Type.  For processing an Inbound IDoc, we use FM IDOC_INPUT_ORDERS.
    If you want to create sales order other than IDoc, refer FM BAPI_SALESORDER_CREATEFROMDAT2. There you can provide external sales order no in SALESDOCUMENTIN. In addition to that check whether your sales doc type is relevant for external number range or not. If yes. then make sure you are providing external number according to the number range maintained.
    If you still have any concerns, please revert back.
    Thanks, JP

  • Unable to create the sales doc with ref to quotation

    Hi,
    I am unable to create a sales order with ref to quotation, messege is "Create sales document" not allowed (User Status
    MKT, object VB0006000017000000)".
    how please advice me
    chandu

    Dear Chandu,
    In Copying Control from QT to OR:
    Kindly set the Copying Requirements: 301 for all Item
    And Copying Requirements: 501 for all schedule lines and check if the sales order is created now.
    Regards,
    Ashu

  • 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

  • Create EDI sales order with reason for rejection set for item

    Hello all,
    I'm trying create an EDI sales order with item rejected, but I get the following error: Item 000001's configuration can no longer be changed.
    I set the reason for rejection in the segment E1EDP01, field ABGRU.
    How can create the sales order, with item rejected without error?

    Use program SDJEDI to simulate the error (see note 380603)
    This way you can figure out whether the same issue exists in VA01 or just in the SD EDI process
    From reading the issue, it seems you have a configurable item and the line is not open for input and that's why your reason for rejection is ignored.
    But SDJEDI should tell you everything.
    Run it first to see the BDCDATA your idoc produces.
    Then run it again in simulate mode and it should take you very close to the error
    Hope this helps
    Paul

  • 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

  • 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

  • How can I create a sales order with reference to a purchase order?

    How can I create a sales order with reference to a purchase order?
    Thanks in advance...

    Hello,
    you can't create a sales order with reference to a purchase order. You can input customer PO nuber in the sales order Purchase Order number filed.
    Prase.

Maybe you are looking for

  • FB60 can't reversed?

    Dear Gurus, I was made a Invoice through FB60 .it contain vendor   1000 cr TDS       100  cr ( It is cleared and submitted to Goverment) expense a/c  1100 db when i was done FB08 system show the error : document include cleared item). this is for TDS

  • Win7: Skype update will not display some favorite ...

    These non-displaying contacts are stored on my computer.  I can find them if I search SKYPE.  But they will not display with my contacts. I wish Microsoft would not "improve" Skype!  I have spent hours going around in circles trying to pose this ques

  • N73 ME Headset volume Problem

    Hi All Nokia Users I have a Problem with my N73 ME Headset volume it's too low with music player even when connect it with any speakers its too low compared with any other mobile but when i try to make a call its and play musics it's so loud (i loved

  • Question about location of service centre

    Hi Lenovo...Is there any lenovo service centre at Melaka,Malaysia? Solved! Go to Solution.

  • Adjustment panels for Exposure and White balance have dissapeared

    I have been using Lr 5.3 to adjust some RAW images.  My Develope pane is now missing the pane for White balance, hue and also the pane for Exposure, Contrast, highlights etc adjustments.  I don't know how this happened or how to restore them.  I am u