Do validations on fields while User enters data thru SM30

Hi All,
I am creating a custom table and would like to validate the data when user is entering the data thru SM30 manually and display appropiate status or error messages if the data entered is wrong. Also i have to allow only those users that are assigned for that role to access the table and should be able to Add and Update but not delete any record from the table. This is Urgent as i have to get this done real quick and then test my program on it. Any help will be greatly appreciated.
Thanks in advance,
David.

David,
For doing validations you need to make use of modification event
<b>01     Before saving the data in the database</b>
Refer to link for list of events available
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm">Extended Table Maintenance Events</a>
To control with authorization please refer to the link below.
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/a7/5134d2407a11d1893b0000e8323c4f/frameset.htm">Maintain authorization groups</a>
Refer to this blog for event creations
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc</a>
Regds
Manohar

Similar Messages

  • Calculate one month prior to user entered date by a Date/Time field

    Hi All,
    I am currently pretty new to Live cycle and have no idea about Java scripting, i have been using this site a lot for my forms and have used the FormCalc for expanding tables and so on but this one is proving difficult. I am currently designing a form that requires a calculation of one month prior to a user entered date by a Date/Time field. I have looked at multiple posts on how to do this but none have worked (they are using the Date2Num).
    Is anyone able to enlighten me please?
    I currently have:
    Date/Time field Date Due
    Date/Time field Planned Date of Review
    I need Planned Date of Review to be calculated to be 30 days prior to Date Due. How do I go about doing this? Is it incorrect to use a Date/Time field as the field type for the calculation?
    Cheers
    Brad

    You can use FormCalc to compare the user input.
    Put this script into the exit:Event of the date field.
    if (Date2Num($.formattedValue, "MM/DD/YYYY") ne date()) then
    $host.messageBox("The entered date is not todays date!")
    endif

  • How to get the user entered data?

    Hi all,
    I have created an HTMLB DynPage component.
    In That i have created my input screen with textboxes using response.write method.
    i have added one onConfirm event on which the data whould validate.
    so onConfirm method im trying to get the data with request.getParameter method which returns null...
    how to do...how to get the user entered data to do my validations...can anyone plz advice.
    Thanks,
    Viswes

    Hi
    inputfield or textbox component entered directly using response.write(...) are not htmlb , but html.
    to create portal input field (ie HTMLB), you should do something like
    this in the doProcessBeforeOutput member function
    InputField field1 = new InputField("Id1");
    field1.setSize(8); // 8 characters
    this.getForm().addComponent(field1);
    and in doProcessAfterInput member function
    InputField field1 =
    (InputField) this.getComponentByName("Id1");
    you can then manipulate the content of the field.
    Hope this help,
    Guillaume

  • Cell data not getting refreshed in which user enters data OO ALV(editable)

    Hi Friends,
    I am using OO ALV for editable grid display.
    I am unable to change grid data in the cell in which user enters something, using OO ALV. Did through debugging of my own program and found that some problem with system program. Then I did all system debugging. Could not find out why is the grid not getting refreshed with the new data in the cell in which user had entered some value. Rest of the cell's data are getting refreshed with the values which i am updating in the final internal table. I can see that the data in the final internal table is changed for the cell in which user enters data. But even after the call of
          CALL METHOD obj_alvgrid1->refresh_table_display
    does not refreshes the data in the cell in which user had entered data. Rest of the cells data are getting refreshed.
    Piece of code:
      SET HANDLER obj_event_receiver->handle_data_changed
                                         FOR obj_alvgrid1.
        METHODS: handle_data_changed
                       FOR EVENT data_changed OF cl_gui_alv_grid
                           IMPORTING er_data_changed
                                     e_onf4
                                     e_onf4_before
                                     e_onf4_after.
    METHOD handle_data_changed.
      DATA : v_valid    TYPE char1,
             v_refresh  TYPE char1.
    *--check mt_good_cells semantically
      CALL METHOD perform_semantic_checks( er_data_changed ).
    *--If PBO is again visited, just refresh the ALV grid.
      CALL METHOD obj_alvgrid1->refresh_table_display
        EXCEPTIONS
          finished = 1
          OTHERS   = 2.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
    ENDMETHOD.
    METHOD perform_semantic_checks.
        LOOP AT er_data_changed->mt_good_cells INTO w_good.
          v_index = sy-tabix.
          CASE w_good-fieldname.
            WHEN 'ZASCAS'.
    *Now here based on some conditions I am changing my final internal table i_zamtsmatnp
                              MODIFY i_zamtsmatnp FROM w_zamtsmatnp INDEX
                                               w_good-row_id TRANSPORTING
                                                 zascas modif.
    User enters data in zascas field. Based on the data entered, I am changing other fields which is getting refreshed. I am also changing zascas in the program even after user had already entered the value which was bit wrong and i am correcting it in the program on the even "data_changed" even.
    Please help me friends as i m strugling past hours wondering why the data is not getting refreshed for the cell in which user enter data.
    Regards,
    Surya

    Hi Surya,
       The approach you are following is correct. You need to use the comibnation of all these things:
    Event - DATA_CHANGED
    Methods - CHECK_CHANGED_DATA
                 -  GET_CHANGED_DATA.
    However, here are few standard programs which are having similar functionality.
    BCALV_EDIT_03
    BCALV_EDIT_07
    Check out these once.
    Note: If anything is helpful, dont forget to reward points
    Thanks,
    Adithya K
    SAP Practise
    [email protected]

  • How to populate date & time when user enter data for custom table in sm30

    Can anyone tell me How to populate system date & time when user enter data for custom table in sm30..
      Req is
      i have custom table and using sm30 user can enter data.
    after saving date i want to update date & time in table
    Pls let me know where to write the code?
    Thanks in Advance

    You have to write the code in EVENT 01 in SE54 transaction. Go to SE54, enter your Ztable name and in the menu 'Environment-->Events'. Press 'ENTER' to go past the popup message. In the next screen, click on 'New Entries'. In the first column, enter 01 and in the next column give some name for your routine(say UPDATE_USER_DATE_TIME). Then click on the souce code icon that appears in blue at the end of the row. In the code, you need logic like below.
    FORM update_user_date_time.
      DATA: f_index LIKE sy-tabix.
      DATA: BEGIN OF l_total.
              INCLUDE STRUCTURE zztable.
      INCLUDE  STRUCTURE vimtbflags.
      DATA  END OF l_total.
      DATA: s_record TYPE zztable.
      LOOP AT total INTO l_total.
        IF l_total-vim_action = aendern OR
           l_total-vim_action = neuer_eintrag.
          MOVE-CORRESPONDING l_total TO s_record.
          s_record-zz_user = sy-uname.
          s_record-zz_date = sy-datum.
          s_record-zz_time = sy-uzeit.
          READ TABLE extract WITH KEY l_total.
          IF sy-subrc EQ 0.
            f_index = sy-tabix.
          ELSE.
            CLEAR f_index.
          ENDIF.
          MOVE-CORRESPONDING s_record TO l_total.
          MODIFY total FROM l_total.
          CHECK f_index GT 0.
          MODIFY extract INDEX f_index FROM l_total.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " UPDATE_USER_DATE_TIME
    Here ZZTABLE is the Z table and ZZ_USER, ZZ_DATE, and ZZ_TIME are the fields that are updated.

  • User entered date to be calculated for another header

    Hello All,
    In a BEx query, a user enters a date (date1), and I need to display Date1 - 30 as a header for one of the columns. Can I take care of this while creating a text variable??
    Or I need to use a customer exit with i_step = 2?
    Kindly inform..
    Eg: User entered date : 30-Jan-07
    The header should be like Non moving stock as of 1-Jan-07
    Thanks in advance.
    Regards,
    K2

    Hello Prasad,
    Can I try offset for a Text variable created for the header??
    Thanks.
    Regards,
    K2

  • To compare two user entered dates

    HI FRIENDS
    here is my code. When i try to print the user entered date (dd/MM/yyyy)(which i am storing in a string) the program dispalys nothing. and everey time i enter a valid date it displas "invalid From date entered ". I need to store the user entered date into a string because i need that for further use. All my intesion is to get two dates from user in dd/MM/yyyy. Strore them in certain variable. Check if they are valid or not. and make sure todate is either equal or greater than fromdate. Please help me to solve this problem.
    public class EDTDateValidation extends JFrame implements ActionListener{
    private JLabel fromlabel;
    private JLabel tolabel;
    private JTextField fromtxt;
    private JTextField totxt;
    private String fmt ="dd/MM/yyyy";
    private java.lang.String fromdate;
    private java.lang.String todate;
    private JButton buttonOK;
    private JButton buttonCancel;
    private Date theDate;
    private Date date1;
    private Date date2;
    private JPanel mainPanel;
    SimpleDateFormat dtformat = new SimpleDateFormat(fmt);
    public EDTDateValidation(){
    super("Date Validation");
    dtformat.setLenient(false);
    mainPanel=new JPanel();
    mainPanel.setLayout(null);
    fromlabel = new JLabel("From Date");
    tolabel = new JLabel("To Date");
    buttonOK = new JButton("OK");
    buttonCancel = new JButton("Cancel");
    fromdate = new String();
    todate = new String();
    fromtxt = new JTextField(10);
    totxt = new JTextField(10);
    fromdate = fromtxt.getText();
    todate = totxt.getText();
    mainPanel.add(fromlabel);
    fromlabel.setBounds(20,20,50,15);
    mainPanel.add(tolabel);
    tolabel.setBounds(20,50,50,15);
    mainPanel.add(fromtxt);
    fromtxt.setBounds(90,20,130,20);
    mainPanel.add(totxt);
    totxt. setBounds(90,50,130,20);
    mainPanel.add(buttonOK);
    buttonOK.setBounds(70,80,71,23);
    mainPanel.add(buttonCancel);
    buttonCancel.setBounds(150,80,71,23);
    buttonOK.addActionListener(this);
    buttonCancel.addActionListener(this);
    setContentPane(mainPanel);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(247,140);
    setResizable(false);
    //pack();
    public static void main(String args[]) {
    try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    catch(Exception e) {
    System.err.println("Could not load Look and Feel" + e);
    EDTDateValidation edtDateVal = new EDTDateValidation();
    edtDateVal.setVisible(true);
    public void actionPerformed(ActionEvent e) {
    if(e.getSource() == buttonOK){
    System.out.println(fromtxt.getText());
    // System.out.println(SimpleDateFormat.format(fromdate));
    System.out.println(fromdate); //THIS DISPLAYS BLANK
    System.out.println(todate); //THIS ASWELL
    try {
    Date date = null;
    date = dtformat.parse(fromdate);
    System.out.println("valid From date entered!");
    catch(Exception f) {
    System.out.println("Invalid From date entered!");
    // textField1.setText("");
    return;
    try {
    Date date = null;
    date = dtformat.parse(todate);
    System.out.println("valid TO date entered!");
    catch(Exception f) {
    System.out.println("Invalid To date entered!");
    // textField1.setText("");
    return;
    }

    Judging from your code, you've got a lot of learning
    to do. I suggest you
    split it up:
    1. Write non-GUI code that attempts to parse, compare
    and format dates.
    2. Write simpler GUI code to capture ordinary
    strings, for example, and
    worry about dates after you can do something simpler.And standard instructions: Use code tags.

  • How can I read the last cell of a JTable that a user Enters data

    I have a one column JTable with several rows that a user enters data to. Upon entering the last data, the user clicks a button to read all the data from the rows in the JTable and puts them in an arraylist. If the user does not click enter or navigates away from the last cell, then after clicking the button it does not read the last cell entered. Since the user is clicking on a button to indicate he is done entering data on the table, does he also have to hit the enter key to indicate he is done entering the data?
    The code below is my tablemodelListener:
    public class InteractiveTableModelListener implements TableModelListener {
    public void tableChanged(TableModelEvent evt) {
    if (evt.getType() == TableModelEvent.UPDATE) {
    int row = evt.getFirstRow();
    System.out.println("Update row:"+" "+row);
    jTable1.setRowSelectionInterval(row, row);
    }

    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.
    In the future, Swing related questions should be posted in the Swing fourm. (This question has been asked and answered dozens of times).
    But there is not need to repost because [Table Stop Editing|http://www.camick.com/java/blog.html?name=table-stop-editing] explains whats happening and give a couple of solutions.

  • How to use User entered dates in intreval

    Hi,
    User will enter date range in variable
    As per my requirment i want to use no of days between those 2 user entered dates in my calculaction
    How can i achieve this at report level.
    Thanks

    Hi
    Create a variable with intreval.
    There is a function module which calculates the no of days between the days
    Go to SE38 and ZXRSRU01 Program
    Write the Code like this (Not exact code)  you can modify
    WHEN "ZZZZZ"(Before that create a formula variable to get the number of days between the days and use the tech name of the formula variable here)
    read ..the lower limit and the upper limit of the caldaz variable
    FROMDATE = L_S_RANGE-low
    TODATE = L_S_RANGE-HIGH
    Then call the function module
    Search for the function module by using days in SE37
    Then pass the from and to Date to the function module it will retun the number of days
    update that to table e_T_Range
    You can proceed with this
    Regards
    M.A

  • Display of user entered date in one column

    Hi Guys,
    Is it possible to display user entered date(any date) in column of all rows?
    I need to calculate no of days(User entered date-Deposit date).
    Please give some input.

    Hi Sagar,
    How can u display user enterd date in a column?
    For example if user entered 31.03.2007 as input,i need the same date(31.03.2007 ) to display in all rows of the column,so i can use it in the formula.
    Thanks.

  • How to handle user entered data validation

    Hi,
    In my page i have three fields
    Empname (String)
    Empnumber (Number)
    DOB (Date)
    These fields are mapped to VO which are mapped to EO.
    When user enters string in Empnumber field then it will throw user following Error "Cannot create an object of type:oracle.jbo.domain.Number with value hghfg"
    I want to display above Error in user friendly fashion.
    Where to do this and How to do this?
    And i have one more question
    can we handle all the exceptions in seter method of EOIMPL?
    -Thanks
    Mithun

    Sumit,
    I have set 'Disable Client Side Validation' in the property inspector true for submit button. Added below code for validation
    In CO
    String lb_flag= (String)am.invokeMethod("validateRVSize",prm1,prmType1);
    In AM
    public String validateRVSize(String val)
    String values = "1234567890' ";
    for (int i=0; i < val.length(); i++)
    if (values.indexOf(val.charAt(i)) < 0)
    return "false";
    return "true";
    but what i have observed is control is not at all coming to process form request. it is doing it's validation in processformdata itself, i suppose.
    because no statement is getting printed if i had entered characters in number field.
    -Mithun

  • Today's date dynamically entered into text field that user enters additional text into same field.

    Trying to have today's date dynamically entered into a repeating table row textfield when the button is clicked to create each repeating row. The user can then enter addtional text into the same text field next to the date.
    Example:
    [4/25/2012] This is the text the user entered.
    Today's date is populated in each update row created when the "Update Row" button is clicked.
    The following script works but only for the first instance, not the second, third, forth, etc...
    Click event: (JavaScript, client)
    this.resolveNode('Table2._RowB').addInstance(1);
    xfa.resolveNode("Table2.RowB.#subform.Update").rawValue
    Thank you,
    ~Don

    Hi Don,
    Does this solution cover the above problem? https://acrobat.com/#d=VjJ-YsXLKmV6QU84JrAAIw
    Niall

  • Text Varible for user enter date range

    Hi,
    I need code for text variable,
    the user enters the date range in user entry varible screen
    ex : production for the date range of xxxxx(xxxx= text variable)
    user enters the date range 25-05-2010 -  31-05-2010
    The query description name should be 
    production for the date range of    25-05-2010 -  31-05-2010
    for that  i need code i _step 2  code
    User eners the date range in varaible screen as per that report header has to come
    Please provide the valuble code.
    Thanks & Regards,
    Sathish

    Use Replacement Path Approach instead of Customer Exit.
    Create two Text variables TVAR1 and TVAR2 of type replacement path. Replace them with the Date Characteristic that you are using on which variable is created for user to enter the date range. 
    While creating Text variables, for TVAR1 select From Value and  TVAR2 select To Value.
    Now make the Query description as   Production for the date range of &TVAR1& - &TVAR2&

  • Format numeric field as user enters value

    I have a numeric field that I want to be formatted as 999-999999-999 so that when users enter 12-digit part numbers, the field automatically formats the value that they have entered. Is there a way to format their value as it is entered so that when they type the fourth number, a hyphen is placed between the third and fourth digit?
    Additionally, is there a way to allow a numeric field to have a default value with letters? I want to have a default value of "xxx-xxxxxx-xxx" but I don't want to allow the user to enter anything but numbers in the field. I tried using a text field, but I can't get it to reject letters and only accept numbers.

    Hi,
    You can define a display format pattern of "num{999-999999-999}" that will add the hyphens in once they leave the field, or maybe having three fields with the comb option set and hyphens between them would suit more?
    You can use the null display pattern to display any sort of text in a numeric, date, or whatever field.  Have a look at this sample, Adobe LiveCycle Designer Cookbooks by BR001: Adding Ghost Text to LiveCycle Designer form
    Regards
    Bruce

  • Show user entered date when ssrs report exported to csv format

    Hi All,
    How can I show date range parameter entered by user when ssrs report is exported to csv format.
    my csv output should look like this....
    Date : 01/01/2015 TO 01/31/2015 (user selected dates)
    ID,EmpFirstName,EmpLastName,Location
    1,Tom,Garry,NY
    2,John,Graham,NJ
    3,Ron,Lorrie,CA
    Thanks,
    RH
    sql

    Hi RH,
    You can add two textbox at the top outside the tablix and using expression to get the parameter value use have selected to display in the textbox as blew:
    TextBox1: =Parameters!Date.Value
    TextBox2: =Parameters!To.Value
    For Multiple value parameter you can use the expression like : =Join(Parameters!Date.Value,",")
    You can rename the two textbox' name in the properties as "Date" and "To"  then the two textboxs will display like belkow in the CSV report:
    Date                 TO
    01/01/2015      01/31/2015 
    ID   EmpFirstName    EmpLastName   Location
    1      Tom                  Garry                  NY
    2      John                 Graham               NJ
    3      Ron                   Lorrie                 CA
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

Maybe you are looking for

  • How to pass the table name dynamically in xml parsing

    Hi All, I have created one procedure for parsing xml file which is working perfectly. FORALL i IN t_tab.first .. t_tab.last          INSERT INTO Test_AP VALUES t_tab(i);Now I want to put the table name dynamically+. For that I have added one query an

  • Wiki Migration

    Ok. Most wiki migration updates will likely appear in this thread. I will try to centralize them here so that the community wont have to look all of the place for information. I will post links to the mailing list when possible, for some of the more

  • LMS 3.2.1 changing smtp server

    Running lms 3.2.1   CS 3.3.1  on Windows 2003 I need to point the LMS server to a new mail relay, but when I make the change in CS->SERVER->Admin->System Preferences  smtp server It claims to have made the change successfully but the old IP address r

  • Why isnt my new sony camcorder compatible with mac?

    just bouught a new sony camcorder 1080p model HDR-CX110 and i recorded a video and took a couple photos,i started reading the manual and it says the enclosed softeare is not compatible with mac, they gave a website for mac users to go to for help, on

  • GR  FOR pur .order  issue

    Hi when i am doing ..GR for puchase order ... system give error  like "value of goods moment is negetive" I Have create purchase order (subcontracting)..me21n..item cat L in pur .ord mention components..in 2 line items 1st line item component issue t