<?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: Need help with ABAP general coding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233856#M480934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder how do u fetch latest day for the corresponding latest period.&lt;/P&gt;&lt;P&gt;Is ther no 'day' field in Table.If u dont want latest 'day' for the latest 'period'&lt;/P&gt;&lt;P&gt;then do like below.And no need to give PRICE_STD  PRICE_BASE while sorting the ITAB .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jus do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT T_CMATPRICE_DATA BY material plant fiscper DESCENDING .&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM T_CMATPRICE_DATA COMPARING material plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vigneswaran S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Apr 2007 14:35:04 GMT</pubDate>
    <dc:creator>former_member491305</dc:creator>
    <dc:date>2007-04-23T14:35:04Z</dc:date>
    <item>
      <title>Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233838#M480916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure what the best approach would be so i am hoping you can help me out.  I have a pretty simple scenario but I am not sure the best way to collect the data.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table that contains material data except prices.  I need to go to another table and see if their is a material price for the current period.  If so I just need to modify the package.  If not I need to keep looping back through the table for prior months until I find a price.  i will never go back more than 1 year.  My link will be &lt;/P&gt;&lt;P&gt;  what is the best design?  I was thinking of getting 2 internal tables.  1 with current prices for all the materials in my table and one with prior prices&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 11:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233838#M480916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T11:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233839#M480917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think you can use the Tables MBEWH and MARDH for this purpose to find the prices by looping into internal table till you get some price.&lt;/P&gt;&lt;P&gt;These tables stores the previous values for that material.&lt;/P&gt;&lt;P&gt;use them&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;ANJI&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 11:54:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233839#M480917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T11:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233840#M480918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Val_date = sy-datum - 365.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Select MAX(DATE) price from table2 into table itab2 for all entries in itab1&lt;/P&gt;&lt;P&gt; where matnr = itab1-matnr&lt;/P&gt;&lt;P&gt;and date GE Val_DATE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 11:57:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233840#M480918</guid>
      <dc:creator>former_member491305</dc:creator>
      <dc:date>2007-04-23T11:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233841#M480919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MIck , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u cannt this into Coding , better to get going on Avg.Price of Material ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can also check MARD&lt;EM&gt;MBEW for current , MBEWH&lt;/EM&gt;MARDH for History.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;y i am telling this one is , Some times these table will not Updateded, due to SAP system settings , so better to  go for moving avg.price of MARD.&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;prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 11:58:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233841#M480919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T11:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233842#M480920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No the design they want is the way I described.  they do not want avg. price.    We already loded the prices inot an ODS in BW so i will be reading from this table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why can't i do this in coding?  I've done this type of logic before so why is it an issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 12:05:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233842#M480920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T12:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233843#M480921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then how do I get the loop to work and grap the latest day with the orice?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 12:06:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233843#M480921</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T12:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233844#M480922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    Max(date) itself will fetch the latest day ,latest month, latest year.&lt;/P&gt;&lt;P&gt;If am wrong please clarify.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 12:12:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233844#M480922</guid>
      <dc:creator>former_member491305</dc:creator>
      <dc:date>2007-04-23T12:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233845#M480923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My date field is int he format mmm/yyyy.  I don't have the day.  will this work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 12:25:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233845#M480923</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T12:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233846#M480924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mick,&lt;/P&gt;&lt;P&gt;  Using two internal tables is a good approach:&lt;/P&gt;&lt;P&gt;  - 1st table for current prices &amp;amp; 2nd for prior prices&lt;/P&gt;&lt;P&gt;  - sort the two tables by period field descending&lt;/P&gt;&lt;P&gt;  - calculate the validity_period&lt;/P&gt;&lt;P&gt;       one example is : val_period = sy-datum - 365!&lt;/P&gt;&lt;P&gt;  - set ld_index = 0.&lt;/P&gt;&lt;P&gt;  - Loop at first table where period &amp;gt; val_period into wa_area&lt;/P&gt;&lt;P&gt;          Loop at second table from ld_index &lt;/P&gt;&lt;P&gt;             if period &amp;lt; wa_area-period.&lt;/P&gt;&lt;P&gt;                   continue.&lt;/P&gt;&lt;P&gt;             elseif period &amp;gt; wa_area-period.&lt;/P&gt;&lt;P&gt;                   exit.&lt;/P&gt;&lt;P&gt;             else  period = wa_area-period.&lt;/P&gt;&lt;P&gt;                  process modifications&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;   Reward if helpful.&lt;/P&gt;&lt;P&gt;  Regards ,&lt;/P&gt;&lt;P&gt;   Sooness&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         endloop.&lt;/P&gt;&lt;P&gt;       endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 12:35:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233846#M480924</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-04-23T12:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233847#M480925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ps: you may exit from both loops by setting a flag in 2nd loop then putting a check for it  after 1st endloop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 12:41:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233847#M480925</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-04-23T12:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233848#M480926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No it won't work.Try like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select MAX(DATE) matnr from table2 into table itab2 for all entries in itab1&lt;/P&gt;&lt;P&gt;where matnr = itab1-matnr&lt;/P&gt;&lt;P&gt;and date GE Val_DATE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select max(day) matnr price from table2 into table itab3 for all entries in itab2&lt;/P&gt;&lt;P&gt;where matnr = itab2-matnr and date = itab2-date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now itab3 will contain price for the latest period for each material..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 12:43:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233848#M480926</guid>
      <dc:creator>former_member491305</dc:creator>
      <dc:date>2007-04-23T12:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233849#M480927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is waht i tried with MAX and this is the error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unknown column name "MAX(FISCPER)". not determined until runtime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select MAX(FISCPER) MATERIAL PLANT FISCPER PRICE_STD PRICE_BASE INTO TABLE&lt;/P&gt;&lt;P&gt;   T_MATPRICE_DATA&lt;/P&gt;&lt;P&gt;   FROM /BIC/AZCO_O0100&lt;/P&gt;&lt;P&gt;   FOR ALL ENTRIES IN DATA_PACKAGE&lt;/P&gt;&lt;P&gt;   WHERE&lt;/P&gt;&lt;P&gt;    MATERIAL = DATA_PACKAGE-MATERIAL AND&lt;/P&gt;&lt;P&gt;    PLANT = DATA_PACKAGE-PLANT and&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FISCPER = DATA_PACKAGE-FISCPER.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FISCYEAR = DATA_PACKAGE-FISCYEAR.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;FISCPER GE VAL_DATE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 12:46:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233849#M480927</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T12:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233850#M480928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But you are uisng GE so it should grab the max date correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 13:00:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233850#M480928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T13:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233851#M480929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I get this error below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The addition "FOR ALL ENTRIES" excludes all aggregate functions with the exception of "COUNT( * )", as the single element of the SELECT clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select MATERIAL PLANT MAX( FISCPER ) PRICE_STD PRICE_BASE INTO TABLE&lt;/P&gt;&lt;P&gt;   T_MATPRICE_DATA&lt;/P&gt;&lt;P&gt; FROM /BIC/AZCO_O0100&lt;/P&gt;&lt;P&gt;   FOR ALL ENTRIES IN DATA_PACKAGE&lt;/P&gt;&lt;P&gt;   WHERE&lt;/P&gt;&lt;P&gt;    MATERIAL = DATA_PACKAGE-MATERIAL AND&lt;/P&gt;&lt;P&gt;    PLANT = DATA_PACKAGE-PLANT and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FISCPER GE VAL_DATE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 13:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233851#M480929</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T13:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233852#M480930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mick,&lt;/P&gt;&lt;P&gt;           Sorry for the mistaken Code syntax .'for all entries' won't work while using Aggregate fn.Check if the following code work for u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT material plant fiscper day INTO TABLE&lt;/P&gt;&lt;P&gt;  t_matprice_data&lt;/P&gt;&lt;P&gt;  FROM /bic/azco_o0100&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN data_package&lt;/P&gt;&lt;P&gt;  WHERE&lt;/P&gt;&lt;P&gt;  material = data_package-material AND&lt;/P&gt;&lt;P&gt;  plant = data_package-plant AND&lt;/P&gt;&lt;P&gt;  fiscper GE val_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT t_matprice_data BY material plant fiscper DESCENDING day DESCENDING.&lt;/P&gt;&lt;P&gt;  DELETE ADJACENT DUPLICATES FROM t_matprice_data COMPARING material plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now t_matprice_data  will contain latest price for the material.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 13:57:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233852#M480930</guid>
      <dc:creator>former_member491305</dc:creator>
      <dc:date>2007-04-23T13:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233853#M480931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will try it out.  what does the 2 descending statements do/  Do you need both or just the one&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 14:09:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233853#M480931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T14:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233854#M480932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume that &amp;lt;b&amp;gt;t_matprice_data&amp;lt;/b&amp;gt; table contains "Period" field(MM/YYYY) &lt;/P&gt;&lt;P&gt;and DAY field. DESCENDING is needed for both PERIOD and DAY. To sort the specific field according to our need we can use like this.These  descending stmnt. will sort both  PERIOD field and DAY field  in Descending order to move latest Date into Top.This will be helpful while using DELETE ADJACENT DUPLICATES stmnt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 14:20:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233854#M480932</guid>
      <dc:creator>former_member491305</dc:creator>
      <dc:date>2007-04-23T14:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233855#M480933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No it just contains Period" field(MM/YYYY) so would I change that to be below or do i take out the 2nd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT T_CMATPRICE_DATA BY material plant fiscper PRICE_STD PRICE_BASE&lt;/P&gt;&lt;P&gt;  DESCENDING FISCPER DESCENDING.&lt;/P&gt;&lt;P&gt;  DELETE ADJACENT DUPLICATES FROM T_CMATPRICE_DATA COMPARING material&lt;/P&gt;&lt;P&gt;  plant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 14:27:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233855#M480933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T14:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233856#M480934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder how do u fetch latest day for the corresponding latest period.&lt;/P&gt;&lt;P&gt;Is ther no 'day' field in Table.If u dont want latest 'day' for the latest 'period'&lt;/P&gt;&lt;P&gt;then do like below.And no need to give PRICE_STD  PRICE_BASE while sorting the ITAB .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jus do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT T_CMATPRICE_DATA BY material plant fiscper DESCENDING .&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM T_CMATPRICE_DATA COMPARING material plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vigneswaran S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 14:35:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233856#M480934</guid>
      <dc:creator>former_member491305</dc:creator>
      <dc:date>2007-04-23T14:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with ABAP general coding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233857#M480935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this will work but i need to a FM that will calculate 12 months back&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 18:39:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-with-abap-general-coding/m-p/2233857#M480935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T18:39:16Z</dc:date>
    </item>
  </channel>
</rss>

