<?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: Code Dilemma in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914346#M1147124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you have given,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.&lt;/P&gt;&lt;P&gt;Read table lt_profit_Ctr with key PROFIT_CTR = /BI0/MPROFIT_CTR.&lt;/P&gt;&lt;P&gt;if sy-subrc 0 or lt_profit_Ctr-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt;RESULT = SY-DATUM.&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if there is a entry then sy-subrc will be '0' and the next part will be executed irrespective of your &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;lt_profit_Ctr-CALDAY IS INITIAL'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you need is when sy-subrc = 0 then check for the condition 'lt_profit_Ctr-CALDAY IS INITIAL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can write either &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-subrc 0.
 if lt_profit_Ctr-CALDAY IS INITIAL.
   RESULT = SY-DATUM.
 endif.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-subrc 0 AND lt_profit_Ctr-CALDAY IS INITIAL. "&amp;lt;= Note the and
RESULT = SY-DATUM.
ENDIF&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&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;Manoj Kumar P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Dec 2008 13:54:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-18T13:54:40Z</dc:date>
    <item>
      <title>Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914343#M1147121</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;                          In ABAP, how do I check to see if a field is null and if it is then fill it in with some value.  I have the following statement however, I am pretty sure this not correct because it seems to overwrite all my dates with current system date.  So If this code runs today it will put in system date for all the records coming in but if I run this code tomorrow it will replace the date with tomorrow's date which is useless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.&lt;/P&gt;&lt;P&gt;Read table lt_profit_Ctr with key PROFIT_CTR = /BI0/MPROFIT_CTR.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0 or lt_profit_Ctr-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt;RESULT = SY-DATUM.&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a record for a profit center is there but the date is not there it is supposed to put in a current system date for that record but if a profit center is there with a date it MUST not do anything and move on and if profit center is not there then add it with a date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know your ideas,&lt;/P&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 13:44:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914343#M1147121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-18T13:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914344#M1147122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use an &lt;STRONG&gt;AND&lt;/STRONG&gt; condition instead of &lt;STRONG&gt;Or&lt;/STRONG&gt; that u have used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.&lt;/P&gt;&lt;P&gt;Read table lt_profit_Ctr with key PROFIT_CTR = /BI0/MPROFIT_CTR.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0 &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;AND &lt;/SPAN&gt;lt_profit_Ctr-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt;RESULT = SY-DATUM.&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kartik tarla on Dec 18, 2008 7:19 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 13:49:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914344#M1147122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-18T13:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914345#M1147123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the problem is in this line:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-subrc 0 or lt_profit_Ctr-CALDAY IS INITIAL.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the above will be always true, because if something is read from the table than sy-subrc will be null, if nothing is selected, than the field will remain initial.&lt;/P&gt;&lt;P&gt;Replace the or with and!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 13:49:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914345#M1147123</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-12-18T13:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914346#M1147124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you have given,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.&lt;/P&gt;&lt;P&gt;Read table lt_profit_Ctr with key PROFIT_CTR = /BI0/MPROFIT_CTR.&lt;/P&gt;&lt;P&gt;if sy-subrc 0 or lt_profit_Ctr-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt;RESULT = SY-DATUM.&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if there is a entry then sy-subrc will be '0' and the next part will be executed irrespective of your &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;lt_profit_Ctr-CALDAY IS INITIAL'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you need is when sy-subrc = 0 then check for the condition 'lt_profit_Ctr-CALDAY IS INITIAL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can write either &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-subrc 0.
 if lt_profit_Ctr-CALDAY IS INITIAL.
   RESULT = SY-DATUM.
 endif.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-subrc 0 AND lt_profit_Ctr-CALDAY IS INITIAL. "&amp;lt;= Note the and
RESULT = SY-DATUM.
ENDIF&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&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;Manoj Kumar P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 13:54:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914346#M1147124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-18T13:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914347#M1147125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,  The code is still not working.  Here is what I tried to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran the following code yesterday and it put 12/18/2008 for all records with 0CALDATE NULL which was right but then I tried to run it today again and it turned all the records that had 12/18/2008 to 12/19/2008 (Today's date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Read table lt_profit_Ctr with key PROFIT_CTR = /BI0/MPROFIT_CTR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc eq 0 AND lt_profit_Ctr-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  RESULT = SY-DATUM.&lt;/P&gt;&lt;P&gt;  EndIF.&lt;/P&gt;&lt;P&gt;*****************&lt;STRONG&gt;Then I tried the following&lt;/STRONG&gt;******************************&lt;/P&gt;&lt;P&gt;and the following code made all dates to NULL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from /BI0/MCOSTCENTER into table lt_COSTCENTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Read table lt_COSTCENTER with key COSTCENTER = /BI0/MCOSTCENTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0 AND lt_COSTCENTER-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  RESULT = SY-DATUM.&lt;/P&gt;&lt;P&gt;  EndIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 13:50:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914347#M1147125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T13:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914348#M1147126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;&amp;lt;Utter nonsense answer removed by moderator.  No idea why he was given points for it...&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Dec 19, 2008 9:40 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 13:57:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914348#M1147126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T13:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914349#M1147127</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 gone thru your problem, i understood that u r sending the current date to field RESULT..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i could not get after that what r u doing, i mean to say if u r updating database table with value RESULT then u can find the value in database..either u execute program today or tomorrow.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as my knowledge u r not updating it to database..i think u r generating a list...&lt;/P&gt;&lt;P&gt;thats why when ever u execute that u will get that day date as output...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ur requirement, i feel update the table with value result...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds.,&lt;/P&gt;&lt;P&gt;subash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 14:00:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914349#M1147127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T14:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914350#M1147128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Flavya,  Are you saying to do soemthing like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table lt_COSTCENTER with key COSTCENTER = /BI0/MCOSTCENTER.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from /BI0/MCOSTCENTER into table lt_COSTCENTER.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0 AND lt_COSTCENTER-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;RESULT = SY-DATUM.&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;I don't think it'll work...  It'll read the internal table and M table first, then select the records and then check for condition???????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 14:39:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914350#M1147128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T14:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914351#M1147129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.

Read table lt_profit_Ctr with key PROFIT_CTR = /BI0/MPROFIT_CTR.

if sy-subrc eq 0 AND lt_profit_Ctr-CALDAY IS INITIAL.

wa-CALDAY = SY-DATUM.  "Use work area of type lt_profit_ctr
update /BI0/MProfit_Ctr with wa transporting calday.
EndIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more thing are u sure u need to use read table, i think u need to use &lt;STRONG&gt;loop at&lt;/STRONG&gt; so that all records with the specified condition get updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Kartik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 16:17:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914351#M1147129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T16:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914352#M1147130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kartik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give me the data declaration for this???  not too familiar with work areas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ThANKS,&lt;/P&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 16:28:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914352#M1147130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T16:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914353#M1147131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;declare work area like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: wa_profit_ctr LIKE LINE OF lt_profit_Ctr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for the rest of code i'm not sure u cud use read table or u need to use loop at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.
 
loop at lt_profit_ctr into wa_profit_Ctr.
 
if sy-subrc eq 0 AND wa_profit_Ctr-CALDAY IS INITIAL.
 
wa_profit_Ctr-CALDAY = SY-DATUM.  "Use work area of type lt_profit_ctr
update /BI0/MProfit_Ctr with wa transporting calday.
EndIF.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if u want to use read table&lt;/P&gt;&lt;P&gt;then use like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.
 
Read table lt_profit_Ctr into wa_profit_Ctr with key PROFIT_CTR = /BI0/MPROFIT_CTR.
 
if sy-subrc eq 0 AND lt_profit_Ctr-CALDAY IS INITIAL.
 
wa_profit_Ctr-CALDAY = SY-DATUM.  "Use work area of type lt_profit_ctr
update /BI0/MProfit_Ctr with wa transporting calday.
EndIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 16:35:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914353#M1147131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T16:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914354#M1147132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kartik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its not able to interpret 'WITH' in the following line: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"update /BI0/MProfit_Ctr with wa transporting calday."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Syed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 20:11:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914354#M1147132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T20:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914355#M1147133</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; Flavya,  Are you saying to do soemthing like this?&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Read table lt_COSTCENTER with key COSTCENTER = /BI0/MCOSTCENTER.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Select * from /BI0/MCOSTCENTER into table lt_COSTCENTER.&lt;/P&gt;&lt;P&gt;&amp;gt;  &lt;/P&gt;&lt;P&gt;&amp;gt; if sy-subrc &amp;lt;&amp;gt; 0 AND lt_COSTCENTER-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt;&amp;gt;  &lt;/P&gt;&lt;P&gt;&amp;gt; RESULT = SY-DATUM.&lt;/P&gt;&lt;P&gt;&amp;gt; EndIF.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I don't think it'll work...  It'll read the internal table and M table first, then select the records and then check for condition???????&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Syed.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're right, it won't work.  It made no sense, so I've removed his answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 20:42:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914355#M1147133</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-12-19T20:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914356#M1147134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;On my last day of SDN,&lt;/P&gt;&lt;P&gt;&amp;gt;The moderator said to me: &lt;/P&gt;&lt;P&gt;&amp;gt;Twelve abuse reports...&lt;/P&gt;&lt;P&gt;&amp;gt;Eleven years old,&lt;/P&gt;&lt;P&gt;&amp;gt;Ten points gamed,&lt;/P&gt;&lt;P&gt;&amp;gt;Nine people lied to,&lt;/P&gt;&lt;P&gt;&amp;gt;Eight mails wasted,&lt;/P&gt;&lt;P&gt;&amp;gt;Seven flame wars,&lt;/P&gt;&lt;P&gt;&amp;gt;Six angry people,&lt;/P&gt;&lt;P&gt;&amp;gt;Five rejected posts,&lt;/P&gt;&lt;P&gt;&amp;gt;Four locked threads,&lt;/P&gt;&lt;P&gt;&amp;gt;Three fake ID's,&lt;/P&gt;&lt;P&gt;&amp;gt;Two minutes to go,&lt;/P&gt;&lt;P&gt;&amp;gt;And a Guest without a user ID.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 21:04:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914356#M1147134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T21:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914357#M1147135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think what I need in my code is some sort of a breakout statement where If all conditions are met, I don't want to do anything.  I am trying to find the syntax for it in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 21:20:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914357#M1147135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T21:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914358#M1147136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry actually the statement goes like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; update /BI0/MProfit_Ctr with wa_profit_Ctr transporting calday.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what this statement will do is that when calday is initial for the particular record u have retrieved it will assign the system date to the work area of the retrieved record but then u need to update ur database table back with this data so we use &lt;STRONG&gt;update statement&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but again i'm not sure why are u using &lt;STRONG&gt;read&lt;/STRONG&gt; instead of &lt;STRONG&gt;loop at&lt;/STRONG&gt; if only one record is getting retrieved use select single.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;this is the code u posted above&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.
Read table lt_profit_Ctr with key PROFIT_CTR = /BI0/MPROFIT_CTR.
if sy-subrc 0 or lt_profit_Ctr-CALDAY IS INITIAL.
RESULT = SY-DATUM.
ENDIF
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have some doubts in this code, please clarify those&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table lt_profit_Ctr with key PROFIT_CTR = &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;/BI0/MPROFIT_CTR.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whats the thing i have marked in red, i see that its the same as ur table name what condition u r trying to check in read table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think it shud go like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr&lt;/P&gt;&lt;P&gt;where PROFIT_CTR = &amp;lt;some variable having ur profit_ctr&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now &lt;STRONG&gt;loop at&lt;/STRONG&gt; and rest of the code is same as above discussion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u r sure that only one record is going to get retrived then&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;select single * from /BI0/MProfit_Ctr into wa_profit_Ctr&lt;/P&gt;&lt;P&gt;where PROFIT_CTR = &amp;lt;some variable having ur profit_ctr&amp;gt;&lt;/P&gt;&lt;P&gt;then update /BI0/MProfit_Ctr with wa_profit_Ctr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i'm wrong then please explain ur requirement for us to help u better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;kartik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kartik tarla on Dec 20, 2008 9:23 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2008 03:52:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914358#M1147136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-20T03:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914359#M1147137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kartik, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use the update statement but I keep getting the following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E: Unable to interpret "WITH".  Possible causes of error : Incorrect spelling or comma error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now back to your post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The requirement is: I have a profitcenter (0Profit_CTR) which has master data in it.  It has an attribute of 0CALDAY.  I want to check the load to see three things: &lt;/P&gt;&lt;P&gt;1. If there is a new profit center coming from R/3 which will not have a date associated with it so I want to add that profit center and also put current system date for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. If there is a profit center but no date then I want to put current system date for that profit center&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. If there is a profit center also with a date (I don't care what date as long as there is a date with it) then leave it alone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I tried the following: BUT this code seems to put current system date for every record coming in which is no use to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Put everything from profit center (/BI0/MProfit_Ctr)  into an internal table called : lt_profit_Ctr &lt;/P&gt;&lt;P&gt;Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****Compare the load with the internal table &lt;/P&gt;&lt;P&gt;  Read table lt_profit_Ctr with key PROFIT_CTR = /BI0/MPROFIT_CTR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****If they are comparable but the date is NULL&lt;/P&gt;&lt;P&gt;  if sy-subrc eq 0 AND lt_profit_Ctr-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****Put current system date in&lt;/P&gt;&lt;P&gt;  RESULT = SY-DATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EndIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel I need to also add an ELSE statement in which I can tell to leave the records alone that are already in M Table with a date.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, Yes, we can use SELECT SINGLE as this coding is being done in a transfer routine and only one record at a time will be selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2008 16:04:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914359#M1147137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-20T16:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914360#M1147138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well the statement is &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;update &amp;lt;tablename&amp;gt; from &amp;lt;workarea&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I previously mentioned &lt;STRONG&gt;WITH&lt;/STRONG&gt; replace it with &lt;STRONG&gt;FROM&lt;/STRONG&gt; in the update statement it will work for surely&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if select single can be used then it is suggeste to use it only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; select single * from /BI0/MProfit_Ctr into wa_profit_Ctr
where PROFIT_CTR = &amp;lt;ur load&amp;gt;
"then
 update /BI0/MProfit_Ctr from wa_profit_Ctr&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kartik tarla on Dec 20, 2008 10:04 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kartik tarla on Dec 20, 2008 10:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2008 16:22:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914360#M1147138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-20T16:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914361#M1147139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great,&lt;/P&gt;&lt;P&gt;            I will try and get back to you..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Syed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2008 23:59:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914361#M1147139</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-20T23:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Code Dilemma</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914362#M1147140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kartik,&lt;/P&gt;&lt;P&gt;        Here is what I tried and got the following message...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from /BI0/MProfit_Ctr into table lt_profit_Ctr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at lt_profit_ctr into wa_profit_Ctr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0 AND wa_profit_Ctr-CALDAY IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_profit_Ctr-CALDAY = SY-DATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update /BI0/MProfit_Ctr FROM wa_profit_Ctr-CALDAY.&lt;/P&gt;&lt;P&gt;&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;Error Message:&lt;/P&gt;&lt;P&gt;The databae view "/BI0/MPROFIT_CTR" is write-protected, so it cannot be changed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2008 15:31:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-dilemma/m-p/4914362#M1147140</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-21T15:31:25Z</dc:date>
    </item>
  </channel>
</rss>

