Table maintenance validation

Hi ,
How to modify previous lines in table maintenance...
Needed info urgently..
<b>Scenario as follows:</b>
matnr      pltyp               datab                datbi
m1           01           01.01.2001          31.12.9999
m1           02           02.03.2002          31.12.9999
m1           03           06.01.2003          31.12.9999
m2           20           01.01.2001          31.12.9999
m2           21           01.01.2004          31.12.9999
m2           22           01.01.2007          31.12.9999
m3           31           01.01.2002          31.12.9999
m3           32           09.01.2006          31.12.9999
in the above scenario.
datbi is only diplay mode , user cannot change the value for datbi.
datbi will be changed acording to the datab values for the corresponding matnr .
my required output is as follows:
matnr      pltyp               datab                datbi
m1           01           01.01.2001          01.03.2002
m1           02           02.03.2002          05.01.2003
m1           03           06.01.2003          31.12.9999
m2           20           01.01.2001          31.12.2003
m2           21           01.01.2004          31.12.2006
m2           22           01.01.2007          31.12.9999
m3           31           01.01.2002          08.01.2006
m3           32           09.01.2006          31.12.9999
regards,
Pradipta

Hi Pradipta,
U can change the dates for the record by writtem modify querries in program.
Or else there is also one crude way .. in debugging mode.
for that just display a single record.
Start debugging by entering /h
and press enter.
Now for 'CODE' enter 'EDIT' and press F8.
U will get the screen in edit mode.
Edit the date and save the record.
Repeat this for all record.
Rgds,
Prakashsingh

Similar Messages

  • Table maintenance Validations

    Hi All,
    I created a table with 2 fields, also created a maintenance generator. Now my requirement is i need to have 1-1 relation with the fields, what i mean is, no value can repeat with in either of the fields.
    I need to validate this condition.
    Suppose user enters a value 1234 in first field, again if he enters the same, i need to throw a error message.
    I went to transaction SE54, the following is the code
    PROCESS BEFORE OUTPUT.
      MODULE liste_initialisieren.
      LOOP AT extract WITH CONTROL
       tctrl_zzbank CURSOR nextline.
        MODULE liste_show_liste.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE liste_exit_command AT EXIT-COMMAND.
      MODULE liste_before_loop.
      LOOP AT extract.
        MODULE liste_init_workarea.
        CHAIN.
          FIELD zzbank-zzau1.
          FIELD zzbank-hbkid.
          MODULE set_update_flag ON CHAIN-REQUEST.
        ENDCHAIN.
        FIELD vim_marked MODULE liste_mark_checkbox.
        CHAIN.
          FIELD zzbank-zzau1.
          MODULE liste_update_liste.
        ENDCHAIN.
      ENDLOOP.
      MODULE liste_after_loop.
    <b>  MODULE check_dupe.</b>
    the line in bold is what i added, how do i proceed from here, could anyone please help.

    Hi Deepti,
    As Jorge Alonso said, if you declare both fields as key fields then SAP will take care of the validation and raise a error message .
    Assuming both fields are key fields, if the records are like this.
    111 222
    <b>111 222</b>
    then SAP will raise a error message.
    Otherwise, if you don't want first or second field to be repeated any where again, then include the code in your check_dupe module.
    GET CURSOR LINE <lin> or GET CURSOR FIELD <f> LINE <lin>.
    select * from ztable into itab.
    loop at itab.
    if itab-first_field CS table_first_field  or itab-first_field CS table_second_field or itab-second_field CS table_first_field or itab-second_field CS table_second_field.
    If sy-subrc eq 0.
    MESSAGE E0004 WITH 'Duplicate key'.
    ENDIF.
    ENDIF.
    endloop.
    Hope this will help you,
    Regards,
    Vicky
    PS: Award points if helpful

  • Table Maintenance Generator : Editable Entry after validation fails

    Hi,
    I have created a Z table and a table maintenance generator to maintain the data.
    I have to carry out certain validations when user enters data on Key and Non- key fields.
    This is working fine, but the issue is with the key fields.
    If validation fails, the table maintenance screen is displayed the date-field is grayed out (non-editable) as it is the key field of the table.
    Now the user cannot change the data unlike the non-key fields were the user can modify the non-valid data and save again.
    How can make the date field (Key Field) editable after entry in case the validation fail, so that the user can make the changes.
    Please suggest the approach to handle the above scenario in events.
    Thanks,
    Keyur

    Thanks Kiran for your inputs.
    I have done the same thing what you have explained.
    I have used a Form Routine as CIP_SAVE with Event Number as 01, since on event SAVE i need to validate whether dates are
    overlapping the inputs dates or not.
    Fields are :
    Group ID (Key)
    Start Date (Key)
    End Date (Key)
    Value (Non -Key)
    Initial value in Table:
    Group ID = 12345
    Start Date = 01/01/2011
    End Date = 01/31/2011
    Value = 11.11
    Now if i try to enter value:
    Group ID = 12345
    Start Date = 01/02/2011
    End Date = 01/25/2011
    Value = 99.99
    & SAVE it... validation will fails because Start & End dates overlaps.
    Hence, on Table Maintainance Screen all key fields will be in non-editable display mode, whereas non-key field will be in editable mode.
    My requirement is that Start Date & End Date key fields must be Editable field.
    Thanks.

  • Validation after Excel File Upload in Table Maintenance

    Hello All,
    I've done extensive research on this topic and still have yet to find the answer. I have created a custom button in the TMG to upload an Excel file to the table maintenance using the FM CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD. I updated the EXTRACT and TOTAL table so it will show up in the TMG interface, but no validations occur. So, I am now trying to do the validations of this file upload. I would like to validate each record and allow the user to modify the error record then continue validating the rest. Essentially I would like to mimic the functionality that occurs when multiple records are copied to the table maintenance and validated one by one. Updating the EXTRACT table through ABAP, does not reach the PAI where the validations occur.
    Is this approach possible? If not, what would be the best way to do validations, inform the user of the error record, and allow modification in the table maintenance interface?
    Thanks,
    Justin

    Or just a report program - have the file name on the selection screen.
    1) Upload the file
    2) Validate the file and produce error messages.
    3) Based on the validations, update the table.
    Rob

  • Field validation in table maintenance generator and input value grey out.

    i have created ztable with 3 fields as em_no,em_no and addrnumber.
    first two fields are custom fields but the third custom field need to validate the standard table adrc contains the value of the field addrnumber.
    i need the query of field validation query which we write in create entry events in table maintenance generator and also if we give wrong value for addrnumber in sm30 maintain table, the input field need not to be grey out for next entry...
    please help.

    Hi,
    create method -
    >before saving data.....write the logic between the method
    go to utilities->table maintanance ,,,after creating generator ---go to envirnment->modification->events.
    create event -.>.as zsave select event  type 1(before saving data to table) write code in include....
    consider data for field3 is 10 .
    lv_new = ztbr(table name)-field3.
    select field3  from ADRC(ZTABLE) into wa_new (TYPE ZTABLE) where field3 = lv_new.
    if sy-subrc = 0.
         working fine
         else.
        message  i888(sabapdocu) with 'data invalid'.
    endform.
    This will help u...
    Thank u.........

  • Validating non key fields in table maintenance generator

    Hi,
    I ma using events for table maintenance generator event 05 ,there i want to validate non key fields ......i am throwing error message ....all the non key fields are getting in display mode ...i need them to enable to enter values ....
    please suggest
    Thanks,
    Shailaja Ainala.

    Hi Shailaja,
    Its property of error message, which makes it as non-editable.
    You can display either status or info message after validation check.
    And finally before saving (before save event) display error message, so that it invalid entries doesnt get saved.
    Thanks,
    Nisha Vengal.

  • Can you please help me with validation logic for Events in Table maintenance generator

    Can you please help me with validation logic for Events in Table maintenance generator,i.e if i enter record in 1st internal table then automatically 2nd internal table should be updated.

    Hi Glen Anthony,
        Thanks for replay,
         I used foreign key relationship between those 2 internal tables....
    I used event 05: When creating a new entry. I want to know the custom logic by which my 2nd Internal table gets automatically updated when i update my 1st Internal table
    Thanks Glen.

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

  • Event for input validation in custom table (table maintenance generator)

    Hello all,
    I look for a solution to execute an event after the modification of a table field of a custom table to validate the user's input.
    I already tried event 07 (Execution : Before correcting the contents of a selected field) of the table maintenance generator but it will be executed after some modification made by the Edit -> Change field action.
    I could use the event 01 but in my opinion this event happens to late and errors are very uncomfortable for the user at that time.
    Editing the dynpro events is not a solution for me because it should be easy to maintain the table structure at any time.
    Thank you in advance
    Robert

    Thank you!
    Event 08 just starts after the saving process after Event 07.
    Event 18 gets executed when I click on the save button.
    I want to check the data after the enter button was pressed as you can see it in several transactions.

  • Table field validation in table maintenance

    Hi all,
    I have the following requirement.
    I created a Z table with 3 fields Zfield1, Zfield2, Zfield3 and key as Zfield1 and Zfield3.
    If Zfield1 is filled, then I need to make the rest of the fields as mandatory.
    How to do this?  Can we use the table maintenance event 05-Creating a new entry for this?
    A sample code would be appreciated.
    Thanks Alka

    hi alka,
    go to the table in SE11 -> click on tab utilities -> table maintenance generator -> click on environment -> modification -> events .
    mention here the event 01 - before saving the data in database.
    write there the code
    FORM
    put a check on ur field
    error  MESSAGE
      LEAVE TO SCREEN screen number.
    ENDFORM.

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

  • 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

  • Table maintenance view -user exit

    Hello, as you all know, there is a program generated behind the table maintenance view. I want to add certain validation on the values entered in the table maintenance.
    I know that modifying the program is not the best practice.
    Is there any user exit which will permit me to do this?
    thx.

    Hi Antish,
        Try to go with the table events. For this goto the Table Maintenance Generator Screen --> Environment --> Modification --> Events. Here you can handle some events according to your requirement. Validations can be done only in this way.
    Regards,
    Swapna.

  • Validate field in the pop up for a Table Maintenance View

    Hi,
    I have created a maintenance view for a Z table. Among the many fields the table, I needed to display the records based on a selection criterion. So, I have enabled a popup for sales org and customer no'.
    Now the sales org and cust no' are being validated individually at the pop up screen itself.
    The requirement is that I need to validate for presence of records for their combination.
    ( FYI: KNVV is the table with the combination of both)
    Kindly let me know how this requirement can be fulfilled.
    Thanks in Advance.

    Hi,
    Try like this..
    in the Table Maintenance Generator>Environment>Modification-->Events.
    in the event on_save(didn't remember exact name)
    select * from ztable into itab where kunnr in kunnr
                                              and    vkorg in vkorg..
    Regards,
    Nagaraj

  • Purpose of table maintenance generator

    wht is the purpose of table maintenance generator

    Hi Pavan,
    The purpose of table maintainence generator is to enable the table maintenance through SM30, and to implement and validation etc on table field inputs.
    SE11->Utillities->table maintainence generator
    You need to enter the values of following fields:
    1. Table name
    2. Authorization group , and authorization object (select the suitable one )
    3. Function group and package
    4. Maintainence type : single or double screen maintainence view depending on the option selected.
    5. Maintain screen number : you may specify a value or let the system generate one for you.
    The validation code for the table entry is written in the flow logic of this screen. Even some of the fields may be made display only , by adding suitable code in the logic or directly disabling the input in table control in the layout.
    Table maintanance is for creating,adding datas to an existing table.
    it is for adding muiltiple records at a time in the table
    A table can be manipulated by a program or manually.
    When creating table, you will find a check box 'Table maintenance allowed'. If we
    check that option, we can manually enter entries using SE16 or table
    maintenance generator screen.
    SE16 is for data browser.
    Go to SE11, give the table name and click on change. Then Go to utilities--> Table
    maintenance generator.
    In the table maintenance generator screen, we should give Authorization Group,
    Function Group name (Function Group name can be same as table name),
    Maintenance type can be one step or two step, usually we will create with one
    step. we should give maintenance screen number. After clicking on create button,
    a table maintenance generator will be created.
    To check it go to SM30 . In SM30, we find display, Maintain options.
    We can view the table contents by choosing Display and we can create table
    entries by choosing Maintain.
    In the production system, end-users will not be having access to transaction
    codes like SE11 and SE16. Developers will not be having access to many
    transaction codes including the above two.
    To view the contents of the database table, we will use SE16n in Production
    system. Please find out the difference between SE16 and SE16n.
    All these authorizations will be maintained by BASIS team, by creating access
    profiles.
    So in order to edit or create the contents of a database table, we should go for
    table maintenance generator. In real time, authorizations will be maintained in
    production system. (even in development and Test systems to some extent).
    There is an audit like Sarbanes-Oxley Act for American clients, where every thing
    will be audited by government agency. To know more about SOX, use the links on
    the right hand side of this page.
    The second reason is, we can edit or create multiple entries at a time, using table
    maintenance generator.
    Apart from that we have options like 'Enter conditions' in table maintenance
    screen SM30. Please try to find out the use of those, by creating an example.
    Table Maintenance generator: Difference between one step and two steps.
    While creating table maintenance generator, we find below options:
    When we choose one step, we have to give the screen number in Overview Screen field.
    When we choose two step, we have to give both overview screen number and single screen number.
    You can give any number for screen. Don’t give 1000 screen number. As this
    number is reserved for selection screen.
    When we choose two step, two screens will be created for table maintenance. For
    single step only one screen will be created.
    When we choose two step, table maintenance will work as follows
    Go to SM30, give the table name for which you have created table maintenance-
    Overview screen will be displayed. To create entries, when you click on ‘new
    entries’. Another screen will be displayed, where you give input and save. You can
    enter one record at a time.
    Go to SM30; give table name for which you have created table maintenance-
    Overview screen will be displayed; To create entries click on ‘new entries’, you can
    enter the records on the same screen. You can enter multiple records at a time.
    We use single step generally, as it is user friendly.
    To completely understand the difference and above points please do exercise by
    creating table maintenance generator in both ways (using single step and two
    step).
    Link: [http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm]
    Link: [http://help.sap.com/saphelp_46c/helpdata/en/a7/5133ac407a11d1893b0000e8323c4f/frameset.htm]
    Link: [/message/2831202#2831202 [original link is broken];
    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.

Maybe you are looking for