Events in a maintenance view

Hi,
I am doing some validations in the "Before Save to Database" event of a maintenance view. I am accessing the <viewname>_total table in the event and it works fine.
Now I am using this view in a view cluster. When I maintain the data through view cluster, this event gets triggered but the
<viewname>_total comes empty. What could be the reason for this? Is there any other alternative?
Thanks and regards,
Pankaj
Edited by: Pankaj on May 12, 2008 11:12 AM

Hello Pankaj,
In a View cluster, there are more than one view program being called by a common program. Hence, there is not a single TOTAL or EXTRACT structure for a single view, at any given point of time.
Instead, you can make use of the form routine vcl_set_table_access_for_obj in your event calls, and read the TOTAL and global variables for your current view. The method interface is like -
  PERFORM vcl_set_table_access_for_obj  USING '(name of your view)'
                                     CHANGING lv_error_flag.
You can further define local variables/internal tables of relevant structures to read the data into, and proceed to implement your logic.
More info - [View Cluster Maintenance events|http://help.sap.com/saphelp_47x200/helpdata/en/91/ca9f32a9d111d1a5690000e82deaaa/frameset.htm]
Best Regards,
Rekha

Similar Messages

  • Using an event in table maintenance view to populate a field

    I have a table maintenance view, and I would like to populate one field of the table with derived data. I am trying to do this by coding a routine for one of the events, but so far no luck. I have been able to chege the data in the TOTAL table, but still it does not populate the field on the screen.
    Note this is not for one row as it is entered, but I want all rows of the table displayed to show this field with derived data.
    So the question is: what is the correct event to use, and what is the correct internal table to update? Can I make changes to EXTRACT or TOTAL to do this?
    Kind Regards,
    Tony.

    Hi Rob,
    Sorry for being lazy; I'll close this and off and search :-}
    BR,
    Tony.

  • 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.

  • Event in Maintenance view.

    Hi,
    I need to implement an event for a maintenance view. The maintenance view has a field 'Attribute_type'.There are 7 fixed domain values for this field. The functionality to be achieved is that the user should be able to use 6 values of the domain only once,i,e an error should be thrown if he uses the attribute type again. But the seventh attribute should be allowed to use multiple times.
    This maintenance view is part of the view cluster.
    Could any body please let me know the Event type in maintenance view to be used for this purpose along with similar example implementations available in the system.
    Hope i am clear, if not, please let me know.
    Thanks and regards,
    Sridhar

    [Events in Table Maintenance|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc]
    Also have a look at belwo links:
    http://help.sap.com/saphelp_46c/helpdata/EN/a1/e45217a2f511d1a5630000e82deaaa/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/67/86b109415811d1893d0000e8323c4f/frameset.htm
    I hope it helps.
    Best Regards,
    Vibha
    Please mark all the helpful answers

  • Add fields to maintenance view and update then using events

    Hi experts:
      I've created a table with 4 fields, one of them is userid. Also, there is a maintenance view to add new entries.
      I want to display user name when typing userid using events (1 or 21). I know how to do it if username is one of the fields of the table, but there is a requirement to not store username in the table, just userid.
    My question is: is possible to add a field into the maintenance view and update it using events but not store the value in DB?.
    Thanks in advance for your help.
    Regards,
    Carlos.

    In the save event just clear the entries of the field(user name) in the internal table.

  • 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).

  • 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

  • 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

  • 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

  • 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.

  • Events in maintenance view

    I was trying to put some checks through event in maintenance view.
    It is working while creating a new entry. But in case an exisiting entry is being modified it is not working.
    Pls help.

    Hi,
    One important thing is that to have the changes saved by the central maintenance dialog routines, SY-SUBRC must be set to 0 at the end of the routine.
    Pls check the following code.
    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.
    Pravat.

  • Hiding a Maintenance View in a View Cluster

    Hello ABAP Experts,
    We have a scenario where we would like to hide a maintenance view to an existing view cluster based on condition.
    Is it possible via events of a view cluster, where i can hide the view at runtime based on some condition before the view cluster is displayed ?
    Is there any way as well, which help achieve this hiding of views ?
    For example in the below View Cluster, i would like to hide "Define object links" view from the main view cluster "Define document Types".
    Thanks,
    Naresh

    Hi Naresh,
    Yes, you can do it in events of a view cluster, define a subroutine and bounding it to event(02) in SE54,
    when you define the subroutine, it will ask you creat a mian program, in this main program, you need  'INCLUDE lsvcmcod'.
    Then you can access some standard data, http://help.sap.com/saphelp_nw04/helpdata/en/62/c302c7de8e11d1a5960000e82deaaa/frameset.htm
    INCLUDE lsvcmcod.
    FORM yourSubroutineName.
    DATA: viewname TYPE vclstruc-object,
            error_flag TYPE vcl_flag_type,
      viewname = 'ZTEST_VIEW1'.
    *  PERFORM vcl_set_table_access_for_obj USING    viewname
    *                                       CHANGING error_flag.
      ----> according your condition to change the view.
    IF xxx = yyy.
      DELETE vcl_struc_tab WHERE object = viewname.
    ENDIF.
    ENDFORM.
    regards,
    Archer

  • Add button to a maintenance view

    I am working with maintenance views and user-defined events in maintenance views at the moment.
    Now I'd like to add a button to the maintenance view that will show a popup with recent changes to the selected line of the database table.
    Is that possible with user-defined events or should I modify the generated dynpros manually. But then, will the modifications be deleted if I will have to regenerate the maintenance view in the future (e.g. when I might add a field to the database table)?

    If you are talking SE54 and Maintenance Views, when I do an SM30 on the Maintenance View and do SYSTEM->STATUS, I see GUI STATUS ZULG on program SAPLSVIM.  If you look at that status, I see two buttons with dynamic text.  The first one is call GPRF and has dynamic text VIM_PR_STAT_TXT_CH.  You can find a suitable PBO event to set the text of that function code and if that works, find a suitable PAI event to respond to that function.
    I recall finding some documentation on customizing the GUI STATUS but no luck today trying to find it.
    Let us know how it goes.

  • Disable delete button in a maintenance view

    Hi,
    Does anyone knows how can I disable the delete button in a maintenance view so when a user that is not authorized can´t delete any row, or how can I lock the delete subroutine.
    Thanks!

    Hello Moises
    The problem with this solution is that if you ever need to modify your maintenance view (i.e. regenerate the dynpros because you may want to add new fields) your coding is gone.
    This is not the case if you are using event 19. Below you see same sample coding:
    ***INCLUDE LZUS_SDN_MAINTF01 .  " Function Group with maintenance views
    * Event 19: After Init. Global Variables, Field Symbols, etc.
    * http://help.sap.com/saphelp_nw2004s/helpdata/en/91/ca9f44a9d111d1a5690000e82deaaa/content.htm
    FORM exclude_gui_function.
    * define local data
      DATA: ls_excl   TYPE vimexclfun.
      ls_excl-function = 'DELE'.  " taken from standard GUI-status 'ZULG'
    BREAK-POINT.
      AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
               ID 'BUKRS' FIELD '1000'
               ID 'ACTVT' FIELD '02'.
      IF ( syst-subrc NE 0 ).
        APPEND ls_excl TO excl_cua_funct.
      ENDIF.
      APPEND ls_excl TO excl_cua_funct.  " Just for the purpose of demonstration
    ENDFORM.                    "exclude_gui_function
    Regards
      Uwe

  • Aotu numbering in table maintenance view

    Hi experts,
    Can anybody help me in auto genereating serial number in table maintenance view. I have created table maintanance view for a z table for which first field is serial no. The requirement is this serial number should be auto genereted. increment by 1. I have writeen the code for the same in PAI event, but it getting incremented by number of rows. e.g for secind row counter is incremented by +2. for thrid row it is +3 and so on....
    plz help to achieve consistency .
    Thnks n regards,
    Ashmita Singh

    What happens if the user deletes a recird from the table?
    Suhas,
    Happy New Year
    Disable delete function and provide a deletion indicator. This should be fine right.
    The problem would be when the maintenance dialog is regenerated.
    @OP - So as suggesgted use events.
    Similar threads were discussed before many times. May be you culd search it once.

Maybe you are looking for

  • Disk utility won't image a music cd

    i used to be able to do this. disk utility has the option of disk image from device is greyed out when i insert any audio cd. this is the same no matter which user logs into the computer or on my other mac -ibook. i am able to image any data disk or

  • Asset Accounting  and GL not in sync

    Hi  Gurus I have created a Transaction type 110 copy and limit it local ledger. I posted an acquisition with the custom transaction code and it worked fine. I have used  used AS01 and created an asset with value 100.It is fine and it is showing in al

  • Attaching text to face of Box

    Could someone explain the steps involved in adding text to a face of the geometry.Box class Thanks

  • IPad 2 can't reliably stay connected to the left USB port on my MBP

    I was upgrading my iPad 2 to iOS 8 before (succeeded) and first wanted to do a complete encrypted backup to my MacBook Pro. But when I connected it to my left USB port it wouldn't stay reliably connected. It kept on disconnecting and I couldn't backu

  • Misleading Phone Reps

    Hi all, Yesterday I received my new iPhone5. Before activating or unboxing it I called in to phone support to ask some questions. Because, I'm thinking of switching to AT&T one of the reasons being that I can talk and browse data at the same time wit