CRM_COPY_BADI/Copying Routines

Hi,
I want to copy some custom fields from a source line item to a target line item during business transaction copying. For this, I would like to use the Copy Control BAdI - CRM_COPY_BADI. After having a look, it appeared to me that I will have to define a new copying routine to which the BAdI implementation will be linked. Then, the copying routine will have to be specified in the relevant Copy Control Customizing settings. Is my understanding correct?
If it is, then does it mean that I will have to attach the copying routine to the copy control settings of all the item categories that are there (and of course for which I want the routine to be called)? Don't know why but it sounds a bit weird.
Thanks for answering.

Yes, your undersanding is correct. You create your own implementation of badi and then link this implementation to each combination of item category copy control definition. This allow you to be very flexible if you need different logic for different item categories.
Regards.

Similar Messages

  • How to clear the fields within copy routines in the copy contorl

    HI Gurus,
    I need to clear  the fields VBP-VBELV and VBAP-PSSNV within the copy routines 303 in the copy control between quote item and sales order item. I am not sure how to do that... Can some body please help.
    This is required because we had sales order and quote using the same requirement type which controls the special stock indicator. This leads to the stock getting update in quotation instead of the sales order, because the quotation is initiating document (collecting all cost etc).Now i know requirement should only be passed to production from sales order and not from quotation so i changed the config but there are some existing documents using same requirement type on both quotation and sales order and to correct those i need to clear fields VBP-VBELV and VBAP-PSSNV within the copy routines 303.
    Please help!
    Regards,
    Sam

    Hi ,
    just use this code in ur save button action handler , this will clear the field after entered in to the database and will ready for the next set of data.
    String password=wdContext.currentContextElement().getpwd();
    try{
         InitialContext ctx=new InitialContext();
         DataSource ds=(DataSource)ctx.lookup("jdbc/SAPJ2EDB");
         Connection con=ds.getConnection();
         con.setAutoCommit(false);
         Statement stmt=con.createStatement();
         int retIns = stmt.executeUpdate("insert into TMP_NEWUSERDETAIL(PASSWORD) values("password")");
         con.commit();
         con.setAutoCommit(true);
         wdContext.currentContextElement().setpwd(null);
    or use a seperate button to clear the field.
    wdContext.currentContextElement().set<Attributename>(null);
    Regards
    Vijayakhanna Raman

  • Problem in copy routine while creating the follow up to Servcie Request

    Hi,
    I am creating Lead as follow up from Service Request. I have partner functiona called Reporter in Service Request. Now what ever the value is there in Reporter I need to copy it into Contact Person of Lead. However, I am not seeing any method to update the contact person in COPY ROUTINE BADI.
    Can you please help me.
    Thanks,
    Sandeep

    hello,  in the COPY ROUTINE BADI, you don't need the method special for partner.  You can set the parnter of new document by CRMD_ORDER_MAINTAIN.
    In the function, you only need the new document guid handle, and the partner guid which you want to set in the document, and partner type.

  • Why cannot copy routine of shipment be used to transfer delivery data?

    Hi
    i create new copy routine for shipment to transfer some data of delivery (such as; shipping cond). I would like to use copy routine rather than user exit.
    Who have the best solution , please tell me.
    Best Regards,
    Autsnee P
    Message was edited by:
            Autsnee Phuangchaisri

    Hello.
    As the standard of SAP provide us to be able to copy data from Delivery by routine only : FwdAgent, Route and Deadline, so if you would like to copy other datas from delivery , you can use the user exit : EXIT_SAPLV56F_010 to copy other datas from Delivery to Shipment.
    You can see the note no.387541
    Autsnee P.

  • What is copy routine?

    Hi All,
    I am not aware of the concept of copy routines, can any expert throw some ligh on this would be really helpful.
    thanks in advance.
    Regards,
    Karthik

    hi check this,
    transcation code VOFM
    https://forums.sdn.sap.com/click.jspa?searchID=5370600&messageID=1230484
    https://forums.sdn.sap.com/click.jspa?searchID=5370600&messageID=348123
    search for COPY ROUTINES in the SDN forum.
    I am sure u will get an idea.
    for pricing routine.
    1. You have to use VOFM transactino to create new pricing routine..
    2. You have to assign the pricing routine to the pricing procedure...which can be done in V/08
    If it is related to Sales order first write the required code in the MV45AFZZ include program price related forms FORM USEREXIT_PRICING_PREPARE_TKOMK and
    FORM USEREXIT_PRICING_PREPARE_TKOMP.
    even after writing this if you are not getting the related output
    goto VOFM tcode for wrting the Routines
    from menu Requirements-> pricing
    You can create the pricing related routines here
    Use the Number from 900 only
    take the acess key and try to copy the existing routine and change the code to your requirement and keep a break point and see
    Activate it before execution
    regards,
    Prabhu
    reward if it is help ful

  • Copy routine

    Hi,
    i need to copy routines available in vofm through user exit how can i do that ?
    Regards

    Check this thread.U can find steps to create copy routine.
    creating a new routine using vofm

  • Repair Order Process - o/b delivery from PO, need copy routine

    Hi Experts,
    We are configuring repair order process and while creating o/b delivery to Vendor from PO, need to check for GTS message and should be blocked that document for further processing in ECC. For SO to o/b delivery working fine using include program RV50B901 (routine 901, document type OR to LF, item category TAN). It is copy of 101 routine and added GTS code to block the documents in ECC if GTS is blocked for compliance checks.
    For o/b delivery from PO, document type NB with item category L (subcontracting but in copy control, I don't see LB to NB rather LB to DL. Is it correct? I put a break point in routine 901 but it is not hitting that routine. Where can I look at to find correct routine to include GTS code?
    I really appreciate your reply.
    Regards,
    Manohar.

    Hi Manohar,
    This is not really a GTS question, is it?  You should ask in the MM forum.
    Regards,
    Dave

  • Copy routines written in transfer rules to other system

    <Moderator Message: Even as a newbie you should be able to copy and paste or read here and write there>
    Hi All,
    In the datasource '0CO_OM_OPA_6' , in the transfer rules for infoobject 0PART_CCTR' , we have a ruotine written 'Fill  Partner Cost Center from Partner Objects'.
    Now I want to write the same routine for same infoobject in another test server for the same data source.
    Can anybody please tell me how to go about from start as I am new in BW.
    Regards,
    Sushmita
    Edited by: Siegfried Szameitat on Jun 8, 2009 3:47 PM

    I think you should check the source system assignment in the transport connection. It might have directed to the old sytem.
    Cheers
    Chanda

  • VOFM Copying Routines

    Hi,
    I have 2 requirements - firstly where sales orders should not be combined into a delivery for a particular Special Processing Indicator value ( VBKD - SDABW ), i.e, seperate deliveries should be created. The 2nd requirement is for delivery split for a single sales order based on shipping type condition.
    I choose to copy the existing Copying requirement 051 in VOFM - > Copying Requirements - > Deliveries into a custom routine 600 and add the extra code here for VBKD - SDABW and asked my functional colleague to make necessary config in VTLA at header level. Unfortunately the routine is not triggered.
    For the 2nd requirement, i decided to copy the existing copying req 101 and add the extra code here for shipping type in my custom routine 601 . After making config changes at item level, this routine is getting triggered and the delivery is getting split. However since 1st req is failing i tried putting the extra code of 600 in 601 itself -- since basically the 1st req also requires you to split the two orders into seperate deliveries instead of combining them into 1 delivery. But this is still not working.
    i tried this idea since the concept is basically about splitting two orders into two deliveries in the 1st req and splitting a single order into multiple deliveries in the 2nd req. does my prob have anything to do with the fact that 601 is config at item level and 600 at header level ??
    Any inputs are welcome since i am completely lost.... Thanks....

    Hi,
    Check these notes:
    Note 546668 - FAQ: Delivery split when creating deliveries and related.
    Note 399912 - Split analysis activation during delivery creation (so useful to do the analysis).
    So you can copy it with tcode VOFM (search in google a document with this string: inside vofm ext:pdf, or check this notes, so you will know how to do your own VOFM (remember the naming conventions for VOFM, call it 901 e.g.). Too, you can check Note 327220 - VOFM function and its objects and related notes.
    Regards
    Eduardo

  • New SD copy routines

    Hello,
    I have created 2 new routines, 900 and 901, in VOFM but when I go to transaction VTAA to assign them they do not show up as available in the drop down.  They are active in VOFM.  Is there a step I am missing?
    Thank you,
    JR

    did you activate main program ?
    Check this PDF..for creating a new VOFM copying requirement.
    http://saptechsolutions.com/pdf/VOFMCopyRequirementRoutines.pdf
    Regards,
    Maha

  • Changing WBS element in copy routine.

    Hello All,
    I need to change WBS elemnet of specific sales order when i create this with treference to master sales order.
    I am changing in Routine FV45C151(Enhancement spot implementation), But while saving this routine is being triggered twice before save. Because of this what ever the value i am changing that is being refreshed with the old value ....
    How can i control this?
    My intension is i need to trigger my code which creates new WBS element and assigns this new value to the new documnet only Once..
    Any Idea..
    Regards,
    Krishna.

    I resolved it on my own..
    i created a z table and i am sending this data temporarily and deleting after succesful processing..
    Thanks.

  • VOFM Routine Copy in ECC 6.0

    Hi,
    When I copy a VOFM routine in ECC 6.0 (say billing document routine 001 copied to 901) to a custom routine, I see some messages regarding the existing enahancement points & sections, which do not allow me to activate the copied routine. Can any one of you suggest a good practice to copy the routine in ECC 6.0 environment.
    Thanks
    BK

    Hi,
      When ever you are copying it from the standard routine. The enhancement points and sections available in the standard will also be copied into the custom. So, Place the cursor on Enhancement-pont or Enhancement-section and right click select the option enhancement-> undo. Once you do this the enhancements will be deleted from custom routine and then you can activate it.
    Thanks
    Indira.

  • SD copy control (routines) in ECC6 executed more than once.

    We're upgrading from ECC5 to ECC6.
    An SD custom "copy routine" in VA01 (SAPMV45A) is being called twice in ECC6 (incorrect) but only once in ECC5 (correct).
    The result is that the same informational message displays repeatedly and users have to press the <enter> key many times.
    Any of you encounter this behavior?
    Thanks
    Leo

    - In which of these [User Exits In Sales Document Processing|http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm] is the message sent ?
    - Also check once again those user exits in SPAU
    Regards,
    Raymond

  • Copying the value of customized fields from one order to other in CRM

    Hi ALL,
    We have added new customized fields in web ui for Sales Order.
    Now when we are using the standard COPY functionality to copy one particular sales order, then all the fields are getting copied into new order except the customized fields which we have added.
    We have created new data elements for our fields and added it by EEWB transaction.
    Please let me know if there is any badi or any other way which we can implement so that our customized fields are also copied.
    Thanks,

    Hi!
    BADI "CRM_COPY_BADI" is the one you are looking for.
    Create badi implementation and assign copy routine to the copy management parameter.
    The parameter can be configured via IMG->CRM->Transactions->Basic settings->Copying Control for Business Transactions->Define Copying Control for Transaction Types.
    I hope it helps you.
    Regards,
    Fukuhara Yohei

  • Redetermine the VAT rate after item copy

    Hello everyone,
    [Background]
    I am in a project which is for VAT rate change.
    We implement a new condition BADI to reset Price_date in the communication structure to change the tax date.
    In the BADI we mapped varies date types(Such as Sales date) to PRICE_DATE.
    so when some date type was changed the BADI will be run for new tax determination.
    [Issue]
    The problem is when we follow-up from a contract to a new contract or sales order, the PRICE_DATE are not changed in some cases.(Just as copy source's PRICE_DATE)
    [Approach and question]
    After made a investigation, we found that the issue maybe resolved in item copying control customize.
    [CRM->Transactions->Copying Control for Business Transactions->Define Copying Control for Item Categories]
    There is a filed that we can define condition copy rule.
    - Do not copy conditions
    - C: Only copy manual conditions
    - D: Copy all conditions
    - G: Copy conditions and redetermine Tax
    By default all item category copy rule were set to C and D.
    What would be the risk of setting D to G?
    Is there any impact when changing D to G?
    -----------------------------------------For testing purpose you can implement the BADI as below----------
    [BADI Implementation detail]
    1. Enable Performance-Optimized Condition Processing and Pricing
    2.Define Customer-Specific Mapping of Condition Fiedls
         Add a record for PRICE_DATE, we copy it from standard and add a filter for Condtion FILLING BADI like Z00001
         The standard settings is mapping to PRICING-PRICE_DATE
         #Before using the filter you have to define it in "Implement BAdis to influence Mapping of Condition Fields"   
    3.Implement a Condtion Filling badi(BADI:Filling of Condition Fields)   CRM_CND_FLD_FILL
         after determining the new Price_date, add the value to the return value  RT_ATTR_VALUE.(You shouldn't leave it as blank or condition will be lost )
         For testing purpose, you can set a constant value in it.
    4.If you want to trigger your BADI when some filed changed, you have to implement a new BADI (CRM_CND_OBJ_REG)

    Hi Hui Sun,
    Your aprroch regarding copying control is right. You can keep the option D or G to copy the Pricing conditions.
    And after changing the coopying control for the item categories and keep a break point in CRM_COPY_BADI in the particular Copying routine implementation and in that keep a break point  PRICING and PRICING_I methods.
    The pricing will be automatically copied. if not copied then you have to maintain the Pricing using the FM in the methods of above mentioned implementation.
    Please check the importing parameters and export parameters of the Methods.
    Regards,
    Rajya lakshmi CH

Maybe you are looking for