BADI - BUPA_GENERAL_UPDATE

Hi,
I am trying to use use the above BADI to set some BUT000 fields on a creation of a business partner in transaction BP.
I am using the function BUPA_GENERAL_CALLBACK to get the general data back from memory in this BADI and this works fine.
What I cannot understand is how to then update this information in the buffer prior to the business partner creation.
I am trying to use BUP_MEMORY_BUT000_FILL to set up the memory with my updated values but this is not working.
There is no decent example of this being used so it is difficult to see what is required as input to influence such a change to occur.
Any ideas ?
Kind regards
Colin.

Hi,
I've always created functions for all events in one function group for each implementation. This way you can experiment by putting break-points in all of them.
If you would like to influence fields before/after user-interaction, use events PBO (process before output) and PAI (process after imput). Everything else comes down to using the events in their respective functions (documentation SAP) and collecting all the information in the memory & the bdoc.
Use functions:
BUPA_NUMBERS_GET
BUP_MEMORY_BUT000_GET (get the structure from memory)
  --> make you changes in structure ls_bus000
BUP_MEMORY_BUT000_FILL (put the table back in memory)
Grtz,
Michael.

Similar Messages

  • Implementing BADI BUPA_GENERAL_UPDATE

    Hi all.
    I'm trying to implement the BADI BUPA_GENERAL_UPDATE in CRM. I'm using the Function Module BUP_BUPA_MEMORY_GET_ALL for getting the data but after make changes how i can set it to the buffer ?

    Maybe i have not been explicit.
    I'm trying to set some information when a BP is being created or modified. I need an user-exit or BADI for using before update where i can fill BU_SORT1 and BU_SORT2 with predefined texts. I was trying with the BADI mentioned before and the function module BUP_BUPA_MEMORY_GET_ALL but how i can put the modified data in memory after make changes ?
    I was trying with the BADI BUPA_UPDATE where the BP is in Data Base but is waiting for a COMMIT, when i call the BAPI_BUPA_CHANGE it is raising an exception.
    Any ideas ? What i need to do ?
    Message was edited by: Armando Rodríguez
    Message was edited by: Armando Rodríguez

  • COMMIT WORK on BADI BUPA_GENERAL_UPDATE

    Hi all,
    We're trying to propagate partner functions from the BP to associated business transactions.
    We're using the instruction commit work in the BUPA_GENERAL_UPDATE. The problem comes when we propagate the partner functions more than once in the BP, because the first time works but the second causes a short dump (only in PC-UI, in SAP GUI it works properly).
    We need to commit to unlock the modified opportunities.
    Anyone knows the adecuate method to commit the work in PC-UI for transaction BP?
    Thanks in advance, any help will be appreciated.
    David

    Hi David,
    My first try would be to issue the COMMIT statement inside a Form (<i>commitroutine</i>)and call this form in as
    PERFORM <i>commitroutine</i> ON COMMIT.
    Let me know if it works.
    Hope it helps.
    Thanks, Debasish

  • BADI to check and update field in transaction BP through WEB UI

    Hi,
    I have this requirement to check certain data from BUT000 and based on this update the Search term field in BUT000.
    I am using Badi BUPA_GENERAL_UPDATE.
    I am also able to retrieve the current value in BUT000 using function module
      CALL FUNCTION 'BUPA_GENERAL_CALLBACK'
        TABLES
          et_but000_old = t_but000_old
          et_but000_new = t_but000_new.
    My requirement is to update a field in BUT000 in memory.
    If I was to use transaction BP in CRM then simply I can modify the value using
    ASSIGN ('(SAPLBUD0)MEM_BUT000[] into <Field_symbol>
    But the issue is that when called through the WEB UI I cannot access this memory.
    Can any one suggest me a Function Module or some method by which I can change the value of BUT000 in memory while saving.
    Awaiting your quick suggestions.
    Regards,
    Taher

    Hi Sidd,
    I figured out another way to do this.
      FIELD-SYMBOLS <fs> TYPE ANY TABLE.
      DATA : ws_bus000_i TYPE bus000___i.
      FIELD-SYMBOLS <fs2> TYPE bus000___i.
      IF sy-tcode = 'BP'.
        ASSIGN ('(SAPLBUD0)MEM_BUT000[]') TO <fs>.
        IF <fs> IS ASSIGNED.
          LOOP AT  <fs> ASSIGNING <fs2>.
            IF <fs2> IS ASSIGNED.
              IF <fs2>-partner_guid = ws_but000-partner_guid.
                <fs2>-bu_sort1 = 'BP'.
              ENDIF.
            ENDIF.
          ENDLOOP.
        ENDIF.
        UNASSIGN : <fs>, <fs2>.
      ELSEIF sy-tcode IS INITIAL.
        ASSIGN ('(SAPLBUD_MEM)gt_but000_mem[]') TO <fs>.
        IF <fs> IS ASSIGNED.
          LOOP AT  <fs> ASSIGNING <fs2>.
            IF <fs2> IS ASSIGNED.
              IF <fs2>-partner_guid = ws_but000-partner_guid.
                <fs2>-bu_sort1 = 'WEB UI'.
              ENDIF.
            ENDIF.
          ENDLOOP.
        ENDIF.
        UNASSIGN : <fs>, <fs2>.
      ENDIF.
    on debugging I could figure out the program containing the data in the memory.
    Before the save I accessed this program and updated the parameter as required.
    Also For transaction BP this program is not available but there is another program so there is an if else based on the sy-tcode.
    I need to check for other BP transactions as well but as of now this seems good.
    Kindly suggest.
    Taher.

  • To get Current Business Partner number In BADi

    Hi All,
    In Tcode BP (for creating Business Partner) i am using BADi  'BUPA_GENERAL_UPDATE'. In this i want get Current Business partner No Assigned for the current Creation process.Suggest me how to get Current Businees Partner no assigned or current creation.
    (Actually in the program wher this BADi is calling there is internal table mem_but000 which has the but000 details incluiding what Business partner number assigned for current creation.Is it possible to get details from this itab in my BADi implementation Method.)

    Hi,..
    U can use field symbols and get the values of the internal table into ur BADI
    FIELD-SYMBOLS: <fs_wa> TYPE table .
    UNASSIGN <fs_wa>.
    ASSIGN ('(program name)mem_but000 ') TO <fs_wa> .
    program name is the name of the program where this internal table mem_but000 is having data..
    U will get all the entries of the internal table in field symbol..
    decalre internal table like mem_but000 and assign the filed symbol data into internal table .
    IF sy-subrc EQ 0.(sy-subrc check for the assign statement)
    t_mem_but000  = <fs_wa>.
    endif.
    regards
    Sheeba

  • Does anyone know BAdI for EEW table in Business Partner Master?

    Dear Experts,
    We added the customer tables like ZBUT0000* in BP by EEWB tool
    and these tables appears in "Customer Data" tab successfuly.
    Now we would like to do the input value check when users create/change the businesss partners in T-cd:BP,
    but could not find any BAdI or customer exit.
    BAdI "BUPA_FURTHER_CHECKS" seems to be good, but this BAdI is called by BAPI and not by T-cd:BP.
    We think BAdI "BUPA_GENERAL_UPDATE" can be used, but we want to run the input value check
    at the timing of pressing ENTER key, not the timing of before-saving.
    Does anyone know which BAdI can be used?
    If any further information is required, please let us know.
    Any advice would be highly appreciated.
    Thanks in advance for your help.
    Regards,
    F.T.

    Hi,
    please use any ways for search Badi's:
    http://abap-explorer.blogspot.com/2008/07/how-to-search-for-badis-click-here.html
    for example:
    Method 3: Using FM SXV_GET_CLIF_BY_NAME.
    These steps should enable you to find any BADI related to any transaction in a matter of minutes.
    1) Go to the transaction SE37 to find your function module.
    2) Locate the function SXV_GET_CLIF_BY_NAME.
    3) Put a BREAK-POINT there.
    Denis

  • Workflow not triggered for BP when start condition's field is set by BADI

    Hi guys,
    I have created a workflow and given the start Event "Changed" of object BUS1006. In this I have given a start condition which triggers this event when a particular field on transaction BP is populated.
    Now the problem is that when I myself explicitly populate the field and press save the workflow is triggered fine, but when I populate that field automatically in a Save BADI (BUPA_GENERAL_UPDATE), the workflow is not triggered. Tcode swel just returns the msg that Start condition returns 'FALSE' for object.
    Can someone please help me in this or let me know where I can find its cause in system.
    Any help would be really appreciated.
    Regards,
    Shaili

    If this is just one field, create your own custom event and code launching it when saving BP with your field changed.
    Maybe event Changed is executed only for changes in GUI.
    If you program your own one you will have 100% control of it.
    Regards
    Radek

  • BDT Events / BADI

    Hi
    I am looking for updating newly added Z fields of BUT000 table to databse.
    I got confused to two different solutions, as BADI and BUPT Events. Anyone suggest which is the right one. I have used BUPT Control- Screens to enable the Z fields under business partner BP. But got stuck in the next step which we need to update the values from screen to database.
    Can anyone throw some inputs on how to use BADI BUPA_GENERAL_UPDATE or BUPA_GENERAL_EXPORT?? or the SAVE Event. Need your valuable inputs.
    Its a bit urgent to me..pls.
    Cheers
    Manohar

    Hi Debasish,
    Thanks a lot for your help.
    Here is my briefing.
    Steps to do update into BUT000 table
    1.     Create a new field group, where it should have the new Z fields like BUT000 (Table) ZSUBSEG(Field name)
    2.     Create a new view with Subscreen details with program name and screen number, Before Output and After Entry function modules.
         Here are the details which go into respective function modules
         Before Output : Use BUP_BUPA_BUT000_GET fm to get the details from database buffer, then assign these data in your screen fields.
         After Entry   : Use BUP_BUPA_BUT000_GET fm to get the details of BUT000 from memory, then assign BUT000-Z1 to the imported structure of BUT000, then pass this strucute to BUP_BUPA_BUT000_COLLECT fm with i_subname as include name or append sturucture name.
         Important point to remember is the FM of PBO, PAI and screen number should be in same function group.
         Assign the above created (step1) field group to this view.
    3.     Create a new section and assign your view create above in step 2.
    4.     Assign the Z fields into BUT000 in BUSB transction.
    If you need any further details pls let me know.
    Regards
    Manohar

  • BADI/BDT Event to Update Zfields into BUT000

    Hi
    I am looking for updating newly added Z fields of BUT000 table to databse.
    I got confused to two different solutions, as BADI and BUPT Events. Anyone suggest which is the right one. I have used BUPT Control- Screens to enable the Z fields under business partner BP. But got stuck in the next step which we need to update the values from screen to database.
    Can anyone throw some inputs on how to use BADI BUPA_GENERAL_UPDATE or BUPA_GENERAL_EXPORT?? or the SAVE Event. Need your valuable inputs.
    Its a bit urgent to me..pls.
    Cheers
    Manohar

    Hi Manohar,
    You had probably created another thread in the ABAP forum for this.
    BDT Events / BADI
    which has been solved.
    Please close this thread.
    Thanks, Debasish

  • Create default sales area data on BP creation using BUPA_GENERAL_UPDATE

    Dear all!
    We have the following requirement: whenever a user creates an organization in WCUI, we need to create some default data for the BP in the background, such as relationships (employee responsible, etc) and sales area data.
    I have created an implementation for BADI BUPA_GENERAL_UPDATE and use it to add the desired data. For relationships, this is working just great, but I´m having trouble with the adding of sales area data, since the system is not properly saving the data. I use the following code:
    * Assign data for sales area
      MOVE: 'O 50000632' TO ls_sales_area-sales_organization,
            '01'   TO ls_sales_area-distribution_channel,
            '01'   TO ls_sales_area-division.
      ls_data-customer_group1 = '330'.
      ls_data-customer_group2 = '003'.
      ls_data-customer_group3 = '002'.
      ls_data-customer_group4 = '006'.
      ls_data-customer_group5 = '021'.
      ls_data-pay_guar_proc   = '0001'.
      CALL FUNCTION 'CRM_BUPA_FRG0010_ADD'
        EXPORTING
          iv_partner_guid = ls_changed_instances
          is_sales_area   = ls_sales_area
          is_data         = ls_data
          iv_x_save       = ' '
        IMPORTING
          et_return       = lt_return
          ev_error        = lv_error.
      CALL FUNCTION 'CRM_BUPA_FRG0010_SAVE_COMMIT'.
    Problem is, that with the call of
      CALL FUNCTION 'CRM_BUPA_FRG0010_SAVE_COMMIT'.
    I get a short dump of type "SYSTEM_ON_COMMIT_INTERRUPTED", but without the call, the sales area data is not saved. I tried the same code in a Z-report (not in a BADI) and it worked just fine.
    Any ideas on how to commit the data so the sales areas will be saved? Helpful answers will be rewarded!!
    Thank you all & Kind regards
    Christoph

    Hi Pratyasha!
    Thanks for your reply. I figured, that by explicitly calling the commit FM, system commit procedures are interrupted.
    The thing is, that just by calling the FM for adding the sales areas does not result in those sales areas acutally created. What I mean is, that after the BAdI is executed, no sales areas are maintained for the newly created customer. All the more funny, since this exact same procedure is working for creating relationships. See following code:
      READ TABLE it_changed_instances INTO ls_changed_instances INDEX 1.
    * Get BP-Number for sy-user
      CALL FUNCTION 'CRM_ISA_IUSER_GET_BP_TO_ALIAS'
        EXPORTING
          username         = sy-uname
        IMPORTING
          business_partner = lv_user_partner.
    * Map GUID to partner number
      CALL FUNCTION 'BUPA_NUMBERS_GET'
        EXPORTING
          iv_partner_guid = ls_changed_instances
        IMPORTING
          ev_partner      = lv_partner
        TABLES
          et_return       = lt_return.
      CLEAR lt_return.
    * Create employee responsible
      CALL FUNCTION 'BUPR_RELATIONSHIP_CREATE'
        EXPORTING
          iv_partner_1_guid = ls_changed_instances
          iv_partner_2      = lv_user_partner
          iv_relationship   = 'BUR011'
          iv_date_from      = sy-datlo
          iv_date_to        = '99991231'
          iv_testrun        = ' '
          iv_x_save         = ' '
          iv_xdfrel         = 'X'
        TABLES
          et_return         = lt_return.
    which is in the same BAdI and acutally results in this relationship beeing created for my newly created customer. Works fine, just not for sales areas.
    I´ll be grateful for any comments on that issue!
    Kind regards
    Christoph

  • Badi/exit to set sales area data template for bp

    Hi gurus,
    When a new bp is created through web ui, I would like to set the sale area template for that bp based on a few criteria. I am running on crm 7.0.
    I tried to call BAPI_BUPA_TEMPLATE_ADD or BUPA_TEMPLATE_ADD at BADI PARTNER_UPDATE, method CHANGE_BEFORE_UPDATE, but it doesn't work. The same code works if i create bp thru sap gui.
    So any idea how to do it for web ui? any exit/badi or bte event that i can use the trigger the logic after bp is created?
    And i notice those FM BUPA_*_ADD doesn't work in BADI PARTNER_UPADTE as well if it is created thru web ui, but work for sap gui. Any idea why?

    Hello
    To my knowledge, BADI PARTNER_UPDATE, method CHANGE_BEFORE_UPDATE  changed will not work in Web UI because WebUI does not access the same memory location, so there is no code here.
    I would try BADI BUPA_GENERAL_UPDATE. Make sure that [SAP Note 1469004|https://service.sap.com/sap/support/notes/1469004] is in place.
    Regards
    Joaquin

  • COMMIT work in BADI

    Hi all,
    Can anyone tell me about, is COMMIT WORK is allowed in BADI or USER EXIT?
    If not, what is the aalternative for that?
    Thanks in advance.
    Best Regards,
    Prasad

    Hi Prasad.
    I would like to suggest a couple of references,
    [SDN - Reference - Call Transaction / Bapi and Commit work in a Update task|Call Transaction / Bapi plus Commit work in a Update task?;
    [SDN - Reference - COMMIT WORK on BADI BUPA_GENERAL_UPDATE|COMMIT WORK on BADI BUPA_GENERAL_UPDATE;
    Hope that's usefull.
    Good Luck & Regards.
    Harsh Dave

  • Set order block for new business partner

    Hi experts,
    I have the requirement to set the order block for a business partner (based on some attributes) at the moment when it will be created or changed.
    I tried to use the BAdI BUPA_GENERAL_UPDATE where I am using the FM CRM_BUPA_FRG0050_READ/ CRM_BUPA_FRG0050_GET_DETAIL to retrieve the already existing status data and the FM CRM_BUPA_FRG0050_CREATE/ CRM_BUPA_FRG0050_CHANGE to add or change this data.
    In the SAPGUI at least the update scenario (CRM_BUPA_FRG0050_CHANGE) is working.
    In the WebUI application none of the both is working: In the create scenario the application is even dumping (SAPSQL_ARRAY_INSERT_DUPREC) but this dump happens in an other implementation of this BAdI!
    In the BP update scenario nothing happens though the UI will be refreshed by some coding like
    lr_bol_core = cl_crm_bol_core=>get_instance( ).
    lr_bol_core->modify( ).
    Is there something wrong or missing or is there a better BAdI to achieve this requirement?
    Thanks for any help!
    Regards,
    Wolfhard
    PS: I found another post which covers exactly my requirements but unfortunately without a solution...
    [Re: Update of BP General Data during creation of BP]

    Hi Bruce,
    I propose to select the right value programmatically and then hide the original combo box (use the FromPane / ToPane properties - better don't disable it or make it invisble) and display a disabled EditText item which displays the pricelist which should be applied to new customers when the Form is switched to - or launched in "Add" mode.
    When the form is switched to other modes than "Add" reactivate the original ComboBox...
    HTH,
    Frank

  • Marketing Attributes alignment from Parent BP to Child BPs

    Hi,
    We have a requirement of updating marketing attributes on child BPs if they are getting changed at the Parent BP.
    For eg If attribute A is getting changed at Parent using transaction BP, system shoudl fetch all its child BPs from BP hierarchy in background and update the value of attribute A there.
    I am thinking of using BADI BUPA_GENERAL_UPDATE
    Please provide me Std FMs to udpate marketing attribute os a BP and the place hwere to write code.
    Please suggest me some othe solutions to realise this requirement.
    Any help is appreciated.
    Regards,
    Pratyasha Shishodia

    Hello together,
    I would like to describe my own problem with updating Marketing Attributes in a Business Partner via a CRM Survey.
    Currently I am working with SAP CRM 7.0 EHP1. The Survey is maintained in SAP Survey Suite in the Application "Marketing".
    Furthermore I am using the following function modules:
    Callback to PBO CRM_MKTBP_SVY_ATTRIBUTE_PBO
    Callback to PAI CRM_MKTBP_SVY_ATTRIBUTE_PAI
    The Marketing Attributes should be updated within a Contact. This contact have assigned the role "Internet User". Behind this role I have defined my CRM User name.
    For testing the Attribute update I have generated an URL with BSP. Afterwards I opened this URL and logged in with my CRM User name. After filling in the survey and submitting no business partner were updated. It seems that the "conversion" from my CRM User to the CRM contact doesn't work. I think there could be a problem with the PBO and PAI modules. Because the functionality "Evaluation" within the Survey Suite shows a number of evaluated questionnaires and answers after submitting my survey.
    So my questions:
    Are the mentioned PBO and PAI modules up to date? (Last change date was in 2005)
    Is the Application "Marketing" within the SAP Survey Suite the correct one?
    I would be glad if anyone could give me tip for my problem. Thanks a lot and best regards,
    Oliver

  • Add Tax IDs to BP on SAVE (new)

    I'm trying with the following code to add a Tax ID to the BP while I'm saving it (New).
    But I don't get the BP ID.
    BUPA_NUMBERS_GET doesn't return BP ID.
    'BBP_BUPA_GET_NUMBER' doesn't return BP ID.
    How can I solve this issue?
    Best regards.
    METHOD if_ex_bupa_tax_update~change_before_update.
      break josechau.
      DATA: lv_partner    TYPE  bu_partner,
            lv_tax_type   TYPE  bus_tax-tax_type,
            lv_tax_number TYPE  bus_tax-tax_number,
            lv_guid       TYPE  bu_partner_guid.
      LOOP AT it_changed_instances INTO lv_guid.
      ENDLOOP.
      CALL FUNCTION 'BUPA_NUMBERS_GET'
       EXPORTING
         iv_partner_guid           = lv_guid
       IMPORTING
         ev_partner                = lv_partner
    *     EV_PARTNER_GUID           =
    *     EV_PARTNER_EXTERNAL       =
    *     ES_BUT000                 =
    *   TABLES
    *     ET_RETURN                 =
    *     ET_PARTNER                =
      CALL FUNCTION 'BBP_BUPA_GET_NUMBER'
       EXPORTING
    *   PARTNER                 =
         partner_guid            = lv_guid
    *   ADDRNUM                 =
       IMPORTING
         ev_partner              = lv_partner
    *   EV_PARTNER_GUID         =
    *   EV_GUID_32              =
       EXCEPTIONS
         partner_not_valid       = 1
         guid_not_valid          = 2
         no_input                = 3
         OTHERS                  = 4
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      MOVE lv_partner TO lv_tax_number.
      MOVE 'CO1' TO lv_tax_type.
      CALL FUNCTION 'BUPA_TAX_ADD'
        EXPORTING
          iv_partner                  = lv_partner
          iv_tax_type                 = lv_tax_type
          iv_tax_number               = lv_tax_number
    * TABLES
    *   CT_RETURN                   =
    EXCEPTIONS
       record_already_exists       = 1
       invalid_data                = 2
       foreign_lock                = 3
       OTHERS                      = 4
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'BUPA_TAX_SAVE_COMMIT'.
    ENDMETHOD.

    Hi,
    Please try using the function module BUPA_GENERAL_CALLBACK - this will surely return data in the structures ET_BUT000_NEW and ET_BUT000_OLD.
    You could get the partner number from etiher of these structures.
    Also, you could use module BUPA_TAX_CALLBACK, which will actually return the tax data that you have changed, and partner number is a field of the tax data structure.
    And one important point - if you want the save of BP to trigger the tax add, you would need to write this particualr code(what you have included in the question) in the implementation of BADI BUPA_GENERAL_UPDATE. Currently, you have written it in the BADI BUPA_TAX_UPDATE, which will get called for changes to TAX number, not for changes to general business partner.
    Regards,
    Rishu.
    Edited by: Rishu Thukral on Apr 16, 2009 8:05 PM

Maybe you are looking for

  • IMac acting up in a variety of ways

    Hi all, my iMac (the latest 27inch model) at work (I work in the post production department of a video production company) has started acting up in a variety ways lately for no apparent reason. I'm at a bit of a loss as to what to do, but here are so

  • To find the Internal Order for a given opportunity

    Hi, Can anyone help me in finding out the internal order number for a list of opportunities? I need to know the tables in which this is getting updated. TIA, sinthu

  • Black spots on printouts.

    We have a Cannon MFC multi color laser printer, we changed the black print cartridge and when we print black/White , the printouts have black spots and other letters in the background. Can anyone please let us know if they had the same issye and what

  • Email PO.  OFT was not a valid font line

    Hi all, I am trying to e-mail a PO.  I set a medium communication to pick when creating the PO.  I am receiving the e-mail with the PO as an attachment.  When trying to open the attachment I got a message saying that the attachment  myform.oft was no

  • Impact of Reason Code change in IT 8

    Hi Expert, I have a question . Current Return To Work process and the reason codes currently being used to return an employee from a leave of absence. Now I copy the prior record and use the reason code from the prior action. What is the impact on Pa