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.

Similar Messages

  • 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

  • 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

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

  • How to create a Contract with reference to a Sales-Order(VA01) with a BAPI

    Hi,
    my name is Wadim and i need help.
    My problem:
    I am creating a sales-order(VA01) with the BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'.
    After that i have to create a contract(VA41) with reference to this order. I found the BAPI "BAPI_CONTRACT_CREATEFROMDATA" and it has the same interfaceparameters like the salesorder-bapi. but there are no parameters to get a connection to the sales-order.
    Is it even possible to get a connection to a sales-order with a bapi???
    thanks for help
    regards mark
    Edited by: Krapp Wadim on May 20, 2010 9:19 PM

    Hi Wadim,
    I have a similar requirement to create order lines in an existing contract with reference using  BAPI_CUSTOMERCONTRACT_CHANGE.  The order lines get created in the contract. However, the condition types from the order line which i'm referencing are not getting referenced and are not getting added in the Contract's line after referencing.
    Did you come across any such issue ? If yes , could you suggest the solution ?
    Regards,
    Venkat.

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

  • 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

  • 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

  • Invoice VF01 with reference to the sales order

    Dear Experts,
    Our business requirement is to book the invoice with reference to the sales order without posting delivery and PGI. Provide me the step by step process to complete this configuration.
    Is that suggestible to change the existing document type which the business is using by creating delivery PGI and Invoice to the document type where invoice booking with reference to sales order or I have to go with the new document type only.
    With Regards
    Uday
    Message was edited by: G Lakshmipathi
    Please dont add such text in your post which is not encouraged in SCN.

    TW Typewriter
    can you help, by creating the entire process in Sandbox and informing uday about the configuration steps?
    At the outset, please refrain posting like this which, being a senior member of SCN, you should be aware of rules where spoon feeding is definitely not encouraged.  Those sort of efforts have to be taken by OP.   This forum is only to guide the people wherever they get stucked. 
    cc: Phanikumar V
    You should also be knowing the forum rules and I thought, you would have expressed like what I said above.
    G. Lakshmipathi

  • One sales order with reference to 2 sales orders

    Hi Gurus,
    can v create one sales order with reference to 2 sales orders?
    i think it is not possible, but if there is any chance let me know?
    Cheers,
    Sumith

    First u need to ensure whether copy controls are maintained between the documents (say Ex ZOR ---> ZOR) here i am assuming that ur source and target document are of same type)
    Maintain the controls.
    Then u need to create the source documents  and save.
    Then, u need to create the target document by using the create with reference button, enter the first reference order no and proceed further. ater entering into the order, again u need to press the create with reference button for the second time to enter the second reference order.
    Now both the order items will come to a single order. now u can proceed further
    Hope it is useful...
    reward points if u found useful..

Maybe you are looking for

  • How to retrieve data from a view.

    HI, I want to retrieve the values of the <b>Field MNTXT from the view V_T530</b>. Please let me know how i can retrieve data from this view.The Select statement doesnt work on a view. Regards, Bhavika

  • How to unload MC from memory?

    While running my app I need to create and kill MCs rapidly. Now I use "stage.removeChild(...);" Is this method removes created clip from memory, or they still stuck somewhere and eat my precious memory until it runs out and hang player?

  • Can I download What's App for free?

    Can I download What's App for Free in IPod Touch?

  • Upgrading to PSE 12 - having a problem

    I am starting to regret spending $100 on upgrading from PSE9 to PSE12. It installs just fine but I can't bring across my catalog. It stops at the same point every time - 34%. I have followed the support document on what to do if catalog import fails

  • PerfView : Does source code lookup always shows time-based-indicators and not size-based?

    Hi,     I've two questions on "source code look-up feature" - this is one of the highlighting features from PerfView (thank you for that). 1) I've created ETL aiming only at managed memory pressure analysis (that is by deselecting all other options e