<?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: Issue with Table Maintenance Generator event in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771864#M1584636</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;Finally i implemented the requirement.&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;changed by&lt;/STRONG&gt; field is now programatically added with user name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is same as above except for a statement which put me in lot of trouble and found it after several debugging recursions.&lt;/P&gt;&lt;P&gt;      &amp;lt;action&amp;gt; = 'U'.&lt;/P&gt;&lt;P&gt;      MODIFY total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before modify total the statement    &amp;lt;action&amp;gt; = 'U'. needs to be added.&lt;/P&gt;&lt;P&gt;after modify the &lt;EM&gt;&amp;lt;action&amp;gt;&lt;/EM&gt; was changed because of which it was not saving to database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the support and i hope this issue will be a reference for those who wish to modify TMG entries before save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ilyas Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Apr 2011 17:27:12 GMT</pubDate>
    <dc:creator>ilyasahmed</dc:creator>
    <dc:date>2011-04-08T17:27:12Z</dc:date>
    <item>
      <title>Issue with Table Maintenance Generator event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771858#M1584630</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;I have a requirement in TMG to have fields  Created by and &lt;STRONG&gt;changed by&lt;/STRONG&gt; filled programmatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created TMG and was able to implement created by field with username using event no 5 i.e. create a new entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue i have is with field &lt;U&gt;Changed by&lt;/U&gt;. When a user edits an entry or several entries i need to add the user name in Changed by field. I am unable to implement this step. I tried with event 18  i.e. After checking whether the data has changed, but i get only the last record in structure.&lt;/P&gt;&lt;P&gt;&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;Ilyas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2011 16:58:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771858#M1584630</guid>
      <dc:creator>ilyasahmed</dc:creator>
      <dc:date>2011-04-07T16:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Table Maintenance Generator event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771859#M1584631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, have been using event AB (database changes) for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parts of my coding are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM event_ab.

LOOP AT total.
CHECK &amp;lt;action&amp;gt; IS NOT INITIAL.

ASSIGN COMPONENT 'AEDAT' OF STRUCTURE total TO &amp;lt;zlv_aedat&amp;gt;.
&amp;lt;zlv_aedat&amp;gt; = syst-datum.

ENDLOOP.
PERFORM db_upd_zvmemvbrp.

ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Jack&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2011 17:43:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771859#M1584631</guid>
      <dc:creator>JackGraus</dc:creator>
      <dc:date>2011-04-07T17:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Table Maintenance Generator event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771860#M1584632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I have a requirement in TMG to have fields  Created by and &lt;STRONG&gt;changed by&lt;/STRONG&gt; filled programmatically.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I created TMG and was able to implement created by field with username using event no 5 i.e. create a new entry.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The issue i have is with field &lt;U&gt;Changed by&lt;/U&gt;. When a user edits an entry or several entries i need to add the user name in Changed by field. I am unable to implement this step. I tried with event 18  i.e. After checking whether the data has changed, but i get only the last record in structure.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Thanks,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Ilyas&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;05 should be alright.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the same in View... Here is the code you need to add in the form routine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assuming my view name is: yview_v &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yview_v-changed_by = sy-uname. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That simple step will add the user name who changed the object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2011 19:17:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771860#M1584632</guid>
      <dc:creator>former_member191735</dc:creator>
      <dc:date>2011-04-07T19:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Table Maintenance Generator event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771861#M1584633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ahmed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you provide the part of code which is not working in event "05"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramnivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 08:51:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771861#M1584633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-08T08:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Table Maintenance Generator event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771862#M1584634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ilyas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why don't you use the Event 01(Before Saving the Data in the Database) for this purpose? Read this documentation for further details: [Event 01: Before Saving the Data in the Database|http://help.sap.com/saphelp_nw04/helpdata/en/91/ca9f0ba9d111d1a5690000e82deaaa/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Others: I have never tried it though. But will Event 05(When Creating a New Entry) trigger if you change a field value? As per SAP: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;This event occurs when a new entry is made with the function 'New entry' or 'Copy'&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 09:33:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771862#M1584634</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2011-04-08T09:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Table Maintenance Generator event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771863#M1584635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi i have added below code in event 01 i.e before saving to DB.&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;    READ TABLE extract WITH KEY &amp;lt;vim_xtotal_key&amp;gt;.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      f_indx = sy-tabix.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      CLEAR f_indx.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF &amp;lt;action&amp;gt; = 'U'.    "Entry changed&lt;/P&gt;&lt;P&gt;*added code to capture changed by&lt;/P&gt;&lt;P&gt;      MODIFY total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CHECK f_indx GT 0.&lt;/P&gt;&lt;P&gt;      extract = total.&lt;/P&gt;&lt;P&gt;      MODIFY extract INDEX f_indx.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code is displaying the changed by with user name on the SM30 screen as intended.&lt;/P&gt;&lt;P&gt;But the issue is its not saving to database. the changes done along with other fields is not saved to database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i comment the code in the event 01, i get the changes saved.  &lt;/P&gt;&lt;P&gt;Is there any field that needs to be set in order to save the changes in database.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 14:14:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771863#M1584635</guid>
      <dc:creator>ilyasahmed</dc:creator>
      <dc:date>2011-04-08T14:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Table Maintenance Generator event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771864#M1584636</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;Finally i implemented the requirement.&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;changed by&lt;/STRONG&gt; field is now programatically added with user name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is same as above except for a statement which put me in lot of trouble and found it after several debugging recursions.&lt;/P&gt;&lt;P&gt;      &amp;lt;action&amp;gt; = 'U'.&lt;/P&gt;&lt;P&gt;      MODIFY total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before modify total the statement    &amp;lt;action&amp;gt; = 'U'. needs to be added.&lt;/P&gt;&lt;P&gt;after modify the &lt;EM&gt;&amp;lt;action&amp;gt;&lt;/EM&gt; was changed because of which it was not saving to database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the support and i hope this issue will be a reference for those who wish to modify TMG entries before save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ilyas Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 17:27:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-table-maintenance-generator-event/m-p/7771864#M1584636</guid>
      <dc:creator>ilyasahmed</dc:creator>
      <dc:date>2011-04-08T17:27:12Z</dc:date>
    </item>
  </channel>
</rss>

