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.

Similar Messages

  • 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

  • Sales order with reference to another Sales order

    Hi SAP Gurus,
    Good day.
    I would like to seek an advice from u regarding this scenario:
    First if all, is this scenario possible-create sales order w/ reference to another sales order?
    We have a scenario wherein the original sales order has a material w/ free goods. And then when we create another sales order w/ ref to that iriginal sales order, the free goods appeared twice.
    Original SO:
    Item.  Material.    Qty.  item cat
    10.      123.          5.       ZOR
    20.       123.         1.       ZORR
    SO w/ ref to above orig SO:
    Item.  Material.    Qty.  item cat
    10.      123.          5.       ZOR
    20.       123.         1.       ZORR
    30.        123.         1.      TANN
    Item 30 should not appear since our goal is to copy exactly what was on the original sales order.
    I have checked the item cat and copy control & seems it is correct.
    Please advice
    Thanks,
    Erza

    dear friend,
    your 'key' transaction is VTAA
    the copy control has two parts - header and item levels - check them both
    1.
    find out your record (source to target) , goto Deatails and check out two checkboxes - "Copy item number" and "Complete reference" . also check out the copying requirements - look at routine number and make sure it is correct
    2. at item level check out all relevant 'copying' fields
    good luck

  • Create a sales order with reference to another one. (BAPI)

    Hi everybody,
    I'm trying to create a new sales order with reference to another one (That's important because of the documents flow).
    I'm using 'BAPI_SALESORDER_CREATEFROMDAT2' but I couldn´t do it yet. I've read some ideas about this kind of creation in this forum; but I still haven´t found the solution yet.
    Some ideas about the BAPI parameters I nedd to complete?
    Thanks in advance!!

    Hi,
    Go through this one
    *& Report ZSD_R_SALESORDER
    report zsd_r_salesorder1 line-size 132 message-id zmmbapi .
    *& Created By : shailaja
    *& Created on : 13.10.2007
    *& Requested By : vardhman
    *& Description of program :
    Internal table definition *
    data: gt_order_header_in like bapisdhead occurs 0 with header line,
    gt_return like bapireturn1 occurs 0 with header line, " Return Messages
    gt_order_items_in like bapiitemin occurs 0 with header line, " Item Data
    gt_salesdocument like bapivbeln-vbeln , "Number of Generated Document
    gt_order_partners like bapiparnr occurs 0 with header line, "Document Partner
    gt_return1 like bapiret2 occurs 0 with header line.
    Data definition *
    types: begin of ty_gt_ft_sales ,
    partn_numb(10) type n ,"Customer Number 1
    partn_role(2) ,"Partner function
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    material(18), "MATERIAL
    targetquantity(020),"Target quantity
    reqqty(020), "Req quantity
    reqdate(010), "req date
    *REQ_DATE_H(010),
    ref_1(012), "Ref
    unload_pt(025),
    *PARTN_ROLE(2) ,"Partner function
    *PARTN_NUMB(10) ,"Customer Number 1
    end of ty_gt_ft_sales,
    begin of ty_header ,
    partn_numb(10) ,"Customer Number 1
    partn_role(2) ,"Partner function
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    unload_pt(025),
    req_date_h(010),
    end of ty_header,
    begin of ty_item,
    material(18), "MATERIAL
    targetquantity(020),"Target quantity
    reqqty(020), "Req quantity
    reqdate(010), "req date
    ref_1(012), "Ref
    *UNLOAD(025),
    end of ty_item.
    data : msg(240) type c, " Return Message
    e_rec(8) type c, " Error Records Counter
    rec_no(8) type c, " Records Number Indicator
    s_rec(8) type c, " Successful Records Counter
    t_rec(8) type c, " Total Records Counter
    v_matnr like mara-matnr,
    v_parvw type parvw.
    data : gt_ft_sales type standard table of ty_gt_ft_sales with header line.
    data : wa_gt_ft_sales type ty_gt_ft_sales,
    wa_order_items_in like gt_order_items_in,
    wa_gt_ft_sales1 type ty_gt_ft_sales,
    wa_header type ty_header,
    salesdocument like bapivbeln-vbeln.
    selection block for EXCEL UPLOAD FILE
    selection-screen begin of block b1 with frame title text-000.
    parameters file type ibipparms-path obligatory.
    selection-screen end of block b1.
    *<<<<AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .
    at selection-screen on value-request for file .
    perform getname.
    form getname.
    call function 'F4_FILENAME'
    exporting
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    importing
    file_name = file.
    endform.
    *TOP-OF-PAGE.
    top-of-page.
    skip 3.
    format color col_heading inverse on.
    write 40 text-001.
    format color col_heading inverse off.
    skip 1.
    format color col_negative inverse on.
    write :/ text-002, 13 sy-mandt , 104 text-003, 121 sy-uname,
    / text-004, 13 sy-datum , 104 text-005, 121 sy-uzeit.
    format color col_negative inverse off.
    skip 3.
    *START-OF-SELECTION.
    start-of-selection.
    perform get_data.
    perform bapi.
    *end-of-page.
    perform result.
    form result.
    t_rec = e_rec + s_rec.
    skip 3.
    format color col_total inverse on.
    write: /38 text-007, t_rec.
    format color col_total inverse off.
    format color col_negative inverse on.
    write: /38 text-008, e_rec.
    format color col_negative inverse off.
    format color col_total inverse on.
    write: /38 text-009, s_rec.
    format color col_total inverse off.
    endform.
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    form get_data .
    call function 'WS_UPLOAD' "#EC *
    exporting
    filename = file
    filetype = 'DAT'
    tables
    data_tab = gt_ft_sales
    exceptions
    conversion_error = 1
    file_open_error = 2
    file_read_error = 3
    invalid_type = 4
    no_batch = 5
    unknown_error = 6
    invalid_table_width = 7
    gui_refuse_filetransfer = 8
    customer_error = 9
    no_authority = 10
    others = 11.
    if sy-subrc 0 .
    message e000.
    endif.
    endform. " get_data
    *& Form BAPI
    form bapi .
    loop at gt_ft_sales into wa_gt_ft_sales.
    wa_gt_ft_sales1 = wa_gt_ft_sales.
    at new partn_numb.
    wa_header-doc_type = wa_gt_ft_sales1-doc_type..
    wa_header-sales_org = wa_gt_ft_sales1-sales_org . "'0001'
    wa_header-distr_chan = wa_gt_ft_sales1-distr_chan. "'01'
    wa_header-division = wa_gt_ft_sales1-division. " '01'
    wa_header-purch_no = wa_gt_ft_sales1-purch_no.
    wa_header-req_date_h = wa_gt_ft_sales1-reqdate.
    call function 'CONVERSION_EXIT_PARVW_INPUT'
    exporting
    input = wa_gt_ft_sales1-partn_role
    importing
    output = v_parvw.
    wa_header-partn_role = v_parvw.
    wa_header-partn_numb = wa_gt_ft_sales1-partn_numb.
    wa_header-unload_pt = wa_gt_ft_sales1-unload_pt.
    move-corresponding wa_header to gt_order_partners.
    move-corresponding wa_header to gt_order_header_in.
    append gt_order_header_in.
    append gt_order_partners.
    endat.
    call function 'CONVERSION_EXIT_CCMAT_INPUT'
    exporting
    input = wa_gt_ft_sales1-material
    importing
    output = v_matnr.
    gt_order_items_in-material = v_matnr .
    gt_order_items_in-target_qty = wa_gt_ft_sales1-targetquantity . "'1000'
    gt_order_items_in-req_qty = wa_gt_ft_sales1-reqqty.
    gt_order_items_in-req_date = wa_gt_ft_sales1-reqdate.
    *GT_ORDER_ITEMS_IN-BILL_DATE = wa_GT_FT_SALES1-REQDATE.
    gt_order_items_in-ref_1 = wa_gt_ft_sales1-ref_1.
    append gt_order_items_in.
    clear : wa_gt_ft_sales1,wa_header.
    at end of partn_numb.
    call function 'BAPI_SALESORDER_CREATEFROMDAT1'
    exporting
    order_header_in = gt_order_header_in
    WITHOUT_COMMIT = ' '
    CONVERT_PARVW_AUART = 'X'
    importing
    salesdocument = salesdocument
    SOLD_TO_PARTY =
    SHIP_TO_PARTY =
    BILLING_PARTY =
    return = gt_return
    tables
    order_items_in = gt_order_items_in
    order_partners = gt_order_partners.
    ORDER_ITEMS_OUT =
    ORDER_CFGS_REF =
    ORDER_CFGS_INST =
    ORDER_CFGS_PART_OF =
    ORDER_CFGS_VALUE =
    ORDER_CCARD =
    ORDER_CFGS_BLOB =
    ORDER_SCHEDULE_EX =
    if gt_return-type eq 'E' .
    e_rec = e_rec + 1.
    read table gt_return with key id = 'V1'.
    format color col_negative inverse on.
    rec_no = e_rec + s_rec.
    concatenate text-006 rec_no ':'
    gt_return-message into msg separated by space .
    condense msg.
    write: / msg.
    format color col_negative inverse off.
    elseif gt_return-number = '000'.
    s_rec = s_rec + 1.
    format color col_positive inverse on.
    msg = 'SUCCESS'.
    condense msg.
    write: / msg .
    format color col_positive inverse off.
    write :/ salesdocument, 'Has been created'.
    perform commit_mm.
    endif.
    clear: gt_return[], msg.
    endat.
    endloop.
    endform. " SLALE_UPLOAD_DATA
    *& Form COMMIT_MM
    text
    --> p1 text
    <-- p2 text
    form commit_mm .
    call function 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'
    importing
    return = gt_return1.
    clear: gt_order_items_inhttp://].\"GT_ORDER_CONDITIONS_IN[.
    endform. " COMMIT_MM
    inthis pass re_doc field in header...
    Edited by: Naresh kumar

  • Tables for creating a new sales order with reference to another

    Hi Experts
      In ABAP, how can identify that  I'm creating a new sales order with reference to another in the userexit read_document??, In which tables is this information??.
    Thanks
    Regards

    In Table VBFA there are two fields
    a)  Preceding Document  and
    b)  Subsequent Document category
    Based on the above two fields, you can conclude that sale order is created with reference to a preceding document.
    thanks
    G. Lakshmipathi

  • Creating an order with reference to another doc

    I want to create an Order with reference to another document.....in other words it should be a copy of the other document...
    Any ideas of what function modules we have to use and how we can acheive it...

    Hi Vin
    Creating a Sales Order from a Sales Order Quotation is SAP Standard so really should not be an issue for you.
    You do need to maintain the Copy Control Configuration as per my previous reply.
    Define Copying Control for Transaction Types
    Define Item Category Determination when Copying
    Effectively the details of your Transaction Type for Sales Order Quotation will copy into your Sales Order transaction.
    I'm used to working in an environment where the user manually decides to then continue with a follow-up transaction, therefore I'm not too sure which Function Modules you need to use in order to do this automatically.
    But you are on the right track.
    Regards
    Arden

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

  • 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

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

  • Create a configurable material with reference to another config material

    Hi,
    I want to create a configurable material with reference to another configurable material from different system.
    Please tell me what data i need to check to see if that material has been created (copied manually) successfully.
    Thanks.

    Hi,
    In case of configurable material most important thing is configuration so please check weather the configuration is copied perfectly with all characteristics or not. Similarly check the valuation class and price control is proper or not.
    Regards,
    Umesh

  • Create an outbound delivery with reference to a purchase order

    Hi folks, would you tell me if I can create an outbound delivery with reference to a purchase order?
    I tried to use the transaction VL10B but after I run there is no data is selected. Should I set up anything else for that?
    Thanks in advanced.

    Hi,
    Yes, you can create outbound delivery with reference to a PO.
    In transaction VL10B, if you are not sure about the shipping point leave it blank. ALso, you can check the shipping point from the shipping data and enter it here.
    Leave the field Condition rule to create delivery blank so that it will consider PO with delivery date falling within one year.
    In the Purchase order tab, enter the PO number.
    Execute.  It should fetch you the PO list due for delivery.
    Before doing the above, make sure PO is not subjected to release strategy. Check the quantity in the PO due for delivery.
    Thanks and Regards,
    Maheshwari

  • Creating ERP Sales order with reference to CRM Service Order

    Hello all,
    I am trying to create an ERP Sales Order from CRM. If Icreate the Sales Order manually, it is working correctly but, if I try to create the ERP Sales Order as follow-up document for the CRM Service Order, it is not working.
    I have defined the Cross-system Copying of Transaction Types, byt the ERP sales order is not shown as possible follow.up doc from the CRM Service Order. Does anyone know if it is possible?
    Additionally, I would need to create CRM Sales Orders in reference to ERP Sales Order. Is there any way to do it??
    Thanks in advance and Regards,

    Hi Oliver,
    Rajendra answer is correct.
    The SAP Standard integration Scenario creates a ERP sales order for all the salesitems in the serviceorder.
    Without items no salesorder is created in standard.
    Maybe you could realize your requirement with own coding when you save a new service order or by button - click.
    I realized something similar some weeks ago. One hind:  It is helpfull to maintain a ztable where you store which CRM serviceorder is linked to which sales orders.
    Kind regards.
    Manfred

  • 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 (type) with reference to another Sales order only

    Hi
    I have 2 Order Types (ZRA and ZRC). The ZRA should always be created only with reference to a ZRC. It should not be allowed to create ZRA directly.
    I believe I can remove the Item categories somewhere, but can't figure it out. Any help is appreciated
    Regards,
    Vikas

    Hi
    In sd doc tyoes in t code vov8 in the general control tab you can define mandatory referance and in that you can choose option C which means the referance doc should be only a sales doc not enquiry or quotation
    Pls reply whether my suggestion has helped you
    Raja

Maybe you are looking for

  • Can't read messages in sent folder

    We can't read any messages in the sent folder. The window only shows the following message: +The message from Nicki Frech <[email protected]> concerning "test" has not been downloaded from the server. You need to take this account online in order to

  • ID CS6 Interactive Pdf with buttons is coming up blank

    Please help. I am making a resume after recently graduating college. I have made the entire resume other than the "portfolio" page. I wanted to make the page show small images of my work, than when you roll over them they expand to show a larger imag

  • URL to an IP

    I have just configured our CSS 11501 with the one arm config and it is working, now I need to tie a URL to the VIP address. How do I do this? THanks to all, gilbert

  • Time Machine fails - cannot make backup folder

    For the past two weeks I've been having some major issues backing up my computer with Time Machine. It's become quite a process. iMac 27" Mountain Lion I am backing up to a brand new - well bought in February, '14 - 1TB external hard drive and there

  • Site won't show

    I have made changes to my "index" homepage in dreamweaver but when I "put" it to the remote site and then view the site I get a blank page, nothing happens. This is a recent development before I've successfully updated the site without any problems.