Event for preventing a new entry in DBTable

hi all,
please suggest me a event in table maintenance to have a check for preventing the entry into the table. i tried event 18 but wen the error msg is displayed it comes out of record entry window which is to be avoided.
regards
Madhu

My friend  it is  not
18 . it is 05 -> Creating New Entry. 
so that  you can validate with the User   and  do the validation  and update the table .
"Below is the code for  it
Select 05 for an event for “Creating a new entry”.
This event will be triggered while creating a new entry in SM30 or using the TCODE.
Form Name: AT_NEWENTRY (Enter key)
Double Click on the editor.
form at_newentry.
Ztab-ZCOUNTRY = ‘India’.
Ztab-ZCREATEDATE = sy-datum.
Ztab-ZCREATETIME = sy-uzeit.
endform.
Create another event: 02 for “After Save”
FORM after_save.
Ztab-mandt = extract+0(3).
Ztab-ZCOUNTRY = extract+3(3)..
Ztab-ZCREATEDATE = sy-datum.
Ztab-ZCREATETIME = sy-uzeit.
MODIFY ztab.
ENDFORM. "after_save
Step 4: Create Transaction Code.
Go to SE93.
Transcation code: ZTAB
Transaction text Test Table Maintenance Events
Transaction: SM30, Skip first Screen
Default Values:
VIEWNAME ZTAB
UPDATE X
Reward  points if it is usefull....
Girish

Similar Messages

  • 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 KNOW THE TCODE FOR CREATING A NEW ENTRY IN A PARTICULAR TABLE

    HI,
        CAN YOU PLEASE LET ME KNOW THE PROCEDURE TO GET THE TCODE FOR CREATING A NEW ENTITY IN A TABLE .
       EG: IS THERE ANY PROCEDURE TO KNOW THAT IF I CREATE A NEW ENTITY IN MM01 IT WILL BE STORED IN TABLE MARA.
    THANKING YOU.

    Hi Venkata,
    If you want to know, for a given table, which transaction/program(s) will create a new record,  there is no easy procedure, other than to refer to experts who deal with these programs.
    It is possible to get a list of programs that refer to a table.  SE11, select the table, select the 'where-used' icon, select programs, execute.  You will be presented with a list of programs that read or write to that table.  From that list you would have to determine which one(s) create records, using your ABAP skills.  From those selected programs you would have to find which, if any, had a transaction assigned.
    Many tables are updated by more than one program/transaction.  Many other tables are not updated by ANY interactive transaction.
    If you ever decide to go ahead with this research, make sure you publish it.  You could probably make yourself a bit of money.
    Regards,
    DB49

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

  • Adding new entry in table J_1INEXCGRP

    Hi,
    I am MM functional,  due to some system error , for the excsie group I required to manitain the entry in table J_1INEXCGRP,  as that customization part is not included in request,  now I want to confirm which methode to be use
    SE12->Utilities -> Table content -> create entry   or  with SE16N
    can you please give the stpes for adding a new entry in this table it has only two fileds
    MANDT
    J_1IEXCGRP
    regards,
    zafar
    Moderator Message: Spoon-feeding is not entertained here.
    Edited by: kishan P on Jan 25, 2011 4:58 PM

    Hi Alok,
    Hope this steps - code will help you to resolve this issue.
    1. Create A Group for your table control. In Screen Painter.
    2. Write Screen modification routine for the same
    it can be like this..
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
      LOOP AT SCREEN.
        IF screen-group1 = 'MOD'.
          IF flag = ' '.
            screen-input = '0'.
          ELSEIF flag = 'X'.
            screen-input = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.
    3. This will disable the display of the Fields in TABLE Control.
    4. in the PBO loop of the table control. Identify the lines which u want to keep active.
    Hope this will help
    <i><b>** Reward points to helpful answer</b></i>

  • How to pre-populate fields for new entry in table maintenance

    Hey everyone,
    I have a table maintenance set up that I would like to pre-populate two date fields when the user creates a new entry or copies an existing entry.
    I can do this by adding a PBO module for the maintenance screen but then if the screens are regenerated my changes are lost so this is not ideal.
    I've also found that I can use the events (05 and 21 I believe) to set the dates but using these events I can not fill in the values in the screen so this is also not ideal.
    Is there an event that can be used to pre-populate fields in a table maintenance screen? If not, what is your suggested method for accomplishing this?
    Thanks in advance! I appreciate any help!

    Hi,
    Please use the below links...
    [Table maintenance Field Validations;
    [http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=93454609]
    Thanks,
    Manish

  • Trigger a event and send an email  when a new entry is created in a table

    Hi All,
                I have scenario here where i want to trigger a event and send an email too when a new entry is created in a Ztable or an existing entry is changed.
    Please let me know how can i achieve this.
    Please excuse me if you find it basic as I am not very old in Workflows.
    Thanks in Advance,
    Saket.

    Hi..
    For your Requirement workflow not Required.
    Write a  Program to send Mail. This Program has to execute when ever the Save Button is Click, then the mail will be sent.
    Check the program in this [link|https://wiki.sdn.sap.com/wiki/x/nYKdAw ], which send the mail.
    Regards,
    Surjith

  • How to remove the 'New Entry' button in the warning message for a dialog bo

    Hi Experts,
    I am calling a Modal Dialog box screen having a pushbutton.
    On the click of the pushbutton, I am performing some checks, and giving a warning message.
    The warning message comes as a popup in this case and has three buttons on it.
    One of these buttons is titled 'New entry'.
    I dont want that button to come on the warning popup.
    Please let me know if there is a way out for this.
    Thanks in advance.
    Useful answers will surely be rewarded.
    Regards,
    Himanshu

    Hi Jyothi,
    Thanks a lot for ur prompt reply.
    But, in my dialog screen, on click of the button I am simply using the statement :
    MESSAGE W000(0K) with 'text'.
    The resulting warning message comes as a popup with the 'New Entry' button on it.
    From the warning popup, how can I remove the button.
    Please let me know.
    Thanks.
    Regards,
    Himanshu

  • Dots (events) for every single day in calendar (NEW issue)

    Ever since I upgraded to FW 2.0 I have had "dots" appear in every single day of the calendar (symbolizing events) even though I have no events for those days.
    Now - I KNOW about the issue with the recurring/repeating events as well as events that "begin" after they "end." That said, I have checked EVERY single event I have in the phone and in the calendar in Outlook and NONE of the events are repeating/recurring and all of them are set up properly with correct start/end times.
    From my searching, the above seems to be what's commonly known to cause this problem. Those don't fit MY problem.
    The odd thing here is, if I go backward in the month view on the calendar on the phone to February, there are no dots. There are also no events. However, if I go to March on the month view in the calendar, every single day has dots (and continues). The really weird thing here is if you look at the calendar in the month view while it's on March, you can see the last week of February at the top. And in that last week, while in the "March" view, the last week of February ALL has dots. But again, if you move back to "February," all those dots that were there disappear.
    So...I'm at a loss now. I've wiped the events off the phone. Edited/pruned/etc. events in the Outlook calendar, and then re-synced with the order to overwrite that which is on the phone. Still no luck. Is this a glitch that needs to be corrected with new FW? Would a restore help? I just don't really know anymore..
    Thanks,
    John

    I am having the same issue. However, I am syncing my calendar to my work computer and the issue presented itself when I upgraded to Office 2007 from 2003. I have since removed Office '07 and did a restore to my iphone which cleared the issue. Then did a sync again to Office 2003 and the issue re-appeared. Not sure if '07 added something to my calendar that is hidden but it is very frustrating.

  • How can I add a new entry for determining a requirement type

    Dear Friends,
    How can I add a new entry for determining a requirement type
    via Item Category + MRP type,  I see no new entries selection.
    This is in  Avb Check & TOR-> TOR-> Determination of req type using transaction.
    Please help.
    Regards
    Ravi.

    Availability Check and Transfer of Requirements > Transfer of Requirements > Define Requirements Types ?
    Just one node above?
    Never mind, you need to add entry on item category:S

  • Events for changed entry in data dictionary

    Hi ,
    I  have a requirement as mentioned below:
    my table has four fields : 1. vkorg 2. validity_period 3. modification_date and 4. modification_time.
    I have to capture the modification date and modification time if a user changes an entry (or entries) in the table and update the date and time fields in the table.  I have done it by creating an event "creating a new entry"which is triggered when a new entry is added to the table. But if an existing entry is modifies then the entry is not triggered. when I use  " before saving the data " event then only the last record of the table moves to the "Routine"  of the event. So I am not able to capture the date and time when an entry (or entries ) is modified.  Can anyone suggest me what I should do?
    Regards
    Amit kumar
    Edited by: amitku1201 on Jan 15, 2010 3:05 PM

    This question has been asked many times before. Please see:
    *&      Form  FILL_SY_FIELDS                                    FISKROB
    *       Add the creation date and userid if the line is being created.
    *       Add the change date and userid if the line is being changed.
    form fill_sy_fields.
      data: f_index like sy-tabix. "Index to note the lines found
      data begin of total_s.
              include structure zzv_my_tab.
      data action.
      data mark.
      data end of total_s.
      data extract_s like total_s.
      loop at total.
        if <action> = 'U'.
          move total to total_s.
          read table extract with key total.
          if sy-subrc eq 0.
            f_index = sy-tabix.
            extract_s = extract.
          else.
            clear f_index.
          endif.
    *       (make desired changes to the line TOTAL)
          total_s-zzfchdate = sy-datum.
          total_s-zzfchusr  = sy-uname.
          move total_s to total.
          modify total.
          check f_index gt 0.
          extract = total.
          modify extract index f_index.
        elseif <action> = 'N'.
          move total to total_s.
          read table extract with key total.
          if sy-subrc eq 0.
            f_index = sy-tabix.
            extract_s = extract.
          else.
            clear f_index.
          endif.
    *       (make desired changes to the line TOTAL)
          total_s-zzfcredate = sy-datum.
          total_s-zzfcreusr  = sy-uname.
          move total_s to total.
          modify total.
          check f_index gt 0.
          extract = total.
          modify extract index f_index.
        elseif total is initial.
          move total to total_s.
          read table extract with key total.
          if sy-subrc eq 0.
            f_index = sy-tabix.
            extract_s = extract.
          else.
            clear f_index.
          endif.
    *       (make desired changes to the line TOTAL)
          delete total.
          check f_index gt 0.
          delete extract index f_index.
        endif.
      endloop.
      sy-subrc = 0.
    endform.                    " FILL_SY_FIELDS
    Rob
    The link I posted earlier may not work now. The above code does.
    Edited by: Rob Burbank on Jan 15, 2010 12:20 PM

  • New entry for a view in SM30 does not save

    Hi all,
    I created a new entry for a view in SM30.
    Then when I tried to SAVE it, it does not SAVE and comes back to the same screen with the new entry. And it continues, until you CANCEL and come out.
    Please let me know the reason for it.
    Thanks and regards,
    Anishur

    copy the sap view to a zview make the modifications and generate in se11 the table maintenance generator.
    why was it necessary to make the modification to the original SAP view ??
    kind regards
    arthur
    Edited by: A. de Smidt on Apr 16, 2009 9:08 AM

  • I have lost my Bookmarks and History and neither will record new entries(recently adjusted Facebook options to "Friends Only" for most settings)

    I have lost my Bookmarks and History listings and neither will record new entries (recently adjusted Facebook options to "Friends Only" for most settings)

    See http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • Create new event for BOR object  for vendor creation

    Hello,
              I AM working on workflow.. Requrement is that , when a vendor is created I wanted the workflow to be triggered..
    But I dont find any bussiness object for this...
          Then I have created customized BOR object super type as LFA1. And created new event. Now I need to assign functionlity to this event, that is As soon as the vendor is created this event should be triggered so that I can use this as the start event for the workflow..
    Plz guide me ...
    Regards and Thanks,
    Poornima...

    Hi Poornima,
    Create a subtype and add the event in the BOR.
    Now call the FM  Userexit / BADI.
      CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
        EXPORTING
          OBJECT_TYPE             = 'ZKNA1'
          OBJECT_KEY              = OBJECT_KEY
          EVENT                   = 'ONSAVE'
    *   COMMIT_WORK             = 'X'
    *   EVENT_LANGUAGE          = SY-LANGU
    *   LANGUAGE                = SY-LANGU
    *   USER                    = SY-UNAME
    *   IFS_XML_CONTAINER       =
    * IMPORTING
    *   RETURN_CODE             =
    *   EVENT_ID                =
       TABLES
         INPUT_CONTAINER         = IT_CONTAINER
    *   MESSAGE_LINES           =
    *   MESSAGE_STRUCT          =
      IF SY-SUBRC <> 0.
        ENDIF.
    &******************Reward Point if helpful*************************&

  • Is there an event for a composite has a new child control?

    I want to know is there an event for a composite has a new child control?
    For example,
    Composite parent = new Composite();
    Label child = new Label(parent, SWT.None);
    I want to know the parent composite is getting a child label when new label
    create then immediately.
    Thanks.
    Frank

    Also, I got this comment (a bit of a warning) from Dimitri:
    <blockquote>I just saw this pattern used by <i>[customer]</i> - they (used to check) if the member was senior, and if it was, it was responsible for some periodic cleanup tasks and whatnot.
    This worked fine in the test application and broke immediately when we added dedicated cache servers, or standalone JMX console etc, i.e. it is perfectly possible for the Console to be senior without any application classes in it's classpath, or for the dedicated cache server to be senior and only application servers have logic in place to run stuff.</blockquote>
    In other words, depending on your deployment, it may not be as simple as just "being senior", you may also want to use a "Role Name" for example (configurable and accessible per member).
    Peace,
    Cameron Purdy
    Oracle Coherence: Data Grid for Java and .NET

Maybe you are looking for

  • Shutting down unexpectedly, battery disconnecting

    I got back to my apartment from a break and after starting up my macbook the battery wouldn't charge. It had over 900 cycles so no big deal I bought a replacement. I got the replacement in today, installed it, and let it charge for a few hours. Now w

  • SELECT 'x' FROM DUAL

    Hi I work with Oracle JDev 10g with database as Oracle 10g.The query: SELECT ''x'' FROM DUAL is executed automatically whenever I forward my application control from one java file to another through structs. I have not coded this query anywhere in my

  • How to assign account assignment category for a material

    Hi All I am creating a Purchase order .using tr code /nME21N I filled in the columns for materials, qty,deliv date,net price and currency . Now it is throwing me an error  "Account Assignment mandatory for each of the materials" (enter accnt asst cat

  • Apex LE/D 4088 Assistance

    I saw that there was a group of users who had the Apex 40" LE 4088 television on an earlier post and wanted to follow up with those users as this information doesn't seem to exist anywhere else and customer service with Apex is non-existent. Does any

  • Invoice no change

    Dear Experts By mistake I had mention wrong invoice number  in migo and UD was cleared.I want to change  Invoice number In Migo. Pls give me solution. Regards Dishant