<?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: Table maintenance Validations in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357068#M178039</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 ca do this validations in the events part of Table Maintenance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chk out this link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 May 2006 08:37:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-24T08:37:35Z</dc:date>
    <item>
      <title>Table maintenance Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357066#M178037</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;&lt;/P&gt;&lt;P&gt;I created a table with 2 fields, also created a maintenance generator. Now my requirement is i need to have 1-1 relation with the fields, what i mean is, no value can repeat with in either of the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to validate this condition. &lt;/P&gt;&lt;P&gt;Suppose user enters a value 1234 in first field, again if he enters the same, i need to throw a error message.&lt;/P&gt;&lt;P&gt;I went to transaction SE54, the following is the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS BEFORE OUTPUT.&lt;/P&gt;&lt;P&gt;  MODULE liste_initialisieren.&lt;/P&gt;&lt;P&gt;  LOOP AT extract WITH CONTROL&lt;/P&gt;&lt;P&gt;   tctrl_zzbank CURSOR nextline.&lt;/P&gt;&lt;P&gt;    MODULE liste_show_liste.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;PROCESS AFTER INPUT.&lt;/P&gt;&lt;P&gt;  MODULE liste_exit_command AT EXIT-COMMAND.&lt;/P&gt;&lt;P&gt;  MODULE liste_before_loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT extract.&lt;/P&gt;&lt;P&gt;    MODULE liste_init_workarea.&lt;/P&gt;&lt;P&gt;    CHAIN.&lt;/P&gt;&lt;P&gt;      FIELD zzbank-zzau1.&lt;/P&gt;&lt;P&gt;      FIELD zzbank-hbkid.&lt;/P&gt;&lt;P&gt;      MODULE set_update_flag ON CHAIN-REQUEST.&lt;/P&gt;&lt;P&gt;    ENDCHAIN.&lt;/P&gt;&lt;P&gt;    FIELD vim_marked MODULE liste_mark_checkbox.&lt;/P&gt;&lt;P&gt;    CHAIN.&lt;/P&gt;&lt;P&gt;      FIELD zzbank-zzau1.&lt;/P&gt;&lt;P&gt;      MODULE liste_update_liste.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDCHAIN.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  MODULE liste_after_loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;  MODULE check_dupe.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the line in bold is what i added, how do i proceed from here, could anyone please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2006 08:26:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357066#M178037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-24T08:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Table maintenance Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357067#M178038</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;if I understand right, I think its easier to declare both fields as key fields, so that SAP automatically will not allow saving records that are allready in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you mean, one value is not to be accepted in either field, no matter what the value for the other field is ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD1    FIELD2&lt;/P&gt;&lt;P&gt;111       222&lt;/P&gt;&lt;P&gt;444       555&lt;/P&gt;&lt;P&gt;222       333         &amp;lt;- not valid ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in that case, user SEARCH in your table for the current value and if SY-SUBRC = 0, then the value exists allready.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2006 08:36:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357067#M178038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-24T08:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Table maintenance Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357068#M178039</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 ca do this validations in the events part of Table Maintenance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chk out this link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2006 08:37:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357068#M178039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-24T08:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Table maintenance Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357069#M178040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;goto se54--view name-meny bar-environment-modification...&lt;/P&gt;&lt;P&gt;n write ur piece of code...in the relevant code..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2006 12:56:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357069#M178040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-24T12:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Table maintenance Validations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357070#M178041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deepti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Jorge Alonso said, if you declare both fields as key fields then SAP will take care of the validation and raise a error message .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming both fields are key fields, if the records are like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;111 222&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;111 222&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then SAP will raise a error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, if you don't want first or second field to be repeated any where again, then include the code in your check_dupe module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET CURSOR LINE &amp;lt;lin&amp;gt; or GET CURSOR FIELD &amp;lt;f&amp;gt; LINE &amp;lt;lin&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ztable into itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;if itab-first_field CS table_first_field  or itab-first_field CS table_second_field or itab-second_field CS table_first_field or itab-second_field CS table_second_field.&lt;/P&gt;&lt;P&gt;If sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE E0004 WITH 'Duplicate key'.&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;Hope this will help you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vicky&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Award points if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2006 13:38:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-maintenance-validations/m-p/1357070#M178041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-24T13:38:54Z</dc:date>
    </item>
  </channel>
</rss>

