<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Do validations on fields while User enters data thru SM30 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373760#M183560</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For doing validations you need to make use of modification event &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;01	Before saving the data in the database&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to link for list of events available&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_47x200/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm"&amp;gt;Extended Table Maintenance Events&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To control with authorization please refer to the link below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_47x200/helpdata/en/a7/5134d2407a11d1893b0000e8323c4f/frameset.htm"&amp;gt;Maintain authorization groups&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to this blog for event creations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;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"&amp;gt;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&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jun 2006 15:31:04 GMT</pubDate>
    <dc:creator>Manohar2u</dc:creator>
    <dc:date>2006-06-07T15:31:04Z</dc:date>
    <item>
      <title>Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373758#M183558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 15:11:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373758#M183558</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T15:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373759#M183559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the function group you have created there will be Custom includes where you can write your authority checks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 15:23:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373759#M183559</guid>
      <dc:creator>varun_maharshi</dc:creator>
      <dc:date>2006-06-07T15:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373760#M183560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For doing validations you need to make use of modification event &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;01	Before saving the data in the database&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to link for list of events available&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_47x200/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm"&amp;gt;Extended Table Maintenance Events&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To control with authorization please refer to the link below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_47x200/helpdata/en/a7/5134d2407a11d1893b0000e8323c4f/frameset.htm"&amp;gt;Maintain authorization groups&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to this blog for event creations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;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"&amp;gt;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&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 15:31:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373760#M183560</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-06-07T15:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373761#M183561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manohar,&lt;/P&gt;&lt;P&gt;Any examples for that 01 Event how to write the validations in it??..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance, &lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 15:58:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373761#M183561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T15:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373762#M183562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have an example in this link below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_47x200/helpdata/en/91/ca9f0ba9d111d1a5690000e82deaaa/frameset.htm"&amp;gt;Event 01: Before Saving the Data in the Database&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code from example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM abc.
DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
LOOP AT TOTAL.
IF &amp;lt;ACTION&amp;gt; = desired constant.
READ TABLE EXTRACT WITH KEY &amp;lt;vim_xtotal_key&amp;gt;.
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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 16:14:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373762#M183562</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-06-07T16:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373763#M183563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manohar,&lt;/P&gt;&lt;P&gt;Thanks for ur help so far..when i click on this event, an include program will come up and u mean i should write a routine with all the validations within that routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 16:23:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373763#M183563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T16:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373764#M183564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, In that include program you should start like this,have written sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;form VALIDATION.
  DATA: F_INDX LIKE SY-TABIX. "Index to note the lines found
  LOOP AT TOTAL.
    IF &amp;lt;ACTION&amp;gt; = 'U' or &amp;lt;ACTION&amp;gt; = 'I'.
      READ TABLE EXTRACT WITH KEY &amp;lt;vim_xtotal_key&amp;gt;.
      IF SY-SUBRC EQ 0.
        F_INDX = 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.


  loop at extract.

    if extract+3(4) ne 'Mano'.

      message s001(zfin) with 'Invalid entry'.
      vim_abort_saving = 'x'.
      exit.
    endif.
  endloop.
endform.                    "VALIDATION&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 16:37:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373764#M183564</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-06-07T16:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373765#M183565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manohar,&lt;/P&gt;&lt;P&gt;So in ur sample code u mean that Extract contains all the fields in the table and wat does ur statement Extract+3(4) is exactly checking there??..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 16:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373765#M183565</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T16:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373766#M183566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also do this way, as i did for testing purpose &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : l_ytest like ytest.
  loop at extract.
   l_ytest = extract.
    if l_ytest-FIEL1 ne 'Mano'.

      message s001(zfin) with 'Invalid entry'.
      vim_abort_saving = 'x'.
      exit.
    endif.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 16:50:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373766#M183566</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-06-07T16:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373767#M183567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the example I gave in this &lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="158220"&gt;&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 17:06:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373767#M183567</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T17:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373768#M183568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivas,&lt;/P&gt;&lt;P&gt;I am bit confused with the code..Can you explain me what exactly you are doing in that code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 17:27:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373768#M183568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T17:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373769#M183569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of validations as you wanted to do, in my code I am actually filling in the modified by, modified on date/time fields of the table automatically. But the reason for asking you to look at the code is to showcase the structure of the TOTAL and EXTRACT internal tables that are available to you in the events. They are of the structure your Z table plus the "vimtbflags" structure. If you look at the constants I used (aendern or neuer_eintrag),  these are actually constants that are already available to you at that point. Replace 'zztable' with your Z table name, and remove the code where I am updating the fields. You can check the other constants.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another reason for declaring these local variables is to refer to the fields by their field names rather than the offsets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 17:39:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373769#M183569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T17:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373770#M183570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this code for checking if there are blank values for fields of a Z table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM check_for_blank_keyfields.

  DATA: l_field_is_blank.
  DATA: BEGIN OF s_zztable.
          INCLUDE STRUCTURE zztable.
          INCLUDE STRUCTURE vimtbflags.
  DATA: END OF s_zztable.

  LOOP AT total.
    CLEAR s_zztable.
    MOVE total TO s_zztable.
    CHECK s_zztable-vim_action &amp;lt;&amp;gt; neuer_geloescht
      AND s_zztable-vim_action &amp;lt;&amp;gt; update_geloescht
      AND s_zztable-vim_action &amp;lt;&amp;gt; dummy_geloescht.
    IF s_zztable-field1 IS INITIAL OR
       s_zztable-field2 IS INITIAL.
      l_field_is_blank = 'X'.
      EXIT.
    ENDIF.
  ENDLOOP.

  IF l_field_is_blank = 'X'.
    MESSAGE i000 WITH 'Both values should be filled in.'.
    sy-subrc = 4.
  ELSE.
    sy-subrc = 0.
  ENDIF.
  CLEAR l_field_is_blank.

ENDFORM.                  " CHECK_FOR_BLANK_KEYFIELDS
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 17:44:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373770#M183570</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T17:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373771#M183571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivas,&lt;/P&gt;&lt;P&gt;Can yo u tell me like if there is a field ZStart_date in my table ztable. I want to make sure that the user doesn't enter an invalid date that is the date should not be one already passed or it should be 06/07/2006 or above.Can you tell me how we can modify the above code for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot for all ur help,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 19:08:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373771#M183571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T19:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373772#M183572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you are looking for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM check_for_past_date.
 
  DATA: l_date_in_past.
  DATA: BEGIN OF s_zztable.
          INCLUDE STRUCTURE zztable.
          INCLUDE STRUCTURE vimtbflags.
  DATA: END OF s_zztable.
 
  LOOP AT total.
    CLEAR s_zztable.
    MOVE total TO s_zztable.
    IF s_zztable-&amp;lt;b&amp;gt;zstart_date&amp;lt;/b&amp;gt; &amp;lt; sy-datum.
      l_field_is_blank = 'X'.
      EXIT.
    ENDIF.
  ENDLOOP.
 
  IF l_date_in_past = 'X'.
    MESSAGE i000 WITH 'At least one record start date is in the past'.
    sy-subrc = 4.
  ELSE.
    sy-subrc = 0.
  ENDIF.
  CLEAR l_date_in_past.
 
ENDFORM.                  " CHECK_FOR_PAST_DATE&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually you don't need to check whether the user is modifying, inserting deleting or viewing the data. You need this check all the time. So I removed the check statement for those german constants!!!&lt;/P&gt;&lt;P&gt;Message was edited by: Srinivas Adavi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 19:16:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373772#M183572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T19:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373773#M183573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivas,&lt;/P&gt;&lt;P&gt;Thanks alot for all your help so far..Actually i have to do the following i have to validate fields like G/L Account, start date, enddate and some custom fields just to make sure user doesn't enter any incorrect data. Also i have to restrict the access to table to only those users that are authorized i.e. depending on the role. So my other question is as a developer are we supposed to take care of it or the basis guys will create the authorization group and i need to just use that group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot again for all ur help..I just want to close this topic once i am cleared on these doubts..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 19:27:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373773#M183573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T19:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373774#M183574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SM30 is a wide open transaction and you cannot restrict to specific table access to specific users. Yes, if your basis team can create a new authorization group that is used specifically by this table and you put that in your table maintenance generator, then you don't need to do anything in the events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another alternative that we used is to create a new authorization object (as opposed to group) which also takes a table name as input. Then we used event 25 to check if the user has this authorization for this table using AUTHORITY-CHECK statement. The flexibility we got with this new object is that we can use the same check for all the Z tables and for all actions(display, update etc). Basis will use this object in their roles with the table name and the action, and in the event we check for that authorization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srinivas Adavi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please don't forget to close the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 19:34:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373774#M183574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T19:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373775#M183575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Srinivas,&lt;/P&gt;&lt;P&gt;SOrry for bugging you like this..But can you tell me how we can create this authorization object. And also how we can perform this Authorization check using this object within that event 25, may be a sample code if you have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot and sorry again for so many questions but i am not clear yet..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 19:41:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373775#M183575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T19:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373776#M183576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create authorization groups using transaction SE54.&lt;/P&gt;&lt;P&gt;You have to assign this authorization group to the table.&lt;/P&gt;&lt;P&gt;The basis with create some authorization based on the authorization group and they will assign them to the profiles of the users. Only those users will have access to work with those tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it goes by authorization object, the authorization object have some authorization field. You may have the table name as one of the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code looks like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*check authorization &lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK OBJECT 'ZXXXX'&lt;/P&gt;&lt;P&gt;         ID 'Z_TABLE'  FIELD lv_user&lt;/P&gt;&lt;P&gt;         ID 'ACTVT'    FIELD lv_activity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Naren Somen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 19:48:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373776#M183576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T19:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Do validations on fields while User enters data thru SM30</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373777#M183577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naren,&lt;/P&gt;&lt;P&gt;Actually i wanted more info on the second option from Srinivas where we can create autorization objects and performs checks on individuals. I am not sure if our Basis guys will create a seperate authorization group for my tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jun 2006 19:52:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-validations-on-fields-while-user-enters-data-thru-sm30/m-p/1373777#M183577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-07T19:52:32Z</dc:date>
    </item>
  </channel>
</rss>

