Using BADI ORDER_SAVE to implement order split?

I'm working in a CRM 4.0 system in which I need to create an order split based on sales organizations. My initial idea was to create an implementation of the BADI ORDER_SAVE in which I call the method CHANGE_BEFORE_UPDATE where I want to read the available sales order data and perform the split.
The scenario could be that a sales order comes in from internet sales or is generated directly in CRM with one line from sales organization X and one from sales organization Y. I want to read the available line item data and split the order in two orders. One for each sales organization.
I have been looking through the functions in function group CRM_ORDER_API and through the available methods for business object BUS2000115, but I cannot seem to find anything that works at the point in time where my BADI is called.
In my system one order containing two different sales organizations will fail, so an alternative might be to have a batch job running that reads the failed orders after they have been saved in CRM and splits them according to my requirements using the function module CRM_ORDER_MAINTAIN.
Would any of you CRM gurus have a suggestion to how I can implement the first scenario as I find this solution a bit more elegant than the second?
Best regards,
Anders

Anders,
Another approach is the following:  Save the order generated by ISA as a different document type from the target split order.  The next step is to use the SPPFCADM action configuration to build a scheduled action that is kicked off when your document is saved(I believe you can make the order save as a triggering condition).  Then in the new action class read the document determine whether it needs to be split and generate the subsequent sales documents as needed.
The problem with splitting out the original document is that you lose track of the "logical" orginal order, and you face the issue of deleting the items from the original document.  The benefit of creating subsequent documents is that you maintain the document flow, and only have to create new orders which is much simpler.
Good luck,
Stephen

Similar Messages

  • BAdI needed for transfer order split with the maxi.of 5 item level

    Hi,
    BAdI needed for transfer order split with the maximum of 5 item level.
    If a transfer order contains 12 item level, three separate transfer order should be created with item level 5,5 and 2.
    This transfer order is for the material which bound to flow to production from warehouse.
    Can anyone explain the step by step procedure to implement this BAdI?
    It would be great if the procedure is for New BAdI.
    Thanks.

    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/63ee7f486cc143a560799d8803ce29/content.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/srm/badi-general+information&
    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c2/eab541c5b63031e10000000a155106/frameset.htm
    The specified item was not found.
    http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://members.aol.com/_ht_a/skarkada/sap/
    http://www.ct-software.com/reportpool_frame.htm
    http://www.saphelp.com/SAP_Technical.htm
    http://www.kabai.com/abaps/q.htm
    http://www.guidancetech.com/people/holland/sap/abap/
    http://www.planetsap.com/download_abap_programs.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
    http://www.allsaplinks.com/badi.html
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3430https [original link is broken] [original link is broken] [original link is broken]:///people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework /people/thomas.weiss/blog/2006/05/03/source-code-enhancements--part-5-of-the-series-on-the-new-enhancement-framework
    http://www.esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://www.esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://www.esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://www.esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    http://www.esnips.com/doc/3b7bbc09-c095-45a0-9e89-91f2f86ee8e9/BADI-Introduction.ppt

  • Display error message in WEBUI using BADI - ORDER_SAVE-CHECK_BEFORE_SAVE

    Hi,
    I am trying to display error message using BADI - ORDER_SAVE (Method-CHECK_BEFORE_SAVE) based on certain conditions when the document is saved from WEB UI.
    I have written it like below:
    If (some conditions).
    Message E000 with 'Error in SAVE' RAISING DO_NOT_SAVE.
    endif.
    I mentioned my message class everything in class, and it is fine.
    However, it is not displaying my error message. It is displaying standard information message saying "Document Could not be saved'.
    Could you please help me out, how can I display my custom message.
    Thanks,
    Sandeep

    Hi Sandeep,
    U can use FM to raise a message from order save badi.
    Inside the if condition, u can raise do_not_save.
    If (some conditions)
          CALL FUNCTION 'CRM_MESSAGE_COLLECT'
            EXPORTING
              iv_caller_name = 'ORDERADM_H'
              iv_ref_object  = iv_guid
              iv_ref_kind    = 'A'
              iv_msgno       = '000'
              iv_msgid       = 'zcrm'
              iv_msgty       = 'A'
              iv_msgv1       = c_text1
              iv_msgv2       = c_text2
              iv_msgv3       = c_text3
            EXCEPTIONS
              not_found      = 1
              appl_log_error = 2
              OTHERS         = 3.
          IF sy-subrc NE 0.
          ENDIF.
          RAISE do_not_save.
    ENDIF.

  • BADI ORDER_SAVE

    Hi,
    Before saving an activity in CRM Web client we want to to some check of
    input data. If the data is not right we do not want the user to be able
    to save the activity. I have found a BADI for this that I think we
    could use BADI: ORDER_SAVE. I can see that it already exists an
    implementaion done by SAP for this BADI.
    If I want to add code in method CHECK_BEFORE_SAVE should I then use
    this implementation done by SAP or is it possible to create a new
    implemenation for my changes and have two active implementations of the
    same BADI?
    Best Regards
    Annika Alsé

    Hi Annika
          Yes,you guys can create new one for activity and perform it when save activity.
          and you can set do_not_save parameter value to control if save it.
    Best Regards,
    Jason

  • Set subject in incident using BADI

    Hi Experts
    I'm working with solution manager 7 and I'm trying to set the Subject field based on some rules using BADI ORDER_SAVE, method CHECK_BEFORE_SAVE but I can't find a FM to set that field, I tried with CRM_SUBJECT_CHANGE_OW but it didn't work. Do you know a better idea to set this field using ABAP?
    Thank you

    Hi Experts
    Any help would be appreciate it, do you have an idea on how to do this?
    Thank you

  • Order splitting no  cost collectors

    One of my client wants to split the orders without implementing cost collectors?Is it possible to implement order splitting without cost collectors? If so can any one guide me
    Thanks in Advance
    Points would be awarded
    Edited by: Aparna on Aug 29, 2008 6:14 PM

    Don't believe you can... the main issue is that the costs assigned to the parent order before the split would cause pseudo variances in the system.
    Costs have to be collected on a PCC for both the Parent and Child orders.
    Cheers.

  • Ques on Single use Badi

    Hi Frds,
    I search a lot but could not found much except defination of Singel Use Badi.
    Few Ques i have, Please share you though.
    Example : Calculating Net value in Badi.
    1) After the single use BAdi called, can we change this value at run rime.
    2)  Name few single use BAdi in SAP CRM.
    3) Some of the example/requirement where single use Badi used.
    Thanks
    Imran

    Hi Deva,
    It is up to functional requirements. In multiple use BADI you can implement a BADI many times depending on filter value. Think the scenario you are workin in an international company and there is a requirement to calculate tax for each country and there is a BADI. If country key is defined as filter value you can implement same BADI for each different country and differemt implementation will run in all different countries.
    But as you can see it is not always necessary. Functionally you may not need to implement your BADI more than one times. It can be enough to use only one implementation.
    Regards,

  • What is the BADI  while SAVING purchase order using me22n?

    what is the BADI  while SAVING purchase order using me22n?
    while i will save purchase order through me22n, badi should be fire what is badi for that?
    regards,
    dushyant.

    Dushyant,
    Hopefully you know how to implement the BADI ME_PROCESS_PO_CUST now.
    The following are the codes that you can put in the method "Post".
      DATA: LW_HEADER        TYPE MEPOHEADER,
            LW_POSTED_HEADER TYPE MEPOHEADER,
            LW_VALID         TYPE MMPUR_BOOL,
            ITAB_ITEM        TYPE PURCHASE_ORDER_ITEMS,
            LW_ITEM          TYPE MEPOITEM,
            ITEM_INTERFACE   TYPE PURCHASE_ORDER_ITEM,
            ITAB_ACCT        TYPE PURCHASE_ORDER_ACCOUNTINGS,
            ACCT_INTERFACE   TYPE PURCHASE_ORDER_ACCOUNTING,
            LW_ACCT          TYPE MEPOACCOUNTING,
            LW_POSTED_ACCT   TYPE MEPOACCOUNTING,
            W_ACCT_CHANGED  TYPE C,
            W_GRANT_AMT      TYPE EKPO-NETWR,
            W_FINANCE_AMT    TYPE EKPO-NETWR,
            W_FLAG           TYPE C.
    Check if PO header data is valid
      CLEAR LW_VALID.
      CALL METHOD IM_HEADER->IS_VALID
        RECEIVING
          RE_VALID = LW_VALID.
      CHECK LW_VALID = 'X'.
    PO header data is valid
    Get the newly updated PO header data
      CLEAR LW_HEADER.
      CALL METHOD IM_HEADER->GET_DATA
        RECEIVING
          RE_DATA = LW_HEADER.
    Get the posted PO header data
      CLEAR LW_POSTED_HEADER.
      CALL METHOD IM_HEADER->GET_PERSISTENT_DATA
        IMPORTING
          EX_DATA = LW_POSTED_HEADER
        EXCEPTIONS
          NO_DATA = 1.
      IF SY-SUBRC <> 0.
        CLEAR LW_POSTED_HEADER.
      ENDIF.
    Get PO line items
      REFRESH ITAB_ITEM.
      CALL METHOD IM_HEADER->GET_ITEMS
        RECEIVING
          RE_ITEMS = ITAB_ITEM.
      LOOP AT ITAB_ITEM INTO ITEM_INTERFACE.
    Check if PO line item is valid
        CLEAR LW_VALID.
        CALL METHOD ITEM_INTERFACE-ITEM->IS_VALID
          RECEIVING
            RE_VALID = LW_VALID.
        IF LW_VALID <> 'X'.
    This PO line item is not valid
          CLEAR W_ACCT_CHANGED.
          EXIT.
        ENDIF.
        CLEAR LW_ITEM.
        CALL METHOD ITEM_INTERFACE-ITEM->GET_DATA
          RECEIVING
            RE_DATA = LW_ITEM.
    Get the account interface
        REFRESH ITAB_ACCT.
        CALL METHOD ITEM_INTERFACE-ITEM->GET_ACCOUNTINGS
          RECEIVING
            RE_ACCOUNTINGS = ITAB_ACCT.
        LOOP AT ITAB_ACCT INTO ACCT_INTERFACE.
          CLEAR LW_ACCT.
    Get the newly updated PO item data
          CALL METHOD ACCT_INTERFACE-ACCOUNTING->GET_DATA
            RECEIVING
              RE_DATA = LW_ACCT.
          CLEAR LW_POSTED_ACCT.
    Get the posted PO item data
          CALL METHOD ACCT_INTERFACE-ACCOUNTING->GET_PERSISTENT_DATA
            IMPORTING
              EX_DATA = LW_POSTED_ACCT
            EXCEPTIONS
              NO_DATA = 1.
          IF SY-SUBRC > 0.
            CLEAR LW_POSTED_ACCT.
          ENDIF.
          IF LW_ACCT-LOEKZ <> LW_POSTED_ACCT-LOEKZ OR
             LW_ACCT-KOSTL <> LW_POSTED_ACCT-KOSTL OR
             LW_ACCT-PRCTR <> LW_POSTED_ACCT-PRCTR OR
             LW_ACCT-PS_PSP_PNR <> LW_POSTED_ACCT-PS_PSP_PNR.
    Account assignment was changed
    We will force this PO to go through workflow
            W_ACCT_CHANGED = 'Y'.
          ENDIF.
        ENDLOOP.
      ENDLOOP.

  • Badi:BADI_SD_SALES(SAP says it is for internal use): But i was implemented

    Hi Experts,
    Badi:BADI_SD_SALES(SAP says it is for internal use): But i was implemented this badi. It is legal or not.
      I was implemented badi: BADI_SD_SALES . But it is for SAP internal use.
    For implementing this  i was changed the field u2018internalu2019  in Standard table: SXS_ATTR.
    I removed the X in that field.
    All these things done for  Creating Return order with reference to invoice. The client requirement is to was external number range instead of internal number rangees.
    For this thing I was implement the method t u2018TRANSACTION_INITu2019. I passed the
    Our external number in that vbak-vbeln..
    It works correctly in development. I am not yet tested in quality and production.
    This way is correct one  or not. When I removed the u2018Xu2019(Internal use) in field:
    SXS_ATTR. In future it gives any other problems or it is legally correct or not.
    Helpful answers definitely rewarded.
    Regards
    Pratap.M

    Hello Pratap
    Labelling this BAdI as "Internal Use only" SAP can do whatever they want with this BAdI - they may even remove it !!!
    Thus, your development relies on something very unreliable.
    Perhaps SAP releases this BAdI for general use in the future - or not.
    Therefore, I would recommend to use the enhancement framework instead if already available in your SAP system.
    Final remark: If you set your implementation of this internal BAdI productive and the customer runs into trouble later on when SAP changes or deletes this BAdI with support packages YOU are liable - and not SAP.
    Regards
      Uwe

  • Incorrect vendor line splitting using BADI MRM_WT_SPLIT_UPDATE. BADI.

    Hi, gurus !
    Custom MIRO vendor line item splitting implemented throw BADI MRM_WT_SPLIT_UPDATE. BADI is active and called.
    At transaction MIRO we try to imitate invoice posting. I see, that at badi method te_rbvs table is updated correctly. At invoice posting imitation screen incorrect amounts for vendor splitted lines appear.
    At badi call start
    I_RBKPV-H_RBVS
    1               0000     000001     963.99
    TE_RBVS[]
    Initial
    TI_DRSEG
    1     ST          8000     607.02
    2     ST          8000     172.64
    3     ST          8000     49.18
    4     ST          8000     16.02
    5     ST          8000     119.13
    At badi call end
    I_RBKPV-H_RBVS
    1               0000     000001     963.99
    TE_RBVS[]
    1               0000     000001     607.02
    2               0000     000007     172.64
    3               0000     000008     49.18
    4               0000     000009     16.02
    5               0000     000010     119.13
    At imitation screen items appear as follows:
    1     K                    C          607,02-     LTL
    2     S     G          607,02      LTL
    3     S     G          172,64      LTL
    4     S     G          49,18      LTL
    5     S     G          16,02      LTL
    6     S     G          119,13      LTL
    7     K                    C          607,02-     LTL
    8     K                    C          607,02-     LTL
    9     K                    C          607,02-     LTL
    10     K                    C          1.464,09      LTL
    7-10 lines are incorrect.
    Thanks in advance.
    Edited by: Gabtia on Aug 7, 2009 4:00 PM

    Had anyone used BADI MRM_WT_SPLIT_UPDATE succesfuly ?

  • USING BADI TO ADD A TAB IN PURCHASE ORDER

    FRIENDS,
    CAN ANYONE SEND ME THE DOCUMENT OR WHOLE PROCEDURE FOR ADD EXTRA TAB AND FIELD IN PURCHASE ORDER  USING BADI.I AM DOING THIS FIRST TIME, SO IF SOME ONE HAVE WHOLE DOCUMENT FOR THIS , PLEASE SEND ME OR ELSE SUGGEST ME THE SOLUTION.

    Hi ,
    Please find these two BADi's which will be useful to you.
    ME_GUI_PO_CUST and MEGUI_LAYOUT
    <b>Reward points</b>
    Regards

  • Merge PR (same sales order) and Create PO using BADI

    Hi,
    How to merge PR (of same sales order) and create PO using Tcode ME59n.
    Is this possible using BADI?
    pls reply.
    A Rahim.

    Hello Deepak
    This kind of issue is probably related to your rescheduling settings. The PO is probably excluded from the rescheduling settings on customizing or it is outside the rescheduling horizon.
    Please take a look on the following WIKI that explains the rescheduling and the related settings in detail:
    What is rescheduling and how does it work - ERP Manufacturing (PP) - SCN Wiki
    BR
    Caetano

  • I'm asked to deselect the GR indicator for ZNPP purchase orders using BADI.

    Hi Experts,
    I'm asked to deselect the GR indicator against ZNPP purchase orders created from SRM using BADIs
    BAdI BBP_CREATE_BE_PO_NEW ,BBP_CREATE_BE_RQ_NEW  and FILL_PO_INTERFACE1  and FILL_RQ_INTERFACE  methods respectively.
    Can you please give me idea what I can do with this..
    Im unable to find the field name(WEPOS) for GR indicator.
    Please help me out..today is the deadline for me.

    These BADI's are in SRM not in ECC. Check the interface parameters of those badi methods. you will find some option to pass. if not you have to do it in ECC only.

  • Multiple use Badi implementation

    Dear Experts,
    I have created a custom BADI definition of multiple use type and one implementation for it n it is working fine but now i want to create multiple implementations for it.
    But when im trying to use method of second implementation in my program its raising an error that this method is not defined.
    Hope u understand my query.Plz explain me with an example that how to implement multiple use BADI's.
    Thanx in advance.

    Hi,
    You can implement several BADIs based on the same definition if FILTER option or MULTIPLE USE option are active.
    In this way you can have (implement) the same method does different actions according to the BADI where it's defined.
    So you can use the FILTER to decide which method (BADI) has to work.
    If the FILTER isn't active a definition of a BADI can use once, so it can implement only ones.
    But if the flag MULTIPLY USE is active it can use the same BADI for several implematations.
    In this case every BADIs'll works because there isn't a filter.
    So you can implement several actions.
    See this Weblogs,
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    See here:
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/cs/user/view/cs_msg/9494
    http://www.sapgenie.com/publications/saptips/022006%20-%20Zaidi%20BADI.pdf
    Regards,
    Padmam.

  • Creating an Order and Notification Together in IW31 using BADI

    Dear Experts,
    How to create Notification while Creating Order in IW31 using BADI.
    or
    Userexit to stop creation of Notification based on condition in IW31.
    Regards,
    Ramesh.T

    This you should be able to achieve through userExit IWO10009 (Checks on Order Save). You can write BDC coding for notification creation and put your conditions.
    KJogeswaraRao

Maybe you are looking for

  • Question on Using Persistence Object

    Hi, I want to store a hashtable of persistent info with about five attributes (id, name, username, date) in order to not always call the database. I am either going to use session or request objects. My question is if it's a good idea to store the ha

  • Manually adding oratab entry

    DB Version:11.1.0.6.0 OS : AIX This is related to threadi had started earlier. Create a second database from an existing ORACLE_HOME I'll just give you a background: We have a database running for an OLTP test environment. We needed to create another

  • Installing RHEL with Bootcamp on MacBook Pro MacBookPro4,1?

    I have a one year old Mac Book Pro that I am trying to get RHEL 5.4 installed on via bootcamp. No matter what I do I can't get the installer to boot. I have tried multiple DVD's and even verified the install works on a new Mac Book Pro. Most of the t

  • Built-in moderation facility in community site collection

    hi,  Would like to know what are the Built-in moderation facility features available in community site collection template and its subsites. help is appreciated

  • Trouble installing PSE 10

    Hello forum members, I own PSE 10 on discs and recently got a new MacBook Air, and tried to install twice.  Install failed with the following listing of errors: Exit Code: 7 -------------------------------------- Summary -----------------------------