Creating sales order document with reference to billing document

I have to create sales order with reference to existing billing document. I have tried to following bapis.
1. BAPI_SALESORDER_CREATEed
I have successfully created document with following details.
-->ORDER_HEADER_IN:
DOC_TYPE = ZRK
SALES_ORG = 3000
DISTR_CHAN = 00
DIVISION = 00
ORD_REASON = 100
SD_DOC_CAT = L
CURRENCY = EUR
REF_DOC = 100000028
REF_DOC_CA = M
-->ORDER_ITEMS_IN:
ITM_NUMBER = 000010
MATERIAL = 701791
TARGET_QTY = 0000000001000
CURRENCY = EUR
REF_DOC = 100000028
REF_DOC_CA = M
-->ORDER_PARTNERS:
PARTN_ROLE = SP
PARTN_NUMB = W12001
COUNTRY = NL
by providing this input i am able to create the document but it is not picking up the net value. so i have passed some extra paramters in ORDER_ITEMS_IN
COND_TYPE = PNET
COND_VALUE = 14,56
COND_D_UNT = PC.
folowing error is occured: Condition PNET is missing in pricing procedure A V Z0000.
is it something related to configuration problem?
2.BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2
I have used same test data that is used for BAPI_SALESORDER_CREATEFROMDATA (where in i coudl succefully create doc). but here i encounterd following error.
Unpermitted combination of business object BUS2032 and sales doc. category L.
When i created manually using transaction : VA01
I could do the same by passing following inputs:
DOC_TYPE = ZRK
SALES_ORG = 3000
DISTR_CHAN = 00
DIVISION = 00
Reference document number.
Please suggest me right way of approach.

Hi,
In SAP, when the sub-sequent document is existing , we can not cancel the preceeding document. Therefore if you want to cancel the billing document you need to calcel the documents which are created with reference to that.
Check and confirm.
Regards,
Ravi Duggirala

Similar Messages

  • Creating a Credit memo with reference to Billing document

    Hi All,
    I am creating a Credit memo say CM by with reference to a Billing document say B.The Billing document has been created from a Contract say C.
    Now while creating the CM the contract dates need to be copied from C to the contract data screen of CM.
    I have used Copying control Billing Document to Sales Document for achieving this.
    I have edited the VEDA(Contract data) in the routines 302,303,402 etc. but its not reflecting in Contract data of CM screen neither at header level nor item level.
    Please help me in resolving this.
    Replies appreciated.
    Thanks and Regards,
    Blessy

    Dear Rupak,
    Your price / Quantity is copying correctly from Billing means your Copy Control settings are proper.
    Now while creating Credit Memo Request, after you change Quantity you are currently selecting Update & "B" - i.e. Carry out new pricing.
    Here instead of "B" select "A".
    A means - Copy price components and redetermine scales.
    Here the system:
    1. does not determine any new condition types
    2. and only redetermines the scale prices for changed quantities
    I guess this will definitely solve your problem.
    Hope this helps...
    Thanks,
    Jignesh Mehta

  • How to create sales order Automatically with reference to contract?

    how to create sales order automatically through batch or online? can anyone please suggest what needs to be change in SAPMV45A program?

    Hi,
    Wt am able to understand from the above question is, you want to create automatic sales order against contract on a day to day basis by doing batch program, hope am wright.
    See you can do it in two ways.
    1. By using BDC, in SHDB T code record how exactly you will do transaction and then give it to your abaper rest he will do. he will write a program and he will schedule that program every day night.
    2. By using BAPI. Just check in there are many threads are there which gives sales order bapi. Tell your abaper to map that bapi and tell them to schedule back ground job.
    Hope this will help out in solving your problem.
    Regards,
    Nagesh

  • Create sales order (return) with reference - PO number not copied

    Hello all,
    I have a question regarding creating a sales order (return, VA01) with the option "create with reference" where a sales order number can be added as reference.
    The system will copy values from the sales order into the return document like the item, the sold-to-party etc.
    The PO Number (customer PO number) is not being copied in our system, so I was wondering if there is a way to tell the system to copy the PO number from the sales order?
    Thanks,
    Anne

    Hi,
    In the transaction code VTAA, select the target and source document types (return order <- sales order) and click on the details button. Check the data transfer routine (the first one for VBAK) assigned here. You may need to clone this routine (in transaction VOFM -> Data transfers -> orders) and create a new routine to add field VBAK-BSTNK into it.
    Check with an ABAP'er for further details.
    Regards,

  • Credit Memo request with reference to billing document

    Dear all,
    I am having a requirement to create credit memo request with reference to Billing document. But the issue is, I have separate pricing procedure for normal sales to billing, and different pricing procedure for CMR to Credit memo.
    When I am creating CMR with reference to Billing document it copies the pricing procedure, Please suggest how to block pricing procedure to get copied. (please note that B: redetermine pricing, is not working in this case)
    Suitable points for valuable answers guerenteed.
    Regards
    Bidhu

    Hi,
    In VTAF maintain the folowing parameters,
    HEADER
    053,103 and 03 in the Data T in this order from top to bottom,maintain 021 in the billing header box and check the copy item number box.
    ITEM
    153,104,004 in the Data T in this order from top to bottom,maintain 303 in the copying requirements box and pricing type E.
    This should resolve your issue.

  • BAPI SALES ORDER & Copy with reference

    Hello,
    I'm creating sales order copied with reference to an invoice. My problem is that the data item is empty. When I create the sales order manually and use the option 'Create with reference' and choose an invoice, the sales order is created with all data item. I don't know how I can get to copy the data item from the invoice in the new sales order. The code that I'm using is the following:
    DATA: order_header_in      LIKE bapisdhd1,
          order_partners       LIKE bapiparnr OCCURS 0 WITH HEADER LINE,
          order_text           LIKE bapisdtext OCCURS 0 WITH HEADER LINE,
          order_header_inx     LIKE bapisdhd1x,
          order_item_in        LIKE bapisditm OCCURS 0 WITH HEADER LINE,
          order_schedules_in   LIKE bapischdl OCCURS 0 WITH HEADER LINE,
          order_conditions_in  LIKE bapicond OCCURS 0 WITH HEADER LINE,
          extensionin          LIKE bapiparex OCCURS 0 WITH HEADER LINE,
          partneraddresses     LIKE bapiaddr1 OCCURS 0 WITH HEADER LINE,
          order_cfgs_ref       like BAPICUCFG occurs 0 with header line.
    DATA: salesdocument LIKE bapivbeln-vbeln.
    DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    order_header_in-doc_type   = 'ZA09'.
    order_header_in-sales_org  = '1700'.
    order_header_in-distr_chan = '01'.
    order_header_in-division   = '01'.
    order_header_in-BILL_DATE   = '20060701'.
    order_header_in-ref_doc    = '0900000019'.
    order_header_in-refdoc_cat = 'M'.
    *order_header_in-REF_DOC_L_LONG = '0900000019'.
    order_header_in-purch_no_c  ='prueba'.
    *order_header_in-ord_reason = '003'.
    *order_header_in-pmnttrms   = '0002'.
    *order_header_in-sales_off  = '2800'.
    order_header_in-ref_doc_l  = 'FACTURA ES'.
    *order_header_in-fix_val_dy = '20060701'.
    *order_header_in-currency   = 'USD'.
    *order_header_in-exchg_rate = '1.2'.
    order_partners-partn_role = 'AG'.
    order_partners-partn_numb = '0000000001'.
    order_partners-langu      = 'EN'.
    order_partners-name       = 'El corte aleman'.
    order_partners-country = 'ES'.
    APPEND order_partners.
    order_partners-partn_role = 'RE'.
    order_partners-partn_numb = 'ARR000'.
    order_partners-addr_link  = '0000030044'.
    APPEND order_partners.
    CALL FUNCTION 'ADDR_GET_COMPLETE_ALL_TYPES'
      EXPORTING
        addrnumber                 = order_partners-addr_link
      PERSNUMBER                 =
        address_object_type        = '1'
      IV_CURRENT_COMM_DATA       = 'X'
    IMPORTING
      ADDR1_COMPLETE             =
      ADDR2_COMPLETE             =
      ADDR3_COMPLETE             =
       ADDR1_COMPLETE_BAPI        = partneraddresses
      ADDR2_COMPLETE_BAPI        =
      ADDR3_COMPLETE_BAPI        =
    EXCEPTIONS
      PARAMETER_ERROR            = 1
      ADDRESS_NOT_EXIST          = 2
      PERSON_NOT_EXIST           = 3
      INTERNAL_ERROR             = 4
      OTHERS                     = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    data: vl_texto(40) value 'NUEVOOOOO'.
    partneraddresses-name    = vl_texto. clear vl_texto.
    partneraddresses-name_2  = vl_texto.
    partneraddresses-name_3  = vl_texto.
    partneraddresses-name_4  = vl_texto.
    partneraddresses-langu   = 'E'.
    APPEND partneraddresses.
    DATA: vl_cantidad LIKE bapisditm-target_qty.
    vl_cantidad = 1.
    order_item_in-itm_number = 10.
    order_item_in-material = 'HONORARIOS'.
    order_item_in-ref_doc = '0900000019'.
    order_item_in-ref_doc_it = 10.
    order_item_in-ref_doc_ca = 'M'.
    APPEND order_item_in.
    order_schedules_in-itm_number = 10.
    order_schedules_in-req_qty = vl_cantidad.
    APPEND order_schedules_in.
    order_text-text_id = 'Z001'.
    order_text-ITM_NUMBER = ''.
    order_text-langu = 'EN'.
    order_text-text_line = 'Hola, CARACOLAcola'.
    APPEND order_text.
    order_text-text_id = 'Z001'.
    order_text-langu = 'EN'.
    order_text-text_line = 'Adios caracol'.
    APPEND order_text.
    order_text-itm_number = '000010'.
    order_text-text_id = '0001'.
    order_text-langu = 'EN'.
    order_text-text_line = 'Hola, POSICIÓN'.
    APPEND order_text.
    extensionin-structure = 'BAPE_VBAK'.
    extensionin-valuepart1 = '          BCL  7'.
    APPEND extensionin.
    order_cfgs_ref-posex = '10'.
    order_cfgs_ref-config_id = '10'.
    order_cfgs_ref-root_id = '00000001'.
    append order_cfgs_ref.
    CALL FUNCTION 'ZBAPI_SALESORDER_CREATEFROMDT2'
      EXPORTING
       SALESDOCUMENTIN               =  salesdocument
        order_header_in               =  order_header_in
       ORDER_HEADER_INX              =  order_header_inx
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
       salesdocument                 = salesdocument
      TABLES
        return                        = return
        order_items_in                = order_item_in
      ORDER_ITEMS_INX               =
        order_partners                = order_partners
        order_schedules_in            = order_schedules_in
      ORDER_SCHEDULES_INX           =
        order_conditions_in           = order_conditions_in
      ORDER_CONDITIONS_INX          =
        ORDER_CFGS_REF                = order_cfgs_ref
      ORDER_CFGS_INST               =
      ORDER_CFGS_PART_OF            =
      ORDER_CFGS_VALUE              =
      ORDER_CFGS_BLOB               =
      ORDER_CFGS_VK                 =
      ORDER_CFGS_REFINST            =
      ORDER_CCARD                   =
        order_text                    = order_text
      ORDER_KEYS                    =
       extensionin                   = extensionin
        partneraddresses              = partneraddresses
    PERFORM  report TABLES return.
    *DATA: salesdocument LIKE bapivbeln-vbeln.
    *DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    *refresh return.
    *CALL FUNCTION 'BAPI_SALESDOCUMENT_COPY'
    EXPORTING
       salesdocument          = '0400000191'
       documenttype           = 'ZA04'
      TESTRUN                = ' '
    IMPORTING
       SALESDOCUMENT_EX       = salesdocument
    TABLES
       RETURN                 = return
    *PERFORM  report TABLES return.
    *write: / salesdocument.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          =
    IMPORTING
      RETURN        =
    *&      Form  report
          text
         -->P_MENSAJE  text
    FORM report  TABLES   p_mensaje STRUCTURE bapiret2.
      DATA: vl_mensaje TYPE string.
      LOOP AT return.
        CLEAR vl_mensaje.
        MESSAGE ID     return-id
                TYPE   return-type
                NUMBER return-number
                INTO   vl_mensaje
                WITH   return-message_v1
                       return-message_v2
                       return-message_v3
                       return-message_v4.
        WRITE: / vl_mensaje.
      ENDLOOP.
    ENDFORM.                    " report

    Hi Manuel,
    There are some function modules which is there to copy the order details. I am not sure about the function module name. But you can search in SE37. But bapi for creating the sales order does not have the functionality of copying the data from one document to another document.
    You can try using this function module.
    BAPI_SALESDOCUMENT_COPY
    Data will be copied based on the copy control routines that is set between the two document types.
    Thanks,
    Arun

  • Credit Memo request with reference to Billing Document number via IDoc

    Hi,
    I want to create credit memo request with reference to billing document number via IDocs.
    I have tried through ORDERS05, but when I process I saw that it is only processing with reference to contract  number or quotation.
    So is any other way of creating credit memo request creation with reference to Billing document number via IDocs?
    Thank you in advance.
    Regards,
    Santhi

    Please Help... it is Urgent...  Thank you

  • Create Sales Order With Reference to Billing Document Using BAPI_SALESORDER

    Hi,
    How can i create a sales order With Reference to Billing Document Using BAPI_SALESORDER_CREATEFROMDAT2?
    Thanks in advance,
    Alejandro.

    I have to create sales order with reference to existing billing document. I have tried to following bapis.
    1. BAPI_SALESORDER_CREATEed
    I have successfully created document with following details.
    -->ORDER_HEADER_IN:
    DOC_TYPE =                  ZRK
    SALES_ORG =              3000
    DISTR_CHAN   =            00
    DIVISION =                    00
    ORD_REASON =            100
    SD_DOC_CAT   =          L
    CURRENCY       =         EUR
    REF_DOC          =         100000028
    REF_DOC_CA    =         M
    -->ORDER_ITEMS_IN:
    ITM_NUMBER    =           000010
    MATERIAL          =          701791
    TARGET_QTY     =          0000000001000
    CURRENCY        =          EUR
    REF_DOC           =          100000028
    REF_DOC_CA     =          M
    -->ORDER_PARTNERS:
    PARTN_ROLE      =          SP
    PARTN_NUMB      =         W12001
    COUNTRY             =         NL
    by providing this input i am able to create the document but it is not picking up the net value. so i have passed some extra paramters in  ORDER_ITEMS_IN
    COND_TYPE          =        PNET
    COND_VALUE        =        14,56
    COND_D_UNT        =         PC.
    folowing error is occured: Condition PNET is missing in pricing procedure A V Z0000.
    is it something related to configuration problem?
    2.BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2
    I have used same test data that is used for BAPI_SALESORDER_CREATEFROMDATA (where in i coudl succefully create doc). but here i encounterd following error.
    Unpermitted combination of business object BUS2032 and sales doc. category L.

  • I have created a quotation in CRM system. I want that to be downloaded into ECC, so that, I can create a sales order there with reference to that quotation. So, what are the parameters that I need to set in CRM system so that my quotation gets replicated?

    Dear Experts,
    I have created a quotation in CRM system. I want that to be downloaded into ECC, so that, I can create a sales order there with reference to that quotation. What are the parameters that I need to set in CRM system so that my quotation gets replicated without any error?
    Please help me in this regard. An early and in detail step by step guidance is highly appreciated.
    Thanks,
    SMTP

    It may be best to recreate the folder and the smart playlists from scratch.
    tt2

  • Is there any BAPI available for sales order creation with reference?

    Hi Experts,
    My requirement is to create sales order with reference for order type.
    Now my billing document number already contains the two items
    one is correct and another is zero quantity.
    I want to create order with reference of billing document but not with zero quantity item.
    Which BAPI I should use and what to pass to ignore zero quantity item?
    Regards,
    RH

    Hi Ronny,
    Try using BAPI_SALESORDER_CREATEFROMDAT2
    Regards,
    Shraddha

  • Credit/Debit Memo Request with reference to Billing document via IDoc

    Hello Experts,
    It seems SAP doesn't support Credit/Debit Memo Request with reference to Billing document via IDoc. Via IDoc, we can create sales document only with reference to contract or quotation but not with reference to billing/invoice document.
    Wanted to check if anybody came across such requirement and what would be the best way to acheive (Other than custom program using BAPI).
    Additional Information: Its ECC 6.0 Environment with AFS 6.03
    Appreciate your help.
    Thanks,
    Shekhar.

    Please Help... it is Urgent...  Thank you

  • FM/BAPI to create Transfer Order(TO) with reference to TR or Material Doc.

    Hi,
    I am in need of Function module or BAPI to Create Transfer Order(TO) with reference to Transfer Requirement(TR) or Material Document.

    Hi,
    Please try any of the below,
    1.Look at function group L03B (Transfer order processing)
    2.Use L_TO_CREATE_TR
    3.BAPI_GOODSMVT_CREATE set:
    GOODSMVT_ITEM-STGE_TYPE_PC = destination storage type or GOODSMVT_ITEM-STGE_TYPE_ST = destination storage type
    4.Look at fm L_TB_VERAENDERN. This isn't RFC, but you might copy fm into ZL_TB_VERAENDERN and set RFC on.
    Hope this helps.
    Thanks,
    Harini

  • Pricing procedure determination for complaint document with reference to billing

    Hello Guys,
    I am configuring complaint process for project purpose and I got stuck. I need to change the pricing procedure which is determined for complaint
    document . Right now the pricing procedure is copied from Billing Document for which complaint refers to.
    I am searching a place in configuration where I could change the pricing procedure determination for complaint document with reference to billing doc.
    Could you please advise where I can find it ?
    Thank you in advance!
    Br,
    Frederic

    Hello Frederic,
    I would check the following in SPRO:
    - CRM
    - Basic Functions
    - Pricing
    - Pricing in the Business Transaction
    - Determine Pricing Procedures
    Here the pricing procedure depends on sales organization, division, distribution channel, document pricing procedure and and customer pricing procdure.
    Best regards,
    Thomas Wagner

  • Invoice verification with reference to billing document in cross company

    Hi Gurus,
    We need to do "Invoice verification with reference to billing document in cross company code scenarios".
    At present I am processing through MIRO by calling the PO.
    What is the alternative for this and how to do it?
    Thnx

    Hi
    It is not possible to do the invoice with reference to billing document.
    You can create the Invoice referncing the PO used for STO or the delivery note (as mentioned in the Material document) or directly on the vendor.
    Thanks & Regards
    Kishore

  • How to find whether the created Sales Order is with BOM or without BOM ?

    Hello,
    I am technical guy i want to find whether the created sales order is with BOM or without bom.
    Can anyone help me with table details.
    Regards
    VEk@

    Go to TVAP & in FIELD STRUM give 'A' & PSGRP as 'SD01'.It will giveyou all the Item categories maintained in BOM.
    Now you can cross - check with the Item Category maintain in the Sales Order.
    Best Regards,
    Ankur

Maybe you are looking for