Update BUPA fields before save

Hi,
I need to update certain CI fields on BUT000 according to specific business logic before the Business Partner is saved.
I tried using the BADIs - PARTNER_UPDATE, BUPA_GENERAL_UPDATE and BUPA_GENERAL_EXPORT but was unable to save the changes inspite of using function modules such as BUP_MEMORY_BUT100_FILL to make changes to the buffer.
Any help would be appreciated.
Thanks,
Rohini.

Hi Rohini,
Use the PARTNER_UPDATE badi along with the function module BUPA_CENTRAL_CI_CHANGE.
1. Write the code in the CHANGE_BEFORE_UPDATE method.
2. To get the partner guid from memory use the function module BUP_MEMORY_BUT000_GET and pass the partner number to it.
3. After getting the partner guid, populate the custom fields in the function module BUPA_CENTRAL_CI_CHANGE and pass the partner GUID to the same.
4. Call BAPI_TRANSACTION_COMMIT to commit the work done by BAPI.
It should solve your problem.
Refer the code below for your ref :
*   Get the Partner GUID from Buffer
      CALL FUNCTION 'BUP_MEMORY_BUT000_GET'
        EXPORTING
          iv_partner      = gv_customer
        IMPORTING
          es_but000       = wa_but000
        EXCEPTIONS
          not_found       = 1
          parameter_error = 2
          OTHERS          = 3.
      IF sy-subrc = 0.
        lv_customer_guid = wa_but000-partner_guid.
*       Populate the Company Charity Number to the structure to be
*       passed to the bapi
        ls_bus000_eew1-partnr_guid     = lv_customer_guid.
        ls_bus000_eew1-zzreg_num0001   = gs_bp_org-company_charity_no.
        ls_bus000_eew1_x-partnr_guid   = lv_customer_guid.
        ls_bus000_eew1_x-zzreg_num0001 = gc_x.
*       Function module to populate the enhanced fields
        CALL FUNCTION 'BUPA_CENTRAL_CI_CHANGE'
          EXPORTING
            is_bus000_eew   = ls_bus000_eew1
            is_bus000_eew_x = ls_bus000_eew1_x
            iv_xsave        = 'X'
          IMPORTING
            et_return       = lit_busreturn1.
<b>Reward points if it helps.</b>

Similar Messages

  • Updating required fields before submit

    Hi all!
    There's a form containing selectOneChoice component with required set to true. There are regular submit button and a button with immidiate and autosubmit both set to true. I expect the second button to update form fields, avoiding validation on selectOneChoice component, but even with immidiate - it still occurs. Form has a partial trigger (the second (immidiate) button).
    Please, help!

    It should get updated there should be some other problem, please check. Immediate property on input fields increases its priority for validation.
    From your initial post, your requirement seems to avoid validation for select one choice and process method, if that is the case, you should not set immediate property on select one choice but on button
    Sireesha

  • How to validate required fields before executing menu item ("Save As") using cutom Javascript?

    Hi,
    Sorry, I am new to PDF Development. I tried creating PDF using Acrobat XI Pro. During creation, I have encountered issues in running custom JavaScript. The requirement is to validate all the required fields before saving the PDF. I tried using the following scripts to validate the said required fields. But, it's not working.
    Option 1: If the field is null, a message box will appear.
    if(this.getfield("textbox") = null){
    app.alert("required");
    else {app.execMenuItem("SaveAs");}
    Option 2: If the field is required, a message box will appear.
    var f = this.getField("textbox");
    f.required = true;
    if(f = true)
    app.alert('required');
    else
    app.execMenuItem("SaveAs");
    The scripts mentioned above are not working. I wanted to validate the required fields before saving the PDF.
    In addition, I tried validating each field using the following script:
    f = getField(event.target.name)
    if (f.value.length == 0)
        f.setFocus()
        //Optional Message - Comment out the next line to remove
        app.alert("This field is required. Please enter a value.")
    When I open the PDF, the script is working. However, when the message box pops out, the "OK" button is not working as expected. The message box is not closing. I tried opening the form in a site in different Java versions (like 7-11 and 7-67). It's working in version 7-67. I tried upgrading the Java version from 7-11 to 7-67. Still, it doesn't work.
    I would appreciate your feedback on this matter.

    If you set the fields as required, then when the user hits the print button you could run this script:
    var txt = form1.execValidate();
    if (txt == true){
    print command
    This code assumes that the root node of your form is form1. Also ensure you put a message into the Empty Message parameter for each field that you want to mark s required.

  • CSV upload and update table fields

    Hi,
    Is there any way to update any field of the underlying table from HTMLDB while importing the CSV file?For e.g, if there are XYZ table have 200 ermployee where empno is primary key.
    Once we upload the data from CSV its fine.Now after 2 weeks i need to update the sal and ename corresponding to the previous 100 employees only.So now when i trying to update the data a unique constraints violation occurs since the empno have already present so my concern is that -- how to get out of this problem specially when updation of huge no. of records needed and also no updation required for some records already present?Do the CSV update be helpful on that circumstances?
    One thing we can do that we can track down the list of 100 employee whose information going to be updated.Put those info in excel and add rest 100 emplyee to that excel and again doing the CSV upload ?
    This is a huge issue and not only the tedious task but also errorprone and that task will be increased with the amount of data increasing in the table.
    Please anyone can suggest ?
    Regards,
    ROSY.

    The best way to solve your problem is next way.
    1º) Save the file with the data to import like a BLOV ITEM.
    Ok it can be done. CSV placed on BLOB data field.2º) Make a procedure to manage this BLOV item that can be fired by user pushing a buttom. (you can do it easy from HTMLDB).
    how to manage ? What need to be fire to push the CSV to the target table with the actual field population ?3º) Into this procedure insert the records freely and dont worry for anything more. (maybe you can be worry about duplicate records is so, only, into this same procedure make any pl/sql lines to be sure record is not duplicate before insert)
    ? ? ? If the data already exist it should be needed to truncate before insert that is not my reqr rather the existing data should be updated based on PK if any chages occurs in the CSV fo that data.4º) after you are sure the insert work properly and if you need any other treatment to record, with a trigger in the table or calling any other procedure from the same trigger make the traeataments that you need.
    that can be done highly .......before insert trigger.Remember. Dont put any commit.
    sure.......5º) Go down from horse. Dont take coffe or Tea in exceed. And remember all we are the same, people that only want go to eat with childs in week-end.
    i m in land no way to go down........nothing i take ya eat & eat much ....but this is not the right place for making comments about Weekend....Regards and good luck.
    anyway embargo starts...........enjoy Cheers...........Wish u All Hp XMas...

  • User exit for XD01/XD02 to update KNA1 field

    Hi
    I have added a custom field using append structure in KNA1
    I need to update it during the XD01 or XD02 transaction before it is saved
    I am searching for BADIs and user exits but I am not able to update anything in KNA1
    kindly help if u were having similar requirement
    thanks
    b

    Hi Max,
    I have tried all of the following
    BADI for XD01
    CUSTOMER_ADD_DATA
    BADI_LAYER
    CUSTOMER_ADDRSCR_CHG
    GOS_SRV_SELECT
    ADDRESS_SUBSCREEN
    save button:
    ADDRESS_CHECK
    ADDR_TXJCD_CHECK
    ADDRESS_UPDATE
    exits
    EXIT_SAPMF02D_001.
    BTEs
    00001320
    00001321
    00001330
    00001340
    00001350
    00001360
    but nowhere I have found an interface for updating KNA1 fields.
    I am not able to use CUSTOMER_ADD_DATA_CS and CUSTOMER_ADD_DATA_BI . I checked it using CL_EXITHANDLER
    is there any way i can store the information I need . I just need one field against the customer number
    thanks
    b

  • Check for required fields before locking subforms and submitting

    Hello,
    I have a 5-page form with many questions, to be completed by the original requestor and multiple approvers.  What I'm trying to do is have the original requestor's Submit button on p. 3 lock the input on the first three pages, but first check if all those fields have some content.  I currently have all the fields on pp. 1-3 set to "Required" in the object properties, but my script still locks them when there's is one empty one.  Here's what I have:
    //Lock portions of form
    Page1.access = "readOnly"
    Page2.access = "readOnly"
    Page3.access = "readOnly"
    //Save document, allow user to change name
    app.execMenuItem("SaveAs");
    //Submit via e-mail
    Submit_REAL.event__click.submit.target = "mailto:[email protected]" +
    "?subject=Subject text" +
    "&body=Message";
    Submit_REAL.execEvent("click");
    The automatic check for required fields happens after the pages get locked.  I would like the check to stop the process before it locks the pages.  Is there any way to check all at once that all "Required" fields on those pages have some content before allowing the script to proceed?  I know how to script it to manually check the 50 or so questions on those pages, but I would like to avoid that.  Thanks for any help.

    There are a few problems that I can see from the start. First, your code is going to pick up EVERY node that exists on these pages. Some of those nodes will not have a rawValue, and some will not have an actual name. As an example, you can take your code and create a text field to dump all of the names of the nodes that you get when you pull in all of the nodes this way. Here's an example:
    The result:
    Now, the question is, do you have a consistent naming convention for your fields that might be empty? That could be text fields, radio button lists, etc. For instance, I always prefix the names of objects in order to more easily keep track of what they are in scripts. Since I'm doing that, I can check the name of the field for tf, nf, rbl, cb, or whatever I have included to make sure that I'm checking an actual field before I check for things like rawValue.
    var nodeName = oNodes.item(nNodeCount).name;
    if (nodeName.indexOf("tf")>-1 || nodeName.indexOf("rbl") > -1 || /*check other field types*/) {
      //insert your code to check for empty answers here
    As for your line 7 issue. The syntax problem is that you've put extra parentheses in your if statement. Take out the parentheses that are just before and after the or "||".
    *This is my fourth attempt to reply. Something was going on with Adobe/Jive earlier, I suppose.

  • Powershell script to update a field value (recursively) in sharepoint form a .CSV file and not changing the updated by value

    need to run through a list of old to new data (.csv) file and change them in a sharepoint list - can not make it work
    here is my base attempt.
    $web = Get-SPWeb site url
    $list = $web.lists["List Name"]
    $item = $list.items.getitembyid(select from the items.csv old)
    $modifiedBy = $item["Editor"]
    #Editor is the internal name of the Modified By column
    $item["old"] = "new from the .csv file parsed by power sehll
    $ite.Syste,Update($false);
    $web.Dispose()

    Hi,
    According to your description, my understanding is that  you want to update SharePoint field value from a CSV file recursively.
    We can import CSV file using the Import-CSV –path command, then update the field value in the foreach loop.
    Here is a code snippet for your reference:
    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
    $csvVariable= Import-CSV -path "http://sp2010.contoso.com/finance/"
    # Destination site collection
    $WebURL = "http://sp2010.contoso.com/sites/Utility/"
    # Destination list name
    $listName = "Inventory"
    #Get the SPWeb object and save it to a variable
    $web = Get-SPWeb -identity $WebURL
    #Get the SPList object to retrieve the list
    $list = $web.Lists[$listName]
    #Get all items in this list and save them to a variable
    $items = $list.items
    #loop through csv file
    foreach($row in $csvVariable)
    #loop through SharePoint list
    foreach($item in $items)
    $item["ID #"]=$row."ID #"
    $item.Update()
    $web.Dispose()
    Here are some detailed articles for your reference:
    http://blogs.technet.com/b/stuffstevesays/archive/2013/06/07/populating-a-sharepoint-list-using-powershell.aspx
    http://social.technet.microsoft.com/wiki/contents/articles/25125.sharepoint-2013-powershell-to-copy-or-update-list-items-across-sharepoint-sites-and-farms.aspx
    Thanks
    Best Regards
    Jerry Guo
    TechNet Community Support

  • Updating linked fields in a persistent class

    Hi all,
    If a field of a persistent class is updated, what is the best way to update a related field?
    Scenario:
    A persistent class with public GET/SET access to a table field STUFF, and public GET access to a field CATEGORY.
    Whenever SET_STUFF is called from the outside, the class should also re-evaluate and update CATEGORY.
    The easiest is to modify the SET_STUFF method to determine the new category and update it if necessary. However GET/SET methods are always overwritten whenever the class is regenerated, which happens all too easily. Can this be done a bit more elegantly?
    Most modifications can be done by redefinitions of the agent class and do not get overwritten each time the class it regenerated. e.g. I have done something similar by redefining the DB access methods to update various fields, but for my current requirement the update needs to be immediate, not during save.
    Any input appreciated,
    MIke
    Edited by: Mike Pokraka on Sep 15, 2009 4:12 PM

    Hi Naimesh,
    >
    Naimesh Patel wrote:
    > Updating the field CATEGORY immediatly would lead to some problems while working with Persistent class because of the COMMIT WORK. As soon as COMMIT WORK after the CATEGORY's "save" hits, all pending save request would execute and may update some fields which you don't want to update at that point of time.
    No COMMITs should be performed, that's part of what I'm trying to accomplish. STUFF may change several times during the lifetime of the process and CATEGORY must change with it. When the application finally does a COMMIT WORK then both are written to the DB. (In fact my real scenario involves both transient and persistent instances and multiple callers).
    My objectives are to have a readonly attribute in the persistent class that changes in response to other fields changing. It should behave as though the app is calling a SET_STUFF and a SET_CATEGORY, but the persistent class must retain control of the CATEGORY field as several applications can modify STUFF.
    My current workaround is an UPDATE_CATEGORY method that must be implemented by each caller, so it works. Layering another class above it an option but is a bit of overkill which also makes it a workaround.
    I have found that EXT_HANDLER_WRITE_ACCESS seems to provide something, but the comments in there seem to indicate I shouldn't modify the object info. Unfortunately I have run out of time to experiment this week so the workaround will have to stay for now, but I'd still be interested in a more elegant solution.
    Thanks for the input,
    MIke

  • How does the Updated by Field Work....

    Hi Experts,
    Can anyone help on how the *Updated By* field values are populated, specially when the values are updated through a Workflow.
    I read the following in the MDM Documentation.
    If trigger action is Record Add, Record Update, or Record Import for a workflow. The [System] is the creator and launcher of the job but is not a real user.
    This is even true if the Owner of the workflow is the Admin.
    After our server migration was done, instead of showing [System] as the Updated By it now shows the Admin.
    What could be the reason for this. Do i need to contact SAP or is there something that needs to be done at the respository level to get the Updated By field to work as expected.
    Regards,
    Aditya.

    Hi Aditya,
    As far as i am concerned, this is not true. Field Updated by type of User Stamp should only show user's which are there in User's table of MDM console under node Admin-->Users. When we don't have any User of repository with name System, there is no point it will show you user System for field Updated by.
    Query 1: Can you please confirm, do you have this User "system" available in your repository under node admin-->Users in MDM console ?
    Query 2: Also, After our server migration was done, instead of showing System as the Updated By it now shows the Admin.
    I seriously have doubt on this. Can you please check do you have really user System for existing records too? I mean you can do Free-form search for field Updated by with value system. I am sure even for existing records (whether in before server migration or in existing) you will not get single record with field updated by "system" . Can you please confirm on this ?
    May be I am wrong, so kindly revert with your findings and confirm above both queries..?
    Regards,
    Mandeep Saini

  • Ideal way to update a field in a table

    Hi All,
    We need to update a field in a table which have some 8 million records.
    The value of the field needs to be updated in all the above mentioned records.
    Now, we have an input file with all the primary key fields and the field to be updated.
    Can any one suggest the ideal way to update the field.
    1.     Updating the database for each record.
    Loop at itab.
    Update…….
    Endloop.
    2.     Updating the database with a set of 100 records.
    We are planning to schedule the job in the background.
    Thanks for your help.
    Regards,
    Krishna

    Hi,
    be very carefull with the update, ´cause you can damage 8 million records !!
    You better use instruction Update for this:
    update mytable set field = value where conditions.
    Try to use all key fields in the conditions and never use something like
    update mytable set: field1 = value1
                        field2 = value2
                        field3 = value3 where conditions.
    The loop in your case 1 is not absolutely necessary, ´cause you update a whole bunch of records at once with the conditions in Update.
    Test the changes in the development system before you do it in production

  • I need Badi for PO Before save.

    Hi Abappers,
    i want Badi name for PO Before save.
    Regards,
    vani.

    Hi,
    To find the badi for a particular transaction goto TCode SE24 and give the class name as CL_EXITHANDLER and then display it. now double-click on GET_INSTANCE you will get some source code , put a break point on class name and give TCode on command field then debug . double click on class name and go on pressing F5, you willl get list of BADI's and according to your requirement choose the right one.
    Second procedure:
    Go to SE84, Enhancements< Business-addin< definition(double click) and give package name of particular transaction then you will get BADI's. Read documentation by going to SE18 or SPRO and choose the right one according to your requirement
    I think ME_PROCESS_PO_CUST may satify your requirement.

  • Update/forced field BSEG-XINVE

    Hello,
    can any of you please let me know, which is the user exit to update BSEG-XINVE ?
    I have need to forced this field, after save in MIGO, MIRO, FB01.
    BSEG-INVE = Indicator that you are dealing with a vendor invoice for capital goods.
    Is there any user exit, any BTE ?
    I wait your answer.
    Send you best regards.
    Thanks.

    You could try FI substitution (check [Creating a Substitution|http://help.sap.com/saphelp_erp60_sp/helpdata/en/5b/d2325b43c611d182b30000e829fbfe/frameset.htm] in  [Validations, Substitutions, and Rules|http://help.sap.com/saphelp_erp60_sp/helpdata/en/27/06e23954d9035de10000000a114084/frameset.htm] or[ search at sdn|http://www.sdn.sap.com/irj/scn/advancedsearch?query=fi+substitution].)
    Also check country definition in OY01. (for "historical" purpose, read [Note 396074 - FB01: Investment indicator not displayed|https://service.sap.com/sap/support/notes/396074])
    Regards,
    Raymond

  • Eliminating Visible Fields on "Save As" Once form is filled out

    Hello,
    Has anyone figured out a way to create a form, that once the recipient has filled out can be "Saved As>NewFileName.pdf", and the newly created PDF does NOT show fields when it's opened?
    For background, i'm trying to create a very basic electronic letterhead that coworkers can fill out as a form, and then "SaveAs" a new PDF to send out to clients. The rub is that once the existing form has been filled out, and resaved with a new filename, it always shows up in Reader with the form fields highlighted, and looks tacky. I'd basically like a way to "eliminate fields" upon "SaveAs"?
    Thanks!

    You can use JavaScript to set fields to read-only. This would have to be done some time before the document is saved obviously. I often use something like a bookmark that when clicked will trigger the code to do this and the document can then be saved. If your coworkers will be using Acrobat, they can flatten certain fields, again using a script. This process converts the field appearances to regular page contents and makes it a bit more difficult for recipients form altering it.

  • Update 2 fields in 1 table

    I need to update an Oracle 8i database. I need to update 2 fields in 1 table with about 2,000 rows of data.
    Right now the date is stored in an Excell file in columns A and B.
    I need Something like:
    Update Table1
    set field1 with value from A:1,
    set field2 with value from B:1
    repeated with A:2,B:2 and so on

    I believe you could use sql loader to get your excel file in but here is a way I cheat to do it.
    I save the excel file as a comma deliminated file (I think it is .csv)
    then I open it up and copy and paste it into the following. (the part that says paste flat file here)
    this is assuming 8i supports model clause I'm unsure on that point.
    create or replace view view_xl_file_to_table as
    select * from
    with t as (select
    --- copy paste your flat file here
    ' Bob,Jones,12345,Employee
      Fred,Thebes,32,Manager
      John,Smith,12,Employee
      Karl,Cane,432,Employee
      George,Johnson,54,Manager
      ' flat_text_file from dual
    select flat_text_file text_file_turned_into_row,
            substr(flat_text_file, 1, instr(flat_text_file,',',1,1)-1) col1, -- get text up to the first comma
            substr(flat_text_file, instr(flat_text_file,',',1,1)+1, instr(flat_text_file,',',1,2) - instr(flat_text_file,',',1,1)-1  ) col2, --2nd comma
            substr(flat_text_file, instr(flat_text_file,',',1,2)+1, instr(flat_text_file,',',1,3) - instr(flat_text_file,',',1,2)-1  ) col3, --3rd
            substr(flat_text_file, instr(flat_text_file,',',1,3)+1, instr(flat_text_file,',',1,4) - instr(flat_text_file,',',1,3)-1  ) col4,
            substr(flat_text_file, instr(flat_text_file,',',1,4)+1, instr(flat_text_file,',',1,5) - instr(flat_text_file,',',1,4)-1  ) col5,
            substr(flat_text_file, instr(flat_text_file,',',1,5)+1, instr(flat_text_file,',',1,6) - instr(flat_text_file,',',1,5)-1  ) col6,
            substr(flat_text_file, instr(flat_text_file,',',1,6)+1, instr(flat_text_file,',',1,7) - instr(flat_text_file,',',1,6)-1  ) col7
      from t
    -- first turn the carriage return into seperate rows
    model return updated rows
    dimension by (0 d)
    measures (flat_text_file, 0 position_of_return )  -- the position of return is where the next carriage return is
    rules iterate(1000) until position_of_return[iteration_number+1] = 0
    position_of_return[iteration_number + 1] = instr(flat_text_file[0],chr(10),1,iteration_number + 1), -- find the next carriage return
    -- get the text between the previous carriage return and the next and make it a row
    flat_text_file[iteration_number + 1] = replace(substr( flat_text_file[0],
                                                position_of_return[iteration_number],
                                                position_of_return[iteration_number + 1] - position_of_return[iteration_number]
                                               ),chr(10))||',' 
    )now I have a view and I could anything I want with it and I just drop it when I'm done.
    Edited by: pollywog on Apr 19, 2010 7:57 AM

  • DataSource Update mode field

    I need to export data from BW (7.0) to another non-SAP Oracle based DB table. This external DB system has a text file interface that BW must export to that requires an update method field in order to use a delta method. The values required are "I" for input, "U" for update and "D" for delete.
    I was thinking of using a DSO with the 0RECORDMODE field to indicate the delta method. Research tells me that to populate the 0RECORDMODE field I need to add it to the "Record Mode Field" (INVFIELD) in the ROOSFIELD table. How do I do that without editing ROOSFIELD table directly, i.e. is there a transaction to edit like RSA2 Extraction tab, Record Mode Field?
    On a sidenote, has anyone else exported to a non-SAP Oracle DB from BW using a delta update?
    Al

    Hello,
    Not sure why you are going for ROOSFIELD tables.
    Since its a text file interface then you may want to use open hub to store the file imported from DSO to a text file and then use it as source for the oracle system.
    If you use the delta option from the DSO to update to the files then the recordmode field is automatically populated based on kind of change to the records.
    Since the delta will be loaded from the change log of the DSO therefore you need not maintain it manually in a table.You may not get the values which you are looking for like I and U but it will contain before and after image which you can try to use ...may be only after image is required.
    As far as I know nothing needs to be maintained for the table ROOSFIELD.
    Thanks
    Ajeet

Maybe you are looking for

  • No longer receiving emails after iO6 update??

    I did the iO6 update the other day, I had problems straight away with all my messaging shortcuts not working. To resolve that I had to turn off documents and data in iCloud. Now I am no longer getting notified when I have an email. If I go into my ma

  • Reinstalling mountain lion from App Store

    My 2009 MacPro crashed badly, require a complete reinstall (reformat hard drive). It was running MountainLion. I have the Snow Leopard OSX disc, but bought the upgrade online. How can I upgrade the OSX again? Ultimately I want to restore from my Time

  • Oracle10g RAC Cluster Interconnect issues

    Hello Everybody, Just a brief overview as to what i am currently doing. I have installed Oracle10g RAC database on a cluster of two Windows 2000 AS nodes.These two nodes are accessing an external SCSI hard disk.I have used Oracle cluster file system.

  • Upgrade from 4.6C to ECC 6

    Hi All, We are doing an upgrade from 4.6c to ECC 6.0. any relevant documents are invited.Can somebody help me with procedure is highly appreciated Documents can also be send to my mail id <u>[email protected]</u> Tanks aRs Message was edited by:     

  • Automatically sync IMAP account (provider) and LOCAL account (my Mac)

    Hi everybody I've searched a lot but didn't find an answer yet. Maybe someone can give me a hint. I'm looking for a functionality similar to E-Mail favourites in WIndows. The target is to automatically make a copy of some folders in my IMAP account t