Table maintenance

Hi,
There are two ways to maintain Data records in a table :
1. By program : using insert/delete/modify or update statement.
2. By table maintenance
What is the advantage or disadvantage of one process to another.
Thanks & Regards,
Abhishek Sarkar

Hi,
Table maintenance is used to maintain data in the tables created (ZTABLE)
Generally for inserting new records into custom table thru transaction SM30, we need to enter all the values manually and save the record.
When certain data for the key fields needs to be populated automatically while creating entries, the steps involved are:
Maintaining the subroutine in view V_TVIMF for a particular custom table.
Logic for extracting relevant data for the fields entered, when user press enter button.
Check this blog for more information on extracting data in table maintenance.
/people/sudheer.cheedella/blog/2006/02/20/extracting-data-in-table-maintenance
With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
It can be set in transaction SE11 - Tools - Table maintenance generator.
Table maintenance Generator is used to manually input values using transaction sm30
follow below steps
1) go to se11 check table maintenance check box under attributes tab
2) utilities-table maintenance Generator-> create function group and assign it under
function group input box. Also assign authorization group default &NC& .
3) Select standard recording routine radio in table table maintenance generator to move table
contents to quality and production by assigning it to request.
4) Select maintenance type as single step.
5) maintenance screen as system generated numbers this dialog box appears when you click on create button
6) save and activate table
One step, two step in Table Maintenance Generator
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
SM30 is used for table maintenance(addition or deletion of records),
For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
Sm30 is used to maintain the table ,i.e. to delete ,insert or modify the field values and all..
It creates the maintenance screen for u for the particular table as the maintenance is not allowed for the table..
In the SE11 delivery and maintenance tab, keep the maintenance allowed..
Then come to the SM30 and then enter the table name and press maintain..,
Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
Then create,,,
Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
We use SM30 transaction for entering values into any DB table.
First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
Then it will create a View.
After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
check these links --
http://help.sap.com//saphelp_470/helpdata/EN/a7/5133ac407a11d1893b0000e8323c4f/frameset.htm
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
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_46c/helpdata/en/a7/5133ac407a11d1893b0000e8323c4f/frameset.htm
/message/2831202#2831202 [original link is broken]
Re: Regarding Table Mainantance Generator
Re: table maintenance
table maintenance generator
Re: Table maintenance generator
Regards
Sudheer

Similar Messages

  • How to use table maintenance view in module pool screen

    hi ,
    want to use table maintenance view in a module pool screen so that i can edit, insert, delete and update date in to the ztable.please help.

    You can simply call it via SM30.   Or you can call the table maintence view from any program(report or module pool) using a function module.
      call function 'VIEW_MAINTENANCE_CALL'
           exporting
                action                       = 'U'
                view_name                    = 'Z_Table_Name'
           exceptions
                client_reference             = 1
                foreign_lock                 = 2
                invalid_action               = 3
                no_clientindependent_auth    = 4
                no_database_function         = 5
                no_editor_function           = 6
                no_show_auth                 = 7
                no_tvdir_entry               = 8
                no_upd_auth                  = 9
                only_show_allowed            = 10
                system_failure               = 11
                unknown_field_in_dba_sellist = 12
                view_not_found               = 13
                others                       = 14.
    Regards,
    RIch Heilman

  • Fieldname in not being displayed in the table maintenance

    Hi Experts,
                     I have created a table maintenance for a custom table.The table contains 10 fields out of which first 3 are key fields.
    on the 3rd key field i have supplied F4 help so as to populate the 4th field automatically based on the selection of 3rd field.
    everything is working fine but last 6 'fieldname' is not being displayed on the column bar.instead of fieldname there is '+' sign on the column. And i have checked in layout(screen) also only first four fields being displayed.
    plz help.
    Thanks n Regards,
    Mukesh

    Hello Mukesh,
    As you know, data element or pre-defined data type will be assigned as field type to the fields in a table. If you are assigning the data element, then the data element has the option to give the field label.
    If you are assigning the data element and the field label is empty, then + sign will come. In other case -  if you assigning the pre-defined data type also, the screeen column header will be shown as + sign.
    In both the above cases, you can change the column header manually in the layout.
    Regards,
    Selva K.

  • Open T-code on double click of field in table maintenance

    Hi Gurus,
    I have one scenario, I have to show a transaction on double click event on a field of Table Maintence.
    Please guide me in this .
    Is there is any event in Table Maintenance Events to capture double_click of a field.
    Regards,
    Sowmen

    1. In the field attributes of the particular field there is a chechbox  in display tab which says respond to double click, check that.
    2. Assign the fuction code "PICK" for function code F2 in GUI status.
    3.Now whenver you double click the field function code "PICK" gettes triggeed.
    Now you can wrie yyou code based on this function code.
    CASE sy-comm.
    WHEN 'PICK'.
    *If you want the name of the field and the value in that field use the below code.
    GET CURSOR FIELD gv_field VALUE gv_cursor_value.
    *DO your operation based on the field and the value.
    ENDCASE.
    Regards,
    Smithesh

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

  • How to create event in table maintenance generator

    Hi guys,
    I need to create an event for my table maintenace generator such that when the field land1 is filled, the landx field should take its data from t005t table. and the ladnx field should be display only, it can not be modified in table maintenance.
    How can i create an event in table maint. gen? How am i going to do it?
    thanks always,
    mark

    Hi,
    As mentioned in the last post go to the event screen by
    Environment --> Modifications --> Events.
    There you click on new entries and try writing your logic for event 21 i.e. after selecting 21 give some name of your event and write down the logic how you want to do this.
    If event number 21 does not work then try 1. One of these two should work.
    Hope this helps!!!
    Regards,
    Lalit

  • EVENTS in table maintenance Generator

    Hi, can u people help me while using EVENTS in Table Maintenance Generator. Means how can I perform different task using events.

    Hi,
    Using events in table maintenace generator, you can validate the fields, update the fields etc..There are events(01-New Entry), (02-Before Save); (03-After Save) etc... The respective events trigger on the action performed.
    To create events : Goto table maintenace generator screen->Enviorement->Modifications->Events.
    Select the from the list of events and peform based on ur requirement
    Regards
    Shiva

  • Events in table maintenance generator 01

    Hi all,
           I have an urgent requirement regarding the events in table maintenance generator.The requirement is i have a qty field in table i want to change the existing value it should allow only a lesser value.How to use TOTAL and EXTRACT structures.
    it is urgent.please help me out.
    Thanks & regards,
    Kranthi

    Follow the example below:
    form get_vendor_name.
      data w_extract type z_table.
      data begin of w_total.
              include structure z_table.
      data: action,
            mark,
      end of w_total.
      loop at extract into w_extract.
        check not w_extract-z_vend_no is initial.
        select single name1 from lfa1
                           into  w_extract-z_vend_name
                           where lifnr = w_extract-z_vend_no.
        modify extract from w_extract.
      endloop.
      loop at total into w_total.
        check not w_total-z_vend_no is initial.
        select single name1 from lfa1
                           into  w_total-z_vend_name
                           where lifnr eq w_total-z_vend_no.
        modify total from w_total.
      endloop.
    endform.
    Reward points if useful.
    Regards.

  • Table maintenance events

    Hello,
    Does anyone has a code example of table maintenance events?
    I have a custom table ( zitab ) , with a maintenance view in SM30. I would like to use the table maintenance events for some authorisation check before the data is displayed, then, depending on the authorisation, display what the user is authorised to see. After data input, perform validation, if errors occur, inform the user what the problem is, if not, save in tha z table.
    Can this be done in sm30 or I need to write a new program?
    Thank you!

    Can someone please explain me why I have this short dump (before save event)?
    Error analysis
        The statement
          "MOVE src TO dst"
        requires the operands "dst" and "src" to be comvertible.
        Since this statement occurs in a Unicode program, the special
        convertibility rules for Unicode programs apply. In this case, the
        following rules have been broken:
    Source Code Extract
    Line  SourceCde
        1 ----
        2 ***INCLUDE LYTableF04 .
        3 ----
        4
        5 form before_save.
        6
        7 DATA: l_field_is_blank.
        8   DATA: BEGIN OF s_ytable.
        9           INCLUDE STRUCTURE ytable.
       10           INCLUDE STRUCTURE vimtbflags.
       11   DATA: END OF s_ytable.
       12
       13   LOOP AT total.
       14     CLEAR s_ytable.
    >>>>>     MOVE total TO s_table.
       16
       17   ENDLOOP.
       18
       19 endform.
    In all examples that i read on this forum this code works, I don't know why it fails for me.

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

  • Refresh data in Table Maintenance view

    Hi,
    I have created a table maintenance view for db table A and added my function button to this view. When I click the button I append  a few records to the table A from table B. But this recoreds are not displaied in the view.
    If I rerun the view I can see added records.
    How I have to refresh the view to display added records?
    Regards,
    Ilya

    Hi Jesus,
    COMMIT WORK isn't help me.
    I found that I have to use TOTAL and EXTRACT structures to modify data in maintenance view.
    It's fine. I do something like this in my FM
    MODULE 9CUSTOM_PF_BUTTON INPUT.
    lt_total[] = total[].
    lt_extract[] = extract[].
    CASE function.
          WHEN '9DOWNSH'.
             modify lt_total from wa_total.
             modify lt_extract from wa_extract
    ENDCASE.
    total[]   = lt_total[].
    extract[] = lt_extract[].
    ENDMODULE.                 " 9CUSTOM_PF_BUTTON  INPUT
    But TOTL and EXTRACT tables contain data of  the current maintenance view.
    I work with a view cluster and I have to append or delete records from one view if I do something in other view.
    How I can modify data one view from another maintenance view?
    If I have modified database tables directly I don't see changes in the view cluster.
    Regards,
    Malnor
    Edited by: Malnor on Nov 23, 2010 9:19 AM
    Edited by: Malnor on Nov 23, 2010 9:38 AM

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

  • Problem in Table maintenance view

    Hi all,
    i am getting some problem in table maintenance view.
    In my table i have some fields and when i created my table maintenance view , it is created , but when i try  to see it in SM30 its not showing my fields and even i am unable to create a  new entry. when i click
    new entries its going back to the sm30 screen..
    How to go abt it
    please help me

    Hello,
    Have you created the table maintanence view the right way.
    You can get good help from below link: [[http://www.****************/Tutorials/ABAP/TableMaintenance/demo.htm]]
    Also, please check the Delivery Class and Data Browser/Table View Maint. in the Delivery and Maintanence tab of the table.
    Thanks,
    Jayant
    Edited by: Jayant Sahu on Nov 24, 2008 3:00 PM

  • Events in Table Maintenance, modify record and new record checking.

    Hi,
    I need to have a checking in the table maintenance for a custom Z table.
    1.) First requirement is to check the changed data of an existing entry. An error must occur when pressing enter or when pressing the save button. What event should I use in order to accomplish this task?
    2.) Second is when creating a new entry. An error must also occur when saving. I have already created the error message but my problem is that it does not return to the table maintenance screen but rather exits SAP.
    Please advise on what to do regarding these matters.
    Edited by: Al Vincent Bulacan on Mar 17, 2009 12:55 PM

    Follow the given path
    go in se11 to the Table Maintenance generator.
    Envireonment --> Modification --> Events.
    Here you will find a number for events. You can choose the one that fits your requirement.
    Then you can create an Perform in the selected event and get your requirements done.
    Hope it helps,
    - RJ

  • Events in Table Maintenance - How validate fields and deliver error message

    Simple transparent table.  I have generated one step table maintenance.  I use a view variant to make some fields display only.  I would like to use Events to provide some validation.  For example: If field STATUS = 'T', then field QUANTITY must be > 0.
    So far, I have tried events 05 and 21.  When the user tries to enter a new row, I can issue an error message that is returned to the screen.  The problem is that the screen is no longer typeable, i.e. the user cannot correct the error.  They have to exit and start over.
    Is there a different event or different coding I should provide to open up the screen for typing?

    Hi,
    Tried 'message type 'I' display like 'E''', in event 5 and 21. The non-key fields are now typeable but the validation is not enforced, i.e. you get a message that you must enter a QUANTITY but you can save the row without entering a QUANTITY.
    Yes I was afraid of that... that's why I would use the event 01 (with 05, if user still tries to save invalid entries, 01 will block). Normally when you get the error and press the ENTER key, you should get back to your table in edit mode... Well this is happening on my system...
    I'll let you know if I got a better idea...
    Kr,
    Manu.
    Edited by: Manu D'Haeyer on Nov 10, 2011 5:01 PM

  • Issuing an Error in Table Maintenance Event

    Hi,
    How can I issue an error in the table maintenance event without exiting the screen.
    When an event is triggered (Before Save), it will perform a check in the data changed or created. It will issue an error when the changes are not correct. But when I press enter or click on the check button, it will exit the table maintenance screen.
    What do I have to do in order to issue an error but will still go back to the table maintenance view.
    Making the message as information or type I, will not work because it will still save.

    Hi,
    I came to the same problem, maybe this will help someone.
    You can move check into view cluster event.
    1. load the view
         PERFORM vcl_set_table_access_for_obj
              USING 'view'
              CHANGING error_flag.
    2. assing to structure
         LOOP AT <vcl_total> INTO ls_view
    3. perform check, set VCL_STOP which will stop saving and will display message
         VCL_STOP = 'X'.
         MESSAGE ....

Maybe you are looking for