Create return with reference to original sales order - partners

Hi all
I'm using the function SD_SALESDOCUMENT_CREATE to create a return order with reference to the original sales order. (Partially return works fine too).
All the informationen from the original sales order (including partners). I'm reading with the function BAPISORDER_GETDETAILEDLIST. This works fine. I get all the correct datas from the sales order.
The problem: when I create a return order with the SD_SALESDOCUMENT_CREATE it takes the partners from the standard defined partners table and not from the original sales order.
For example, standard defined partners for Customer: 10101010:
200010 Dealer 1
300101 Subdealer 2
501001 Salesman
When I have in the sales order only this partner:
200010 Dealer 1
it takes into the Return still all the 3 partners. Also then, when I explicity delete these other partners in the partnertable (return_partners) before I leave to the Function: BAPI_CUSTOMERRETURN_CREATE.
Can anyone help me?
Thank you so much!!
Petra

Hi Petra
  Can you check how itz behaving when you create using
VA01 with reference document for the same case.
Kind Regards
Eswar

Similar Messages

  • Create return with reference to original sales order - pricing

    Hi
    I am using the function SD_SALESDOCUMENT_CREATE to create a return order with reference to the original sales order.
    All the information from the original sales order (including pricing conditions) I've read with the function BAPISDORDER_GETDETAILEDLIST.
    The problem : the pricing conditions. I need to copy the conditions from the original order and it is not working correctly.
    Any ideas?
    Thanks.
    Anca

    Correct...
    You need something like:
    *Get the pricing cond number.
    select single knumv from vbak into cond
      where vbeln = '0000080347'.
    if sy-subrc = 0.
    Get the pricing record which are by line item.
      select * from konv into table konv_tbl where knumv = cond.
    Loop thru them one line at a time.
      loop at konv_tbl.
       bapi_cond-itm_number = '000010'.
        bapi_cond-cond_st_no = konv_tbl-stunr.
        bapi_cond-cond_count = konv_tbl-zaehk.
    CALL FUNCTION 'BAPI_CUSTOMERRETURN_CREATE'
      EXPORTING
        RETURN_HEADER_IN               = bapi_hdr
       BUSINESS_OBJECT               = 'BUS2102'
        CONVERT                        = 'X'
      IMPORTING
        SALESDOCUMENT                 = bapi_salesdoc
       RETURN                        = BAPI_RET
      TABLES
        RETURN                        = bapi_ret_tbl
        RETURN_ITEMS_IN                = bapi_itm
        RETURN_ITEMS_INX               = bapi_itm_out
        RETURN_PARTNERS                = bapi_prtnr
        RETURN_SCHEDULES_IN            = bapi_schd_lin
        RETURN_CONDITIONS_IN           = bapi_cond.  "pricing
      ORDER_TEXT                    = bapi_text.

  • ORDERS05 - Create a Return with reference to a Sales Order

    Hi all,
    I'm trying to create a return with reference to a sales order via IDOC ORDERS05. I'm indicating referenced Sales Order number into segment E1EDK02; indicating qualifier (QUALFR = 002) and Sales order number (BELNR). By this way, I create a Customer Return but without reference.
    Which fields or segment have to be filled in order to create it correctly?
    Thanks
    Marí

    Correct...
    You need something like:
    *Get the pricing cond number.
    select single knumv from vbak into cond
      where vbeln = '0000080347'.
    if sy-subrc = 0.
    Get the pricing record which are by line item.
      select * from konv into table konv_tbl where knumv = cond.
    Loop thru them one line at a time.
      loop at konv_tbl.
       bapi_cond-itm_number = '000010'.
        bapi_cond-cond_st_no = konv_tbl-stunr.
        bapi_cond-cond_count = konv_tbl-zaehk.
    CALL FUNCTION 'BAPI_CUSTOMERRETURN_CREATE'
      EXPORTING
        RETURN_HEADER_IN               = bapi_hdr
       BUSINESS_OBJECT               = 'BUS2102'
        CONVERT                        = 'X'
      IMPORTING
        SALESDOCUMENT                 = bapi_salesdoc
       RETURN                        = BAPI_RET
      TABLES
        RETURN                        = bapi_ret_tbl
        RETURN_ITEMS_IN                = bapi_itm
        RETURN_ITEMS_INX               = bapi_itm_out
        RETURN_PARTNERS                = bapi_prtnr
        RETURN_SCHEDULES_IN            = bapi_schd_lin
        RETURN_CONDITIONS_IN           = bapi_cond.  "pricing
      ORDER_TEXT                    = bapi_text.

  • Create return but linked to original sales order where the material was delivered in the first instance

    Hi Everyone
    I want to create return but linked to original sales order where the material was delivered in the first instance, I don’t want to create other sales order (to return) with references to the original, and then other sales order to be delivered again (replacement).
    Example
    SALES
    1. Create a sales order number 33 with 10 Ton
    2. The delivery is linked to sales order 33 just with 8 Ton
    3. Invoice is created linked to the delivery with 8 Ton
    4. Sales order number 10 pending qty is 2 Ton
    RETURN
    5. We would like to link the return delivery to the sales order, 5 Tons will be retuned
    6. Credit memo is created
    7. Sales order number 10 pending qty update to 7 Ton

    The only way is to change the item categories in the delivery.
    Create the delivery wrt the original sales order.
    Change the item category(In the config make sure the return is checked)- But I think you need to do some changes in the user exit to enable the item category in the delivery)..
    The other option is to have a return order document(type RE) and then create the return delivery for this document. In the copy controls you can maintain the return item categories while creating the return order from sales order..
    Thanks

  • Create complaint with reference to CRM sales order

    Hi,
    We have the requirement to create a complaint as a follow-up to a CRM sales order.
    We don't want to reference the invoice, but only the sales order. The sales order is available in CRM,
    so I would expect that we can reference the CRM sales order when creating a complaint.
    However, what I find is that we need to implement BAdI "CRM_COPY_BADI_EXTERN". Is that true? Do we need
    to implement this BAdI?
    Is there a sample coding available?
    regards,
    Wim Olieman

    Perhaps I should create a new thread, appears the standard complaint return CRMR allows me to create the return mulitple times against the same sales order number in CRM 7.0.
    Our pricing flunctuates a bit, so we don't want the same order to be used over and over again in creating the return.
    Is this the same behaivor you see?

  • TO CREATE AN INVOICE WITH REFERENCE TO THE SALES ORDER

    I have a credit memo request(sales order) and I need to create a credit memo(invoice) on saving the sales order without creating the delivery order in between.The invoice(credit memo) must be created directly with "reference" to the sales order(credit memo request) without the delivery order in between

    Hi,
      You can deliver the standard sales order by VA02 going to sales document-> deliver.
    then save it it will give you outbound delivery number then go to vl02n the do the PGI of the same.
    and for Invoices first create billing document byVF01 then create invoice list VF21
    Thanks
    Ankur
    Edited by: Ankur Sharma on Jul 23, 2008 7:51 AM

  • How to create Deliveries with lesser quantity than sales order quantity

    HI all,
    I have one Scheduling Agreement SCHDMNT1 with ITEM A and Qty 100. Now i want to create 2 deliveries against this Agreement i.e DEL1 - ITEM A QTY 40 and DEL2 - ITEM A QTY 60. How to aceive this while manually entering the deliveries. What are the settings required. I also want to create such multiple deliveries against one Sales Order. What are the Configurations required to aceive this functionality.Replies will be highly appriciated.
    Thanks and Regards,
    Manish Khare.

    Hi,
    In the customer master, you have to select more than one delivery allowed.
    While creating delivery with reference to your sales order, the total quantity will be copied to delivery, just the change the delivery quantity and picking quantity that u want to deliver and do the PGI.
    Against reference the same SO, now the remaining qty will default in the delivery. In this way u can have multiple deliveries for the same SO.
    Hope this helps.
    Thanks,
    Viswanath

  • Create Return PO using ME21N with reference to Original Purchase Order

    Dear Experts,
    Does anyone knows how to create Return POs with reference to Original Purchase Order using ME21N.  The Purchasing Department will be initiating the Stock Return to Vendor so we don't want to use MB01, 161 Movement Type to create the return PO.  Can anyone help.
    Thanks.

    Hi,
    It is not possible to create a Return PO w.r.t. the original PO. Even if you will copy, it will just copy the details from PO but not store the reference of original PO in return PO.
    Better instead of creating a new return PO, add a separate line item in the orginal PO by marking it as "Return" and perform all the subsequent transactions. This will provide the better traking and reporting. But this may affect your release strategy (need to be tested).

  • Create a Revenue Order with Reference to a Sales Order

    Hi Gurus,
      I have specific requirement of creating a Revenue Order ( ZCAR ) with Reference to a Sales Order. The Issue is when I create a Revenue Order from Sales Order by using the BAPI to Copy the data from Original Sales Order it will create copy the data which is there in Original Sales order. My Requirement is when I create the Revenue Order I should have Credit Line which is same as the Order Line from Orignal Sales order and also I need to have a debit line ( which will be a copy of Credit Line ) only difference is Item Categories will be different .
    Please tell me how can I add the debit line in this Scenario and which BAPI's should I use to do this.
    Thanks,
    Raj

    What is the IO you have assigned in the Sales Order please?
    Just check the Sales Order - Account assignement, so that you can able to change if there is a different IO.
    System won't pick up IO automayically until unless you secify in Sales order to done OKB9 settings.
    Chek the above
    Thanks

  • Create a Sales order with reference to another sales order  using BAPI

    Dear All,
    Can any one tell me what are all the parameters required to create a Sales order with reference to another sales order using BAPI_SALESORDER_CREATEFROMDAT2....
    Thanks in advance

    Hi Madhan
    Thanks a lot for your reply.
    However, I would like to know which parameters need to passed in this BAPI in case of SO creation with reference. I beleive there are only a few parameters that need to passed in ORDER_HEADER_IN, ORDER_ITEMS_IN, etc.
    Need to know exactly which are these parameters.
    Regards
    Mihir Shah.

  • BAPI to create sales order with reference to another sales order

    hi all,
    is there a bapi that allows you to create a sales order with reference to another sales order?
    thanks,
    V

    Hi Valencia,
    I think the normal BAPI (BAPI_SALESORDER_CREATEFROMDAT1)will do. You will have to fill the fields REF_DOC, REF_DOC_IT, REF_DOC_CA of the table ORDER_ITEMS_IN (and make sure that Customizing settings allow you to copy from order to order).
    Regards,
    John.

  • FM to create Sales order with reference to another Sales order

    Hi,
    Is there any inbound IDOC FM which can create a Sales Order with reference to another Sales order.
    PLease reply
    Santhana M.

    Hi,
    try FM BAPI_SALESORDER_CREATEFROMDAT2
    with ORDER_HEADER_IN fields
    REFOBJTYPE
    REFOBJKEY
    REFDOCTYPE
    Regards,
    Clemens

  • Creating new sale order with reference of old sale order.

    Dear gurus
    i have requirement
    i want to make a sale order with reference of old sale order.
    how to achieve it?
    Regards
    Saad Nisar

    Hi,
    In vtaa
    give source and document number and assign all the relevant routines.
    Now on the left hand side, click the Item button and then give the source I.C as TAC and target also as TAC adn then fill the routines.
    Do the same for Schedule line (which is related to TAC)
    If this is done, then ur scenario will work

  • Single Invoice with reference to 2 Sales Order

    Hi,
    How can i make a single  billing invoice no (vf01) with reference to 2 sales order?
    billing plan has been maintained from each sales order,we dont have any pgi process.
    so process is sales order->billing plan-> invoice
    my user want to generate single invoice with reference to 2 sales order - same customer no.

    For processing  billing due list (VF04) - The system combines documents with the same customer number, proposal billing type and sales organization, and attempts to include them all in the same billing document. If the preconditions are met, then a single invoice is created for the deliveries and/or orders.
    To do a collective billing. Collective Billing Documents
    The selected documents in the billing due list are billed. The system tries to combine them as much as possible. Processing of the selected documents is carried out in the background. After processing of the documents, you return to the billing due list. The sysytem will indicate whether or not a document has been billed successfully.
    If successful, then Save
    You can also carry out a simulation of billing. In this case, select Simulate. The system simulates the collective billing / online function described above.
    -After the collective run you can display a log for the collective run. This displays possible errors during billing.
    -You can also branch to the resulting billing documents, in order to carry out a split analysis.
    -The billing documents of a collective run can also be canceled.
    Re: VF04
    Hope it assist you.
    Thanks & Regards
    JP

  • Creation of Billing with reference to the Sales Order

    Dear Friends,
    I need your suggestion for the following scenario.
    Client wants to create the Billing Document with reference to the Sales order.I mean when he is entering sales Order while creating the billing document ,the system should generate the billing document only for the delivered quantity.
    e.g  sales order is created for 100 Tons.And there are 5 delivery documents for 50 Tons.(Still the Sales order is open).
    Now when billing document is created with reference to the sales order ( Not with reference to the Delivery Document) it should create the billing document only for these five deliveries.
    Is it possible? If yes,how?
    Thanks in advance.
    Regards,
    Shrikant

    Hi Murali,
    Currently client has software where he enters only  Sales Order no and their software creates the billing for the delivery document for this Sales Order.
    Here client does not want to enter multiple delivery document nos if any.He wants to enter only Sales Order no.
    Regards,
    Shrikant

Maybe you are looking for