<?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: Default values in table maintainance disappear when a wrong entry is given in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934283#M1333469</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;Please check the events associated with this table.. And check how they are handling the pop-up.. Maybe they are clearing all the fields one you click on OK.. Check this and do the necessary changes..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jul 2009 04:49:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-10T04:49:12Z</dc:date>
    <item>
      <title>Default values in table maintainance disappear when a wrong entry is given</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934278#M1333464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Requirement says for a particular field in a table, default values should appear when new entries tab is clicked.&lt;/P&gt;&lt;P&gt;This has been achieved by adding a module under PBO of the function group of the table maintainance generator.&lt;/P&gt;&lt;P&gt;__________________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF FUNCTION = 'SAVE' or FUNCTION = 'NEWL' .&lt;/P&gt;&lt;P&gt;ztest_term-plant = 'MX01'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;__________________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this code works when new entries button or SAVE button is clicked.&lt;/P&gt;&lt;P&gt;The issue is there is a date field in this table.If the format of the date is wrong it throws a system error as we know.&lt;/P&gt;&lt;P&gt;So when the system error araises it gives a pop-up asking us whether we want to cancel or not.&lt;/P&gt;&lt;P&gt;When 'YES' in the pop-up is choosen, the default entries disappear which should not happen.&lt;/P&gt;&lt;P&gt;Even when an error pops up the default values should remain as it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest how this issue can be solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 10:07:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934278#M1333464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-09T10:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Default values in table maintainance disappear when a wrong entry is given</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934279#M1333465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;why dont you use exception in that case.&lt;/P&gt;&lt;P&gt;try to catch that error exception yourself and just display a custom message....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will surely help you!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Punit Raval.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 11:09:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934279#M1333465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-09T11:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Default values in table maintainance disappear when a wrong entry is given</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934280#M1333466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Punit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;But i couldnt get what your trying to say.&lt;/P&gt;&lt;P&gt;Can you please explain it more clearly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 11:30:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934280#M1333466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-09T11:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Default values in table maintainance disappear when a wrong entry is given</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934281#M1333467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;see when the save button gets clicked a pai module will get triggered ... now the problem arises when the date format is not proper and so it throws an system exception... so what i mean to say is that you enclose that pai module in try and catch block and try to get the name of the exception which is being thrown and then catch that exception and write your handler statement &lt;/P&gt;&lt;P&gt;in the catch block...... means you are going to process the exception now....&lt;/P&gt;&lt;P&gt;also according to your problem ... what you do is just display simple warning message on the screen like the date format is not correct..&lt;/P&gt;&lt;P&gt;also check out how to catch the runtime exception for reference :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/cf/f2bbce142c11d3b93a0000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/cf/f2bbce142c11d3b93a0000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will surely help you!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;punit raval.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 11:48:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934281#M1333467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-09T11:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Default values in table maintainance disappear when a wrong entry is given</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934282#M1333468</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;Insetad of writing in PBO.. once you try writing all these default values and date in events of table maintainance geneator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Table maintainance generator, follow the below path,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Environment -- Modification --- events..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there create an event for &lt;STRONG&gt;01	Before saving the data in the database&lt;/STRONG&gt;  and  &lt;STRONG&gt;05	Creating a new entry&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give some form names against the event and create it and save in an include..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now write code by writing the form as shown below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below thing is for code 01 i.e. &lt;STRONG&gt;Before saving the data in the database&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&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;***INCLUDE LYMTID_E136_MATPRF01 .&lt;/P&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 ztest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : BEGIN OF ls_access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          INCLUDE STRUCTURE Ztable.  " Table name.&lt;/P&gt;&lt;P&gt;  DATA : indicator TYPE c,&lt;/P&gt;&lt;P&gt;         END OF ls_access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT total INTO ls_access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CASE ls_access-indicator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN 'N'.         "" this ehile creating new entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CREATED BY&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        ls_access-modified_by  = sy-uname.    " passing user name  value into one of the fields of the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CREATED DATE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        ls_access-modify_date  =  sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MODIFY total FROM ls_access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      WHEN 'U'.      "Update   " this is when updating an existing entry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CHANGED BY&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        ls_access-modified_by  = sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CHANGED DATE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        ls_access-modify_date  =  sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MODIFY total FROM ls_access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.                    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In above code TOTAL is global variable and it contains all teh newly enetered and existing entries.So you can directly hard code your values inrequired fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and of 05 i..e &lt;STRONG&gt;Creating a new entry&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To display some error messages like :&lt;/P&gt;&lt;P&gt;If some field is initial , then throw error. wrie code in 05 event&lt;/P&gt;&lt;P&gt;&lt;/P&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;&lt;/P&gt;&lt;P&gt;Thnaks ,&lt;/P&gt;&lt;P&gt;Srilakshmi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 15:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934282#M1333468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-09T15:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Default values in table maintainance disappear when a wrong entry is given</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934283#M1333469</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;Please check the events associated with this table.. And check how they are handling the pop-up.. Maybe they are clearing all the fields one you click on OK.. Check this and do the necessary changes..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2009 04:49:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934283#M1333469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-10T04:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Default values in table maintainance disappear when a wrong entry is given</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934284#M1333470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already tried with events and it didn't work. So had to go for coding in PBO.&lt;/P&gt;&lt;P&gt;And moreover the issue is that whenever there is some error while maitaining values in table, after clicking on yes in the pop-up the values in the current record get refreshed. But the requirement says one value should remain by default even after error pops up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 04:12:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/default-values-in-table-maintainance-disappear-when-a-wrong-entry-is-given/m-p/5934284#M1333470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T04:12:41Z</dc:date>
    </item>
  </channel>
</rss>

