BAPI - Sales document - Copy control issues

Hi,
I am creating a Credit memo referencing an invoice using the function "SD_SALESDOCUMENT_CREATE'.
I get the invoice pricing details using RV_INVOICE_DOCUMENT_READ. Populate the inputs manually and pass those values to SD_SALESDOCUMENT_CREATE' with the flag  logic_switch-pricing set to  'G'.
I have two issues,
1. Group conditions(Freight) value is not copied from the value that is passed.   Please let me know
2. pricing procedure is not copied. But I was able to overcome this by exporting the invoice pricing procedure to memory before calling the fn "SD_SALESDOCUMENT_CREATE" and importing the value in the Sales order userexit(MV45AFZZ) and change pricing procedure in tables tkomk / VBAK . Not sure if this is the correct way to implement. Please advise.
Thank You.

Hello
If you want to copy all the details from invoice to credit memo request and modify the pricing type to 'G', then
please follow the below steps
1. Use BAPI_SALEDOCUMENT_COPY - This will copy the invoice data to credit memo.
2. If you need to modify the Credit memo data based on credit memo type then ask the functional owner to put the custom copy control routine (VOFM routines) and you can modify the custom routine for the VBAK/ VBAP and VBKD etc as required.
3. For the pricing issue, you need to implement a BADI in program MV45AF0T_TVCPA_SELECT. The enhancement spot is Enhancement-point TVCPA_SELECT_01 SPOTS ES_SAPMV45A.
Here modify TVCPA-KNPRS = 'G'  when TVCPA-AUARN = < Credit memo Type>.
There may be other validation, depending on the business need.
Let may me know, it helps you. Thanks.
Edited by: Atul Mohanty on May 31, 2011 8:12 PM
Edited by: Atul Mohanty on May 31, 2011 9:14 PM

Similar Messages

  • Copy Control Issue- Service Order to Service Confirmation for Sales Items

    Hello All,
    I have a scenario where in my service order, I am entering both items Sales Relevant Items and Service Relevant Items(screen shot of the service order attached)
    The Service Order gets saved, now when I am creating the service confirmation as a follow up document to the Service Order, I am getting the below error for the sales relevant item
    Since I have not maintained copy control settings for my sales relevant item in my service confirmation I am getting the above error when copying, the reason for me not maintaining the copy control settings is that the sales relevant item is not required for the service confirmation, what steps do I need to perform so that my sales relevant item does not get carried to the service confirmation transaction type
    Please Advice.
    Kind Regards
    Atul

    Hi Gobi,
    I do not want the sales item to be copied to my service confirmation, then could you please advice what functional configurations I need to make
    I have removed the copy item category settings, I have also removed the Define Item category determination when copying
    Kind Regards
    Atul

  • Disable Document Flow in Sales Order copy control

    Hello,
    We have a request where the customer doesn't want the docflow to appear when you copy a sales order to another sales order?  I know that you can disable the flag for the item categories however, when you do this, there is still a link between a sales order when it's created by referencing another.  Is there a way to create a sales order via "copy with reference" and to not have them linked in the docflow?  Possibly one of the configuation settings in the copying control?   We are on 6.0. 
    Thanks,
    Chris

    Hi,
    I think It is not possible through configuration.
    Pl try screen exit
    or
    change in standard program,which is not advisable.
    Thanks,
    Vrajesh
    Edited by: Vrajesh G. Nayak on May 4, 2010 1:36 PM

  • 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

  • Pricing Type D to work for sales order to sales order copy controls

    Hi,
    Issue: Pricing type D does not work while creating a debit memo request in reference to the credit memo request.
    Credit memo request and debit memo request have identical pricing procedures.
    But in this case, the credit memo was created with reference to a billing document which had a different pricing procedure and the pricing procedure components of the billing document was copied entirely into the credit memo request with pricing type D in the copy control.
    But when this credit memo request is referenced to create a debit memo request with the pricing type D in the copy control, the price is re-determined in the debit memo request. But the scenario requires, the pricing elements to be copied completely from the credit memo request.
    Please advise for the corrections or on the changes to be made to the requirement.
    Thanks and Regards,
    Gopinath
    Edited by: Gopinath Naik R on May 18, 2009 5:31 PM

    This is due to the Coopy Routine in Billing to Sales Doc.
    In the Copy control routine of the Item , you find the routine being used, Inside this Routine , you will find a statement like
    MOVE-CORROSPONDING CVBRK to VBAP
    This statement is actually transfering all feilds from billing document to the Order with the Billing Pricing Procedure.
    Just add one line before this statement " LOCAL CVBRK-KALSM
                                                                            or
                                                               CVBRK-KALSM = VBAK-KALSM
    This will give you the new Determined Pricing Procedure.
    this is a change in code of the Routine , may be you need to copy and create a new routine to add this line.

  • Delivery copy control Issue

    Dear All,
    I created a new order type, Item category, Delivery type and delivery item category. Maintain copy controls  too.
    But system is not allowing to do delivery.Error Message '
    Copying is not poss.because an entry is missing in Table TVCPL; ZTAN- LF.
    I searched in forum too no solution in most of the cases. Entry is reflecting in Table TVCPL.
    May you pls advise
    Regards,
    DP

    Hello,
    If you need your flow to be a Z*** order-> Z*** delivery, then it is correct not to maintain a copy control from Z*** order->LF delivery.
    What I can suggest is to:
    1. Remove your copy control from Z*** order->LF delivery.
    2. Review your entry in transaction VTLA ans make sure that  you have only now the copy control from Z*** order-> Z*** delivery.
    2.1. Make sure you have the item category/(ies) from the order in the configuration of the item level in transaction VTLA
    2.2. If you need a new item category in the delivery, you can make a new item category determination.  But in most cases, this is just copied from the sales order (see documentation in SPRO path for copying control for deliveries).
    Sample Entries in TVCPL
    Delivery Type//Sales Doc Type//Item Category
    ZEBB             //ZBR2                                          <-this is my copy control header level
    ZEBB             //ZBR2                //ZB70               <-this is my copy control item level; ZB70 is the item category as determined in the preceding Sales Order ZBR2
    3. Make sure you also have the proper copying requirements and data transfer routines depending on the business requirement.
    Good luck,
    Eva

  • Sales doc copy control not working with price condition

    Here's the situation.
    For OR sales document I have  Procedure ZSALES and price conditions Z001
    For a QT Sales document I have Procedure ZQUOTE which does not have a Z001 condition in that procedure.
    If I create an OR (with the proper customer / matieral) the Z001 populates, based on it's defined record.
    If I then create another OR with reference to the original OR, the Z001 populates with no problem.
    Up to now everything's fine, now here's the probem......
    If I create an OR with reference to a QT, the Z001 does not populate in the OR order.I know there is no Z001 in the QT for it to copy from, but if I do [New Pricing] in the order it still does not come in.(I've tried [new Pricing] with Pricing type A..G)
    I have found OSS Note 413066, but this is in reference to 46c systems. we are on ECC 6.0
    any ideas ?

    Hi Bill,
    If PP assigned for both are different it's not going to populate field even if you are redertermining price, since it would be following the PP of Quotation (ZQUOTE), not Sales Order (ZSALES) because it's gonna copy the elements of that PP in order. Are your PP assigned are same or different?
    Hope this will answer your query
    Regards
    SD

  • Exchange rate is redetermined during sales document copy

    Dear expert,
    When we copy a quote, CRM re-determines the exchange rate based on the today's date.It does not keep the exchange rate and exchange rate date which were used
    in the original quote. I can't change the exchange rate date in order to have the same date than in the original quote.
    Is there a way I could achieve this?
    Thanks in advance
    Stephanie

    Which note is that?
    Thanks
    Vikas

  • Output Control and Copy Control

    I have the following problem.
    My client has a copy control for transfering data from a quotation to a different type of quotation. The quotation (old one) has a sold-to-party and a ship-to-party. These two partners are copied to the new quotation. If for any reason the ship - to - party is changed, then while printing an output for the quotation, the old ship - to - part is being printed.
    What should I do?

    Hi Stilianos,
    Please go to NACE t-code and check your output condition records regarding of your access sequence and output type.  condition record may effect your ship-to  like your problem.
    Moreover, check your routines maintained properly your copy control partner item routine and copying requirement to your copy control item level from SD>Sales and distribution>Sales>Maintain Copy Control for Sales Documents > Copying control: Sales doc to sales doc.
    I hope these will be helpful for your issue. Additionally, please share with us the progress about it.
    Regards,
    Sinan

  • Update copy control?

    How can we update a copy controls?
    Thanks!

    Dear Raghav,
    In IMG under
    Sales and Distribution -> Sales -> Sales Documents -> Maintain Copy Control for Sales Documents -> Copying Control: Sales Document to Sales Document
    or Transaction VTAA
    Sales and Distribution -> Sales -> Sales Documents -> Maintain Copy Control for Sales Documents -> Copying Control: Billing Document to Sales Document
    or Transaction VTAF
    Regards,
    Naveen.

  • How to configure a new third party sales document type?

    Hi SAP SD gurus,
    I am new to the SAP world, I need your help in configuring a new third party sales document type for a site.
    There are existing third party document types being used in the region, but the client wants an entirely new third party document type that is activated for CREDIT MANAGEMENT.
    I just need your inputs, as how to go about it. If I copy from an existing third party sales doc. What additional steps do I need to follow? Like Item category config, copy control settings, and credit management.
    Is there a need to create new billing types?
    Also as per process, by creating a new document type, how will it affect the logistic processes, if any?
    Thanks a lot in advance for your valuable inputs.

    Hello,
    You can create new document type under following customization path
    SPRO>>Sales and Distribution>>Sales>>Sales Documents>>Define Sales Document Types
    Now create new document type by copying the standard document type OR
    Now go to
    SPRO>>Sales and Distribution>>Sales>>Sales Documents>>Sales Document Item>>Define Item Categories
    which is already defined for third party sales (TAS)
    Now assign this iteme category to your new document type
    SPRO>>Sales and Distribution>>Sales>>Sales Documents>>Sales Document Item>>Assign Item Categories
    Assignment needs to be done in combination of sales document type and item category group (BANS)
    Now
    SPRO>>Sales and Distribution>>Sales>>Sales Documents>>Schedule Lines
    Assignment of schedule line is already done as you are using the standard one.
    Lastly, you may need to maintain copy control for your newly created sales document type for this go to
    SPRO>>Sales and Distribution>>Sales>>Maintain Copy Control for Sales Documents
    (Copying Control: Sales Document to Sales Document)
    Here you can define copy control requirements.
    BR,
    Tushar

  • Problem with copy control from sales document to billing document

    Hi,
    I have a copy control from a sales document to a billing document,
    which is copying everything from the sales document, except the
    conditoin values. Any ideas on why will a copy routine won't copy the
    condition values from a source document? I don't even have a document
    pricing procedure assigned to my billing document. Any setting, that
    we can do to for the conditions to get copied from the sales document
    to the billing document...just as they are in the sales document?
    Thanks for the help in advance.
    Regards,
    Vijay

    In IMG,
    Implementation Guide for R/3 Customizing (IMG)
    -->Sales and Distribution
       -->Billing
          -->Billing Documents
             -->Maintain Copying Control For Billing Documents
                -->Copying control: Sales document to billing document
    What setting do you have for your source sales document type to target billing document type? Select the row that shows the document type you are interested in and double click on item(on the left pane). Select the item category and do display. What value do you see under the 'Pricing Type' and 'Price Source'?
    May be that is where some config setting is missing.
    Srinivas

  • Copy control from quotation to sales order

    HI ,
    Though my quoation is incomplete it can be copied into sales order, kindly suggest me a so;ution where in incomplete quotaion cannot be copied into sales order.Kindly explain me teh setting in TCODE (VTAA) STEP BY STEP.
    Regards
    Sunaina

    hi,
    Copying control for sales documents is in Customizing, under Sales and Distribution - Sales - Maintain Copying Control for Sales Documents.
    In this you can change the procedure by not selecting incomplete quotation for sales order, but this can be done only when some of the data in quotation is missing.
    like dont give the validity date in quotation and save it before providing the validity date.
    Maintaining an Incompleteness Procedure
    An automatically-created quotation does not contain a Quotation-valid-to date. The customer's system requires this information for processing; therefore you have to add it to the quotation prior to saving the document, and before generating the message to the customer.
    The incompleteness control is set up in such a way that the quotation is incomplete if this date has not been entered. In Customizing for Sales and Distribution, you choose Sales and Distribution - Basic Functions - Incompleteness Control for Sales and Distribution Documents, to assign sales document type QT (quotation) to incompleteness procedure 10, which contains the field for this check.
    Message Control
    The following message types have been created to Sales and Distribution (SD) in the vendor’s system:
    ·        Message type AN00 for the quotation
    ·        Message types POST and PNST for status inquiries
    ·        Message types BA01 and BA02 for the order  
             confirmation and amendment respectively
    ·        Message type LALE for the delivery
    ·        Message type RD00 for the invoice
    regards,
    Siddharth.

  • Create Sales order with reference to a Billing Document - Net price issue

    Hi Everyone,
        The Billing Document has one line item with Net value of 16,000. However, when I create the Sales Order with reference to the Billing Document, the net price shows 64,000.  When I check the Document flow of the Billing Document, there were two Contracts on top of my Billing Document. One is a contract with the overall status of "Being Processed" and this is where I checked the net value is 64,000. The next contract invoice is already completed (net value is 16,000).
        Has anyone encounter such case? How would I be able to create the sales order with reference to the Billing document and have the net value of what is in the Billing Document (16,000). Which part of the configuration is setting this up. Thanks!

    Hi,
    This is a very rare case, if you are sure of the scenario, would suggest you two alternatives:
    1) whenever you go against the flow of SAP, you have customize it, so its better you discuss this matter with your ABAP person.
    2) never tried it out but you can:
    you cannot see that in Billing Document that which is the sales document assigned to it, but to estblish that relationship,
    we do copy control setting from Billing Document to Sales Order type (T.Code:VTFA).
    Menupath: SPRO >> IMG >> Sales & Distribution >. sales >> Billing Document >> Copy Control >> Copy Control from Billing Document to Sales Order Type.
    Hope this will help you.
    Regards,
    Siddharth.

  • Copy control for Text in Sales Order

    Hi All,
    i would like to check with you guys.
    I have a scenario where by, we create sales order and maintain item text. This is copied to the delivery. Here the text if modified to enter more text.
    But when it comes to invoice, it is copying the text from the sales order instead of the delivery.
    How can I configure it to copy from delivery?

    Hi,
    Kindly check the following points:
    1) Same text ids are present at Delivery item & Billing Item.
    2) It at you want it at Item level text only then try through the ABAP routine at Copying Control between Delivery to Billing.
    3)As u must have checked at Delivery --> Billing Document Copying control at item level , I didn't find any control for text.
    Similarly for the Header. But by default Header text will overlap the item text as well due to the missing routine. But I have verified it in the past, if you maintain the same text at Delivery Header and it will populate at your billing document Header text as well.
    Please try and confirm the same.
    Thank You,
    RB.

Maybe you are looking for

  • Function group in tablenaintenance generator.

    hi experts,        can anybody please tell me why we create a function group       while creating a table maintenance generator? what is the utility of creating a function group. regards pankaj

  • G570 graphics cards...

    I was having problems with my graphics cards, getting errors so I uninstalled them. after just reinstalling my intel Hd one, I did a quick windows experience test & have now got a score of 5.9. Before I had a score of 5.0 Please can you explain to be

  • Support As Many Resolutions As Can

    Hi, If I build an app with several renditions , lets say matching the ipad 2 resolution 1024 on 768, if an Android user with the same screen resolution will download the app (it will be availableon the Play Store), will he get the same experience? Th

  • Asset depreciation forecast

    Hi, Is there a std sap report wherein it would list all the assets and also forecast the depreciation period wise for say period 1 to period 12 for the year 2008. I want the listing of all the assets along with the forecast not like in asset explorer

  • WSRP vs Webservice Data control

    Hi all, I am developing an webcenter portal framework application using Webcenter 11.1.1.6.0 I have to invoke a webservice in my application.  The Webservice saves the data to database. Which one is more preferable to invoke a webservice in Webcenter