<?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 in table maintainance generator in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/in-table-maintainance-generator/m-p/3312068#M793268</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;in table maintainance generator, how to validate the data entered in the table. If it is only with the events, how?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Feb 2008 08:53:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-05T08:53:21Z</dc:date>
    <item>
      <title>in table maintainance generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/in-table-maintainance-generator/m-p/3312068#M793268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;in table maintainance generator, how to validate the data entered in the table. If it is only with the events, how?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2008 08:53:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/in-table-maintainance-generator/m-p/3312068#M793268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-05T08:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: in table maintainance generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/in-table-maintainance-generator/m-p/3312069#M793269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;depends off what you would like to validate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it's a format problem, you could use field-exit (maintain in the domain level)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2008 09:02:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/in-table-maintainance-generator/m-p/3312069#M793269</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2008-02-05T09:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: in table maintainance generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/in-table-maintainance-generator/m-p/3312070#M793270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can validate the data in tables, after generating a table maintanance generator. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Environment-&amp;gt;Modification-&amp;gt;Events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After providing the subroutine name you can go to editor( click on icon provided just besides the form routine) and write the logic for validation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example, if changes are to be made to the data of particular controlling area, a check has to be made if the user is authorised to make changes. Below is a sample code that would give you an idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  auth_check_save&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Checks that the user has the correct authorisations to Change&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      details of Controlling Area. If not error message is to be&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      displayed on the screen.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form auth_check_save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data Declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Types&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  types:  begin of ty_valtab,&lt;/P&gt;&lt;P&gt;           kokrs(4) type c,&lt;/P&gt;&lt;P&gt;           actvt(2) type c,&lt;/P&gt;&lt;P&gt;         end of ty_valtab,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         begin of ty_fieldtab,&lt;/P&gt;&lt;P&gt;           fieldname(10) type c,&lt;/P&gt;&lt;P&gt;         end of ty_fieldtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal Tables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data:  lt_valtab    type standard table of ty_valtab,&lt;/P&gt;&lt;P&gt;         lt_fieldtab  type standard table of ty_fieldtab,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Structures&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         ls_valtab    type ty_valtab,&lt;/P&gt;&lt;P&gt;         ls_fieldtab  type ty_fieldtab,&lt;/P&gt;&lt;P&gt;         ls_costele   type ztf_costele,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Variables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         l_status     type zss_rfc_status,&lt;/P&gt;&lt;P&gt;         l_st(1)      type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Constants&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  constants : c_0(1)        type c value '0',&lt;/P&gt;&lt;P&gt;              c_01(2)       type c value '01',&lt;/P&gt;&lt;P&gt;              c_02(2)       type c value '02',&lt;/P&gt;&lt;P&gt;              c_06(2)       type c value '06',&lt;/P&gt;&lt;P&gt;              c_authobj(10) type c value 'Z_KOKRS',&lt;/P&gt;&lt;P&gt;              c_error(5)    type c value 'ERROR',&lt;/P&gt;&lt;P&gt;              c_partial(7)  type c value 'PARTIAL',&lt;/P&gt;&lt;P&gt;              c_kokrs(5)    type c value 'KOKRS',&lt;/P&gt;&lt;P&gt;              c_actvt(5)    type c value 'ACTVT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear l_status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ls_fieldtab-fieldname = c_kokrs.&lt;/P&gt;&lt;P&gt;  append ls_fieldtab to lt_fieldtab.&lt;/P&gt;&lt;P&gt;  clear ls_fieldtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ls_fieldtab-fieldname = c_actvt.&lt;/P&gt;&lt;P&gt;  append ls_fieldtab to lt_fieldtab.&lt;/P&gt;&lt;P&gt;  clear ls_fieldtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if &amp;lt;action&amp;gt; eq neuer_eintrag.&lt;/P&gt;&lt;P&gt;      move total to ls_costele.&lt;/P&gt;&lt;P&gt;      ls_valtab-kokrs = ls_costele-kokrs.&lt;/P&gt;&lt;P&gt;      ls_valtab-actvt = c_01.&lt;/P&gt;&lt;P&gt;      append ls_valtab to lt_valtab.&lt;/P&gt;&lt;P&gt;      clear  ls_valtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    elseif &amp;lt;action&amp;gt; eq aendern.&lt;/P&gt;&lt;P&gt;      move total to ls_costele.&lt;/P&gt;&lt;P&gt;      ls_valtab-kokrs = ls_costele-kokrs.&lt;/P&gt;&lt;P&gt;      ls_valtab-actvt = c_02.&lt;/P&gt;&lt;P&gt;      append ls_valtab to lt_valtab.&lt;/P&gt;&lt;P&gt;      clear  ls_valtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    elseif &amp;lt;action&amp;gt; eq geloescht.&lt;/P&gt;&lt;P&gt;      move total to ls_costele.&lt;/P&gt;&lt;P&gt;      ls_valtab-kokrs = ls_costele-kokrs.&lt;/P&gt;&lt;P&gt;      ls_valtab-actvt = c_06.&lt;/P&gt;&lt;P&gt;      append ls_valtab to lt_valtab.&lt;/P&gt;&lt;P&gt;      clear  ls_valtab.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Authorization Check&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'ZAUTH_CHECK'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  PIM_REPID               =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    pim_auth_obj            = c_authobj&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  PIM_FIELD_TABNAME       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  PIM_CHECKALL            =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   importing&lt;/P&gt;&lt;P&gt;     pex_status              = l_status&lt;/P&gt;&lt;P&gt;   tables&lt;/P&gt;&lt;P&gt;     pex_val_tab             = lt_valtab&lt;/P&gt;&lt;P&gt;     pim_field_tab           = lt_fieldtab&lt;/P&gt;&lt;P&gt;   exceptions&lt;/P&gt;&lt;P&gt;     no_input                = 1&lt;/P&gt;&lt;P&gt;     others                  = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if  l_status = c_error.        "Authorization Check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  message under class: zmessclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    message e000(zmessclass) with text-e02.  "You have no authorization&lt;/P&gt;&lt;P&gt;                                            "for table maintenance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  elseif l_status = c_partial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at total.&lt;/P&gt;&lt;P&gt;      if &amp;lt;action&amp;gt; ne space.&lt;/P&gt;&lt;P&gt;        move total to ls_costele.&lt;/P&gt;&lt;P&gt;        read table lt_valtab with key kokrs = ls_costele-kokrs&lt;/P&gt;&lt;P&gt;                             transporting no fields.&lt;/P&gt;&lt;P&gt;        if sy-subrc &amp;lt;&amp;gt; c_0.&lt;/P&gt;&lt;P&gt;          delete table total.&lt;/P&gt;&lt;P&gt;          delete table extract.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    message e400(zmessclass).    "All the entries could not be saved&lt;/P&gt;&lt;P&gt;                                "because of  restricted authorization&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endif.                        "End of Authorization Check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    "auth_check_save&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code should be written in event  &lt;STRONG&gt;01  : Before saving the data in the database&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Farheen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2008 10:38:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/in-table-maintainance-generator/m-p/3312070#M793270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-05T10:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: in table maintainance generator</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/in-table-maintainance-generator/m-p/3312071#M793271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;There are 2 methods for validating the data. &lt;/P&gt;&lt;P&gt;One is by using events and the other chnaging the function group includes. &lt;/P&gt;&lt;P&gt;These function group is the group which is entered in SE54 Transaction. &lt;/P&gt;&lt;P&gt;If you see the function group, you see&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  include-files generated by view maintenance tool     &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    PBO &lt;/P&gt;&lt;P&gt;    PAI&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  User-defined Include-files (if necessary).                    *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Decide where you want to validate, i mean in PBO or PAI. &lt;/P&gt;&lt;P&gt;Then comment out the corresponding PBO or PAI and copy the code to user defined includes. Then make the necessary changes.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: there is a big disadvantage of using this technique. When any one regenerates the table maintainenace, then all the changes which you made will be lost.. Hence always use Events. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is what you are looking for, please reward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Sree&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2008 11:07:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/in-table-maintainance-generator/m-p/3312071#M793271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-05T11:07:16Z</dc:date>
    </item>
  </channel>
</rss>

