<?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: Pre Database Insert / Update Validation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pre-database-insert-update-validation/m-p/5855984#M1320586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't agree with the design but if you want to do it anyway it can be done using &lt;STRONG&gt;Events&lt;/STRONG&gt; in the Maintenance View.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you've generated the Maintenance View of your Z table, within SE11 pull out menubar &lt;STRONG&gt;Utilities-&amp;gt;Table Maintenance Generator&lt;/STRONG&gt;, then menubar &lt;STRONG&gt;Environment-&amp;gt;Modifcation-&amp;gt;Events&lt;/STRONG&gt;. Create New Entries and I think for your requirement you would need 2 entries - one at event 05 and another at event 18. Input the name of your routine and write the code by clicking its corresponding button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is an example of a scenario where text of an object is retrieved and filled into the view display-only column according to user input of its related object id - for your requirement you would validate the user input after checking the input values in your existing table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form fill_text_05.

  data begin of w_total.
          include structure zfv_fbt_acct_rel.
  data: action,
        mark,
  end of w_total.
  data: w_extract type zfv_fbt_acct_rel.

  clear: zfv_fbt_acct_rel-fbt_rel_acc_txt,
         zfv_fbt_acct_rel-fbt_cost_grp_txt.

* populate GL a/c text
  select txt50 up to 1 rows
         from skat
         into zfv_fbt_acct_rel-fbt_rel_acc_txt
         where spras = sy-langu
         and   saknr = zfv_fbt_acct_rel-fbt_rel_acc.
  endselect.

* populate Cost Group text
  select single fbt_cost_grp_txt
         from  zft_fbt_cost_grp
         into  zfv_fbt_acct_rel-fbt_cost_grp_txt
         where company_code = zfv_fbt_acct_rel-company_code
         and   fbt_cost_grp = zfv_fbt_acct_rel-fbt_cost_grp.

  if sy-subrc &amp;lt;&amp;gt; 0.
    message e074(zf_enhancements) with zfv_fbt_acct_rel-company_code.
  endif.

endform.                    "fill_text_05
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Sougata.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jul 2009 03:41:43 GMT</pubDate>
    <dc:creator>Sougata</dc:creator>
    <dc:date>2009-07-27T03:41:43Z</dc:date>
    <item>
      <title>Pre Database Insert / Update Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pre-database-insert-update-validation/m-p/5855983#M1320585</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;I have a maintenance view that allow user to insert / update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say, z_my_table is my table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;key1&lt;/P&gt;&lt;P&gt;key2&lt;/P&gt;&lt;P&gt;field1&lt;/P&gt;&lt;P&gt;field2&lt;/P&gt;&lt;P&gt;field3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to validate whether field1, field2, field3 whether exist in my table before insert / update.&lt;/P&gt;&lt;P&gt;However, due to some restriction, I cannot make it as part of the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is, how can I capture OR validate it before the data get inserted into the table ?&lt;/P&gt;&lt;P&gt;I checked some online help, and found that suggestion is to write a function module OR enhancement point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wonder what is the common practice and how should I do it ? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2009 03:15:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pre-database-insert-update-validation/m-p/5855983#M1320585</guid>
      <dc:creator>former_member998274</dc:creator>
      <dc:date>2009-07-27T03:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Pre Database Insert / Update Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pre-database-insert-update-validation/m-p/5855984#M1320586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't agree with the design but if you want to do it anyway it can be done using &lt;STRONG&gt;Events&lt;/STRONG&gt; in the Maintenance View.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you've generated the Maintenance View of your Z table, within SE11 pull out menubar &lt;STRONG&gt;Utilities-&amp;gt;Table Maintenance Generator&lt;/STRONG&gt;, then menubar &lt;STRONG&gt;Environment-&amp;gt;Modifcation-&amp;gt;Events&lt;/STRONG&gt;. Create New Entries and I think for your requirement you would need 2 entries - one at event 05 and another at event 18. Input the name of your routine and write the code by clicking its corresponding button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is an example of a scenario where text of an object is retrieved and filled into the view display-only column according to user input of its related object id - for your requirement you would validate the user input after checking the input values in your existing table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form fill_text_05.

  data begin of w_total.
          include structure zfv_fbt_acct_rel.
  data: action,
        mark,
  end of w_total.
  data: w_extract type zfv_fbt_acct_rel.

  clear: zfv_fbt_acct_rel-fbt_rel_acc_txt,
         zfv_fbt_acct_rel-fbt_cost_grp_txt.

* populate GL a/c text
  select txt50 up to 1 rows
         from skat
         into zfv_fbt_acct_rel-fbt_rel_acc_txt
         where spras = sy-langu
         and   saknr = zfv_fbt_acct_rel-fbt_rel_acc.
  endselect.

* populate Cost Group text
  select single fbt_cost_grp_txt
         from  zft_fbt_cost_grp
         into  zfv_fbt_acct_rel-fbt_cost_grp_txt
         where company_code = zfv_fbt_acct_rel-company_code
         and   fbt_cost_grp = zfv_fbt_acct_rel-fbt_cost_grp.

  if sy-subrc &amp;lt;&amp;gt; 0.
    message e074(zf_enhancements) with zfv_fbt_acct_rel-company_code.
  endif.

endform.                    "fill_text_05
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Sougata.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2009 03:41:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pre-database-insert-update-validation/m-p/5855984#M1320586</guid>
      <dc:creator>Sougata</dc:creator>
      <dc:date>2009-07-27T03:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Pre Database Insert / Update Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pre-database-insert-update-validation/m-p/5855985#M1320587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ... I will try it out and let you know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My initial thought is, if i do it in enhancement point, my code will be gone once I generated the objects.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2009 04:12:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pre-database-insert-update-validation/m-p/5855985#M1320587</guid>
      <dc:creator>former_member998274</dc:creator>
      <dc:date>2009-07-27T04:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Pre Database Insert / Update Validation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pre-database-insert-update-validation/m-p/5855986#M1320588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got an information like :&lt;/P&gt;&lt;P&gt;Do Not Make Any Changes ( SAP data )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I press Ok and presented a screen like ALV with 3 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM routines to be called from view maintenance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T , FORM routine, Editor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I press the drop down for T, I saw what you mean by 05. It is an event for - Creating New Entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I pressed the Editor and presented a list of options for INCLUDE to create the SUBROUTINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need that ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2009 06:23:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pre-database-insert-update-validation/m-p/5855986#M1320588</guid>
      <dc:creator>former_member998274</dc:creator>
      <dc:date>2009-07-27T06:23:04Z</dc:date>
    </item>
  </channel>
</rss>

