Maintenance view event for validation when changing data

Hi All,
I have a maintenance view on a table that should validate some fields during user input.
I am using event 05 'Creating a new entry' to validate fields when user creates new entry in the table. That works fine.
I would like to have the same validations happening when the user changes fields of records already existing in the database. I tried to use event 01 'Before saving the data in the database' but the problem with this is that user can change many fields of many records before clicking 'Save'. I would like to have the error raised for incorrect entry already after the change.
So far I could not find an event to do this but only by changing the code itself. The problem with that is whenever the code is regenerated the custom part is lost.
Is there an event I can use that would help me achieve this?
Thanks in advance.

Hi Abhishek,
I tried event 21, I`m playing around with that since that`s the only one triggered when I press Enter.
The problem with this is that
- the check runs when you press enter, so you can still change many fields of many records (one step maintenance) before the validation runs
- you can`t raise an error message, because only the key fields will be input ready, the non-key fields will be readonly
The way I currently handle is I undo the changes in 21 (get previous field values from TOTAL) and raise an information message i/o an error informing user to check the entry.
What I`m looking for is an event that will raise a message and set focus on the incorrect field (if there`s one such).

Similar Messages

  • Maintenance view Events for description in details

    hello i have a maintenance view with 2 screen ( one overview other details ) i want fill a label in the details screen with the description of some code ( custom table with all custom fills )
    but i don't find what event is the right , i try the event 26 , i put a break-point just for check but dont get trigger that event when i display the item in details screen
    Thanks

    thanks i add the form to the event 01 but the breakpoint is not called , i even change the maintenance view i select create modules but don't work , any idea ? maybe i am missing something
    pd: when i create the firts time the form i select create new include

  • Can I use classes and methods for a maintenance view events?

    Hello experts,
    Instead of perform/form, can I instead use classes and methods, etc for a given maintenance view event, lets say for example I want to use event '01' which is before saving records in the database. Help would be greatly appreciated. Thanks a lot guys!

    Hi viraylab,
    1. The architecture provided by maintenance view
       for using EVENTS and our own code inside it -
       It is provided using FORM/PERFORM
       concept only.
    2. At this stage,we cannot use classes.
    3. However, inside the FORM routine,
       we can write what ever we want.
       We can aswell use any abap code, including
       classes and methods.
      (But this classes and methods won't have any
       effect on the EVENT provided by maintenance view)
    regards,
    amit m.

  • Maintenance view program for a table

    Hi All,
    How can i create a maintenance view program for a table. i did maintenance view in sm30 for that table. now it needs a transaction code for maintenance. can somebody help me with this.
    Thanks,
    Kiran

    Hi
    Create a new transaction Z**** linked to SM30 for that table:
    - trx SE93: while creating trx choose transaction with parameter and insert these data:
    - TRANSACTION = SM30
    - set the flag SKIP INITIAL SCREEN
    At the end of screen, section Default Value, if you want to open dialog for updating:
    NAME OF SCREEN FIELD     VALUE
    VIEWNAME                 <here insert the table name>
    UPDATE                    X
    ...for displaying:
    NAME OF SCREEN FIELD     VALUE
    VIEWNAME                 <here insert the table name>
    SHOW                      X
    Max

  • Disable validation when changing showdetailitem in showonetab

    Hello,
    i have a creation page for a table and since the table contains lots of columns i use showdetailitems to limit the size of the displayed page.
    But every time i change of showdetailitem, the validation of the fields is executed and i always get error messages saying that some fields are mandatory and must be set.
    so my question is, how can i disable validation when changing the selected showdetailitem (and still have it when committing) ?
    thanks
    -regards.

    Hello Peter,
    A little correction to Chris' suggestion, it should be:
    <af:inputText value="#{bindings.<your field name>.inputValue}"
                        label="#{bindings.<your field name>.hints.label}"
                        required="#{!bindings.<your iterator name>Iterator.findMode && bindings.<your field name>.hints.mandatory}">
    ...etc...The only difference is the removal of the ? : operator since it isn't required and represents both an additional parsing and processing effort. Go micro-optimization!
    ~ Simon

  • Check Table data in Maintenance View event

    Dear all, i created a maintenance view for a customer table and a must carry out a validation over the whole table when any record is created, modified or deleted.
    The table has a column with percentages and after save a modification I have to verify that the values in this columns make 1 (100%).
    For this, I created a routine in the event 01 (Before Saving the Data in the Database  ) of the maintenance view, but I can find the way to read all the records of the table.
    I tried with the tables TOTAL and EXTRACT, but these have '#####' as values in the percentages column.
    If someone need further information please let me know.
    I´d be grateful if someone lead me to a solution.
    Thanks in advance.
    Mariano.

    Hi, thx Madan Kochana .
    I prefer do not modify the screen.
    The column is defined as dec 3,2 and is filled with values like 0.25 or 0.10 in the view.
    Thanks for your help; i'll appreciate any kind of solution.
    Mariano.

  • How to use the table maintenance events for validating the input entries..?

    Hi,
    I have created a Z table with 6 fields in which all are KEY fields. All are of CHAR type. I have created the Table Maintenance Generator for the same. While maintaining the entries in the table, even though I maintain a blank entry for a field it is saving the entry. But, I don't want that way. All the fields are mandatory in my table. One should enter all the fields. Otherwise it should not allow to save the entry. So, I think it can be done using the Table Maintenance Events. can someone tell me how to use the Table Maintenance Events. and which event to use for my reuqirement and what is the logic to be written.
    Or Is there any other way to solve my problem.
    Please share your inputs. Thanks in advance.
    Best regards,
    paddu.

    In the table maintenance generator, Environment --> Modifications --> Events then a screen will be appear here,we need to create the Events.In the EVENTS screen, press new Entries, there give 01(Before Saving the Data in the Database) and give a name(This will become a PERFORM), then click the Editor pushbutton, this will be there at the right side of the entry, then a popup will be appear, you can create an include program, there inside of the include program write ur code.
    Here is documentation for Event 01(Before Saving the Data in the Database )
    Event 01: Before Saving the Data in the Database
    Use
    This event occurs before new, changed or deleted entries are written to the database. Other activities can be performed, for example:
    hidden entry processing
    fill hidden fields
    flag data to be written to hidden tables after the database change.
    To have the changes saved by the central maintenance dialog routines, SY-SUBRC must be set to 0 at the end of the routine.
    Realization
    This event has no standard routine. The following global data is available for the realization of the user routine:
    internal table TOTAL
    field symbols
    field symbols <ACTION> and <ACTION_TEXT>
    <STATUS>-UPD_FLAG
    If internal table data are to be changed before saving, t he changes should be made in both the internal table TOTAL and in the internal table EXTRACT.
    FORM abc.
    DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
    LOOP AT TOTAL.
    IF <ACTION> = desired constant.
    READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.
    IF SY-SUBRC EQ 0.
    F_INDEX = SY-TABIX.
    ELSE.
    CLEAR F_INDX.
    ENDIF.
    (make desired changes to the line TOTAL)
    MODIFY TOTAL.
    CHECK F_INDX GT 0.
    EXTRACT = TOTAL.
    MODIFY EXTRACT INDEX F_INDX.
    ENDIF.
    ENDLOOP.
    SY-SUBRC = 0.
    ENDFORM.
    Regards,
    Joy.

  • What event tells me when any data changes in a mx:datagrid?

    I have a mx:datagrid that I need to have an event tell me when anything at all changes in the datagrid. The datagrid can be empty and as such may not have a dataprovider (=null) some of the time. I have looked at a variety of events but none seem to do what i want - can anyone suggest what event i should be listening for please?
    many thanks,
    Mark.

    We have not formalized the concept of nested collections in Flex.  However,
    let me amend my recommendation a bit.
    Typically in a nested collection, the objects in the top-level collection
    are not just collections but an object with some other reference data and
    then a collection like:
        public class FamilyTreeItem
            public var name:String;
            public var children:ArrayCollection;
    The top-level collection is listening for propertyChange events.  Typically,
    as a data item gets modified, a propertyChange event is dispatched.  If the
    data items do not dispatch propertyChange events, then the itemUpdated()
    method is used.  Either way, the result is a COLLECTION_CHANGE event from
    the top-level collection.
    When you have a nested ArrayCollection, while that sub-ArrayCollection is
    dispatching COLLECTION_CHANGE, nobody is listening for it at the top-level.
    You can dispatch it yourself, or you can call itemUpdated() on the top-level
    or dispatch a propertyChange.
    The latter will be the most work, but most general.  Code in FamilyTreeItem
    would attach a listener to the collection for COLLECTION_CHANGE and then
    dispatch a propertyChange as appropriate.

  • Maintenance view event

    Hi,
    in a maintenance view if i want to control when a record table has been deleted, first i need to
    select the table record and then press save.the question is that inside this event (before save) how can i know that i´ve pressed before the delete button?.
    Best regards.

    Look at the following link
    <a href="http://help.sap.com/saphelp_47x200/helpdata/EN/91/ca9f0ba9d111d1a5690000e82deaaa/frameset.htm">Event Before Save</a>
    There is an example. Pay special attention to the link <b>field symbols <ACTION> and <ACTION_TEXT></b> within the documentation.
    in short when you loop at the internal table TOTAL, <ACTION> and <ACTION_TEXT> are populated with relevant indicators for new, changed and deleted entries.
    Cheers!
    Rishi

  • Problem in using View Object for validation

    Hi,
    I have defined a simple swing form to practice. It has one Entity Object and two View objects. One of these view objects is an updatable VO based on the EO and the other one has a simple "select count(*)" from a table. I defined a method validation on one of the EO attributes to see how can i use the VO for validation. On the other hand i defined the Application Module to use both of my views. As far as i undrestood, when i define a VO for AM, the AM will instantiate it the first time it starts running. Here is the code inside the method validation for FirstName attribute:
    /**Validation method for FirstName
    public boolean validateFirstName(String data) {
    ViewObject vo = getDBTransaction().getRootApplicationModule().findViewObject("CountEmployeeInstance");
    if (vo == null) {
    System.out.println("vo is null");
    else {
    vo.executeQuery();
    if (vo.hasNext()){
    System.out.println("count = " + ((CountEmployeeRowImpl) vo.next()).getCount());
    else {
    System.out.println("vo has no next");
    return true;
    The problem is that vo.executeQuery() does not return any record. In fact the vo.hasNext() returns false and i get the message "vo has no next" on the console. Please pay attention that the VO's sql statement is SELECT COUNT(*) and it always returns a record. I found that if i use vo.closeRowSet() before vo.executeQuery() everything works fine.
    Please tell me that what is my problem and why is it working like this?
    Best Regards,
    Alireza Vali

    Chris,
    1- Every thing is fine with the ADF model layer in this practice. I have tested it by using Test option on AM and it works. It works exactly the same as how it works throug swing UI that i use for it.
    2- The VO is beeing found and as you see in the code, i have tested it by "if (vo == null)" just after the statement which finds it and vo is not null which means it has been instantiated by AM as it was supposed to.
    3- The VO's SQL statement is "SELECT COUNT(*) FROM EMPLOYEE" with no where clause. I have 14 records in this table.
    Every thing is OK with swing form. It runs and shows the records and all the binded operations like "next record", "previous record" and so on work perfectly on the records.
    4- The code i used is a combination of two examples. Example 9-7 and 9-8 in pages 9-12 and 9-13 of mentioned document.
    Now my findings:
    I changed the code to the following:
        /**Validation method for FirstName
        public boolean validateFirstName(String  data) {
            ViewObject vo = getDBTransaction().getRootApplicationModule().findViewObject("MaxEmployeeIdInstance");
            if (vo == null) {
                System.out.println("vo is null");
            else {
                //vo.closeRowSet();
                vo.executeQuery();
                System.out.println("Row Count = " + vo.getRowCount());
                System.out.println("Default Slot = " + vo.getCurrentRowSlot());
                vo.next();
                System.out.println("Slot after next() = " + vo.getCurrentRowSlot());
                vo.reset();
                System.out.println("Slot after reset() = " + vo.getCurrentRowSlot());
                vo.first();
                System.out.println("Slot after first() = " + vo.getCurrentRowSlot());
                vo.last();
                System.out.println("Slot after last() = " + vo.getCurrentRowSlot());
                System.out.println("----------------------");
                vo.executeQuery();
                System.out.println("Deafault index = " + vo.getCurrentRowIndex());
                vo.next();
                System.out.println("Index after next() = " + vo.getCurrentRowIndex());
                vo.reset();
                System.out.println("Index after reset() = " + vo.getCurrentRowIndex());
                vo.first();
                System.out.println("Index after first() = " + vo.getCurrentRowIndex());
                vo.last();
                System.out.println("Index after last() = " + vo.getCurrentRowIndex());
                System.out.println("Slot Before First = " + vo.SLOT_BEFORE_FIRST);
                System.out.println("Slot Beyound Last = " + vo.SLOT_BEYOND_LAST);
            return true;
        }Here are the results :
    Row Count = 1
    Default Slot = 0
    Slot after next() = 3
    Slot after reset() = 0
    Slot after first() = 0
    Slot after last() = 0
    Deafault index = 0
    Index after next() = -1
    Index after reset() = 0
    Index after first() = 0
    Index after last() = 0
    Slot Before First = 2
    Slot Beyound Last = 3
    As you see, after the execution of the statement "vo.executeQuery()" the The RowIterrator pointer is not pointing to the slot before the first record but it is pointing to the first record itself. And that is why the statement "if (vo.hasNext()" returns false because we just have one record and RowIterrator Index is standing on that record and there is no next record present. The very important thing is that even reset() method does not set the index to the slot before the first record and it sends it to the first record.
    After that, i took the statemet "vo.closeRowSet()" out of the comment and here are the results:
    Row Count = 1
    Default Slot = 2
    Slot after next() = 0
    Slot after reset() = 2
    Slot after first() = 0
    Slot after last() = 0
    Deafault index = -1
    Index after next() = 0
    Index after reset() = -1
    Index after first() = 0
    Index after last() = 0
    Slot Before First = 2
    Slot Beyond Last = 3
    These are the exact things that we expected from the first. After query execution, the pointer is set to the slot before first record and the reset() method does its defined job which is sending the pointer to the slot before the the first record.
    My Assumptions:
    The Rowset which is created by AM is somehow different from the RowSet which you create in your program. I am absolutely sure that this functionality is not a bug but a design decission. I look at my simple program and see that when it runs, the data is queried and shown on the screen which is all done by AM by instantiating my VO and executing the query on it. AM reasonably must put the RowSet pointer on the first record and not the slot before first record. And i am sure that if i use reset() method on the shown RowSet, the pointer goes to the first record and the data on the screen does not get cleared. Whe we use vo.closeRowSet() and execute the query again, the AM made RowSet is closed and a new one is created and the new RowSet is your's not AM's so it functions as you expect.
    Best Regards,
    Alireza Vali

  • [Solved] ADFBC validation when your data isn't normalized

    Hello -
    I'm working on a ADFBC/JSF app (using JDev 10.1.3.3) where I am developing a JSF page to edit data for a table whose data is denormalized. I'll explain using the EMPLOYEES table in the HR sample schema.
    Change EMPLOYEES to...
    a. Add a column (EMPLOYEES.DEPARTMENT_NAME) that holds the data in DEPARTMENTS.DEPARTMENT_NAME
    b. Remove the foreign key EMP_DEPT_FK which links EMPLOYEES.DEPARTMENT_ID to DEPARTMENTS.DEPARTMENT_ID
    The UI presents a field for EMPLOYEES.DEPARTMENT_ID. It also shows EMPLOYEES.DEPARTMENT_NAME as a read-only field.
    When the user gives a value for EMPLOYEES.DEPARTMENT_ID, the app needs to
    1. Validate the DEPARTMENT_ID using a function in a PL/SQL package
    2. Populate the EMPLOYEES.DEPARTMENT_NAME field. Department name is retrieved using a function in a PL/SQL package that takes the department_id as a parameter.
    3. Assign a NULL value to EMPLOYEES.DEPARTMENT_NAME if the provided DEPARTMENT_ID is NULL.
    I don't have the option of changing the table structure.
    I have an entity object for the EMPLOYEES records. To accomplish #1 I added a method validator on the DEPARTMENT_ID attribute to call the appropriate PL/SQL function using JDBC. My question is - where should #2 and #3 happen?
    - In the same method validator on the attribute for DEPARTMENT_ID?
    - In the setter for the DEPARTMENT_ID after the call to setAttributeInternal?
    - Somewhere else?
    Thanks for reading my question
    -- Scott
    Message was edited by:
    scott.turnquist

    Thanks Frank.
    Here is what I came up with (in case anyone else has a similar question) - it works well so far.
    In EmployeeEntityImpl:
        public boolean validateDepartmentId(Number data) {
            boolean valid = true;
            if (data != null ) {
                try {
                    MyAppModuleImpl mod =
                        (MyAppModuleImpl )getDBTransaction().getRootApplicationModule();
                    valid = mod.validateDepartmentId(data);  //method uses JDBC to call PL/SQL package function, could throw SQLException
                } catch (SQLException se) {
                    log.error("Error while checking Department Id: " + data, se);
                    valid = false;
            return valid;
        public void setDepartmentId(Number value) {
            setAttributeInternal(DEPARTMENTID, value);
            //Propogate changes to redundant DepartmentName field.
            //If we get this far, we will have passed the validation
            //called by setAttributeInternal()
            if (value == null) {
                if (getDepartmentName() != null) {
                    setDepartmentName(null);
            } else {
                MyAppModuleImpl mod =
                    (MyAppModuleImpl) getDBTransaction().getRootApplicationModule();
                try {
                    String deptName = mod.lookupDepartmentNameFromDepartmentId(value);   //method uses JDBC to call PL/SQL package function, could throw SQLExeption
                    if (deptName == null) {
                        log.error("Could not find department name for department id: " +
                                  value);
                        throw new JboException("Invalid department id: " +
                                               value);
                    } else {
                        setDepartmentName(deptName);
                } catch (SQLException se) {
                    log.error("Could not validate department id: " + value, se);
                    throw new JboException("Invalid department id: " + value);
        }

  • Event for Particular PF Change

    Hi Experts,
    I have a Requirement where I have to Trigger the Event "Partner Function Change" on the Change of only 1 Particluar Partner Function. This Event gets triggered when I change any of the available Partner Functions in my Opportunity.
    This is CRM Sales and Marketing related WF. In the BO that I am using, a Standard Event is there for Partner Function Change, but I am unable to find a Solution, where I can trigger this WF based on this Event for a Particular Partner Function.
    Any pointers towards this would be appreciated.
    Regards,
    Kanika

    Hi Experts,
    As per your View, I have created a Z FM to check for my Conditions. It has 1 import and 1 export Parameter.
    in Transcation SWE2, when I try to enter the FM corresponding to
    Receiver Call  - FM <Already there>
    Receiver FM - SWW_WI_CREATE_VIA_EVENT_IBF <already there>
    Check Function Module - ZFM < I entered >
    Receiver Type FM - Blank
    Destination of Receiver - Blank
    These are the Values that are being entered....
    Now the ERROR is :-
    Check FM ZFM : Parameter SENDER not available.
    Please let me know where am I going wrong...
    Regards,
    Kanika

  • Table maintenance view Events

    Hi
    In My Z Table maintenance view i  had implemented a new event 01- Before save. But my table entry's are not getting saved now and also i am not getting any error message.
    Please help me on this.
    Regards,
    Naidu Vecahalapu.

    Hi Naidu,
    In the event code of the table maintenance view, please ensure that the SY-SUBRC is ZERO before exiting the sub-routine. Otherwise your changes (insert, update or delete) won't get updated and also you won't get any error message.
    Regards
    Suresh

  • Lighroom 5.4 Develop View does not update when changing sliders

    Just updated to Lightroom 5.4 (using Adobe CC) on Win8. After going to "develop view" on any photo and changing the exposure or any other slider does not update the main view of the photo. It does however update the thumbnail in the film strip and the second monitor window correctly. I've tried everything I can think of:
    (1) downgrading to LR 5.3 (which used to work)
    (2) forcing 1:1 and standard preview regeneration
    (3) uninstalling the re-installing Lightroom (both 5.3 and 5.4)
    (4) Optimizing catalogue
    (5) Removing the Adobe AppData folder
    (6) Creating a brand new catalogue with zero photos, importing a single photo and trying to change exposure/contrast on that
    None of these result in the develop view of the picture changing when I change the sliders.
    Do you guys have any experience with this?

    The chances of me suspecting monitor color profile causing bugs in LR was very slim. =)
    So were mine, especially when only the view itself doesn't work, but all other stuff works fine. Well, I probably have really not good colour profile, luckly you can change it after the lr is launched - it won't cause the problem untill next restart (at least works for me). And hopefully once my calibrator arrives lr will work ok with its colour profiles..

  • Table for Function modules - Changed date & Changed by.

    Hi Experts,
    Help me to get Function module changed date & changed by.
    For programs we can get the mentained information in TABLE : TADIR.

    Function Modules change history can be retrieved from table TRDIR.
    Function Module stores a program Include in table TRDIR.
    The details of the Function Module can be found in Attributes-->general data tab in the Function Module.
    You need to pass the Include which correponds the FM.
    Hence you can find the Log changes.
    Hope this helps.
    Regards
    Vinayak

Maybe you are looking for

  • What is the best practice for running a long report/query against an active database?

    We are using SQL Server 2012 EE but currently do not have the option to run queries on a R/O mirror though that is my long term goal. I am concerned I may still run into the below issue in that scenario as well since the mirror would also be updating

  • Vibrator not working .....plz help

    I have apple iPhone 4S it's vibrator is not working .... Could any give Me any idea about this problem . I shall be very thnkful

  • Computer is looking for a Temp file when loading my HpPhotosmart Essential.msi

    Windows Installer, Says,  The feature you are trying to use is on a network resource that is unavailable. I have uninstalled and reinstalled the printer but the Essentials program won't load even from the disk. (AppData\Local\Temp\7zS43C7\setup\HPPho

  • Typing tutor software

    If this is in the wrong discussion group, I apologise. I'm looking for a typing tutor for my MacBook Air. I'm a hunt and peck type, and need to learn how to touch type. I write for a living, so it's vital that I master this skill. can anybody make a

  • FS Repository Manager depth limits - crawling problems

    Ciao a tuti. I have some really strange results from my Crawler. Here is the story: After Crawling 50000 for indexing I have around 800 docs where I have the Error Type: crawler. The interesting thing is that these documents have nothing in common &