<?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: modification in the query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937396#M62451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WHERE ARE THE DATE FIELDS?? FROM AND TO DATE?? TABLE A OR TABLE B??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Jul 2005 14:26:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-06T14:26:15Z</dc:date>
    <item>
      <title>modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937394#M62449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a small modification in first half of the query. In addition to getting the data based on the custoemr id also need to get the data between a date range and i.e -from start date - first day of the month and enddate last day of the month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;both these are not the fields in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as of now I am getting a lot of records for this customer number but want the records between a certain date range&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you got it... How to insert that part in the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into corresponding fields of table ijha&lt;/P&gt;&lt;P&gt;        from jhak&lt;/P&gt;&lt;P&gt;           inner join jhaga&lt;/P&gt;&lt;P&gt;             on jhak&lt;SUB&gt;avm_nr = jhaga&lt;/SUB&gt;avm_nr&lt;/P&gt;&lt;P&gt;                  where jhaga~inserent = p_custid.&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;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 14:16:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937394#M62449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-06T14:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937395#M62450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you want to filter out these records,  does the jhak or Jhaga have any date fields that you can work with.  Again,  these tables do not exists in my system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is a date field in one of the those tables that you can work with, then its real easy.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

ranges: r_datum for sy-datum.

r_datum-sign   = 'I'.
r_datum-option = 'BT'.
r_datum-low    = '20050701'.
r_datum-high   = '20050731'.
append r_datum.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in your where clause....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

where jhaga~inserent = p_custid
  and SOME_DATE_FIELD in r_datum.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 14:25:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937395#M62450</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-06T14:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937396#M62451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WHERE ARE THE DATE FIELDS?? FROM AND TO DATE?? TABLE A OR TABLE B??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 14:26:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937396#M62451</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-06T14:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937397#M62452</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 it well, you need something like this:&lt;/P&gt;&lt;P&gt;data: startdate type dats, enddate type dats.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;initialize you data here.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into corresponding fields of table ijha&lt;/P&gt;&lt;P&gt;from jhak&lt;/P&gt;&lt;P&gt;inner join jhaga&lt;/P&gt;&lt;P&gt;on jhak&lt;SUB&gt;avm_nr = jhaga&lt;/SUB&gt;avm_nr&lt;/P&gt;&lt;P&gt;where jhaga~inserent = p_custid&lt;/P&gt;&lt;P&gt;and jhak~date between startdate and enddate&lt;/P&gt;&lt;P&gt;and jhaga~date between startdate and enddate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 14:28:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937397#M62452</guid>
      <dc:creator>eddy_declercq</dc:creator>
      <dc:date>2005-07-06T14:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937398#M62453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is a date field (planned billing date) -fakdatum in jhaga table which can be any date in the middle of the month like '07/05/02005' from this can I generate the startdate  and enddate for that month  just not for july month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I am try to achieve here is run the records on a monthly basis from startof the month to the end of the month so that I can grab the records of that month&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;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 14:44:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937398#M62453</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-06T14:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937399#M62454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to know that range before the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: sdate type sy-datum.
data: edate type sy-datum.

ranges: r_datum for sy-datum.

* First day of month will always be 01. 
sdate+0(6) = sy-datum+0(6).
sdate+6(2) = '01'. 

* Get the end of the month date
call function 'RP_LAST_DAY_OF_MONTHS'
  exporting
    day_in                  = sdate
 IMPORTING
   LAST_DAY_OF_MONTH        = edate.

* Set up your range with the start and end dates
r_datum-sign   = 'I'.
r_datum-option = 'BT'.
r_datum-low    = sdate.
r_datum-high   = edate.
append r_datum.
 
* Now do your select with this WHERE clause.

where jhaga~inserent = p_custid
  and jhaga~fakdatum in r_datum.




&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 14:51:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937399#M62454</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-06T14:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937400#M62455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich, It really helped a lot. I will need your help further too. because i am working an a complex query to get the data from the condition types I will get back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have awarded 6 points because my question is not fully answered i am working on joining th puzzle is small pieces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 15:26:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937400#M62455</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-06T15:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937401#M62456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;continuing with it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code goes like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into corresponding fields of table ijha&lt;/P&gt;&lt;P&gt;        from jhak&lt;/P&gt;&lt;P&gt;           inner join jhaga&lt;/P&gt;&lt;P&gt;             on jhak&lt;SUB&gt;avm_nr = jhaga&lt;/SUB&gt;avm_nr&lt;/P&gt;&lt;P&gt;                  where jhaga~regulierer = p_custid and&lt;/P&gt;&lt;P&gt;                  jhaga~fakdatum in r_datum.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I having four records in ijha table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select  kposn kschl krech kawrt kbetr kwert&lt;/P&gt;&lt;P&gt;        from konv&lt;/P&gt;&lt;P&gt;             into table cdata&lt;/P&gt;&lt;P&gt;                  for all entries in ijha&lt;/P&gt;&lt;P&gt;                        where konv~knumv = ijha-knumv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;It is fetching the records of various condition types from konv for each record from ijha table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at cdata  into wac.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    case wac-kschl.&lt;/P&gt;&lt;P&gt;     when 'ZRAT'.&lt;/P&gt;&lt;P&gt;        MOVE wac-kbetr to w_accitab-zrate.&lt;/P&gt;&lt;P&gt;        MOVE wac-kwert to w_accitab-zsubtotal.&lt;/P&gt;&lt;P&gt;      when 'ZRTC'.&lt;/P&gt;&lt;P&gt;        MOVE wac-kbetr to w_accitab-zrate.&lt;/P&gt;&lt;P&gt;        MOVE wac-kwert to w_accitab-zsubtotal.&lt;/P&gt;&lt;P&gt;      when 'ZAC%'.&lt;/P&gt;&lt;P&gt;        MOVE wac-kbetr to w_accitab-zrate.&lt;/P&gt;&lt;P&gt;        MOVE wac-kwert to w_accitab-zsubtotal.&lt;/P&gt;&lt;P&gt;      when 'ZCOM'.&lt;/P&gt;&lt;P&gt;        MOVE wac-kbetr to w_accitab-zrate.&lt;/P&gt;&lt;P&gt;        MOVE wac-kwert to w_accitab-zsubtotal.&lt;/P&gt;&lt;P&gt;      when 'ZBET'.&lt;/P&gt;&lt;P&gt;        MOVE wac-kbetr to w_accitab-zrate.&lt;/P&gt;&lt;P&gt;        MOVE wac-kwert to w_accitab-zamount.&lt;/P&gt;&lt;P&gt;    endcase.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      append w_accitab to accitab.&lt;/P&gt;&lt;P&gt;     write: 20 accitab-zrate, 40 accitab-zsubtotal, 60 accitab-zamount.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    clear w_accitab.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;First question.&lt;/P&gt;&lt;P&gt;It is checking through all the condition types and populating with the approriate data, but my question is, some condtion types for some records give all zero values and I do not want those records updated to the internal table because from the internal table i loop the data and display the data into the form. &lt;/P&gt;&lt;P&gt;Is there a way I can eliminate only the  zero value records at the internal table level so I do not get to display in the form by using any 'IF' condition some thing like that...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second question.&lt;/P&gt;&lt;P&gt;As per the requirement I do not need check for each condition type (in the case-- endcase... there are few more but I am not using them) but in this instance when I loop the itab, data checks for that condition types that I have not included and displays a line of record '0.00' in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I eliminate that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final result of this is, taking a lot of space in the form that gives a lot of zeros appearing in the form that can be eliminated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you caught my point. How to tackle this probelm?&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;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 16:27:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937401#M62456</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-06T16:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937402#M62457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1)  You can probably do this at the select statement in your where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

where konv~knumv = ijha-knumv.
  and konv-kbetr &amp;gt; 0.
  and konv-kwert &amp;gt; 0.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to do it there, you can do it at your loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

loop at cdata into wac where konv-kbetr &amp;gt; 0.
                         and konv-kwert &amp;gt; 0.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 16:33:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937402#M62457</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-06T16:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937403#M62458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;2)  If you do not want to include any other types in your table you can check for "other" and then kick out of the loop and continue to the next record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

loop at cdata into wac where konv-kbetr &amp;gt; 0.
                         and konv-kwert &amp;gt; 0.


  case wac-kschl.
    when 'ZRAT' 
      or 'ZRTC'
      or 'ZAC%'
      or 'ZCOM'
      or 'ZBET'.
      move wac-kbetr to w_accitab-zrate.
      move wac-kwert to w_accitab-zsubtotal.
&amp;lt;b&amp;gt;
    when others.
      continue.
&amp;lt;/b&amp;gt;
  endcase.

  append w_accitab to accitab.
  write: 20 accitab-zrate, 40 accitab-zsubtotal, 60 accitab-zamount.
  clear w_accitab.

endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 16:36:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937403#M62458</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-06T16:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937404#M62459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first part is not working. when I extend the where clause it is getting me some different data, i am still working on it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second one worked well and helped to eliminate the unwanted records. It looks good now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a question popped up for me here, As I told you that I am generating the monthly statements and hence I had to create the date range s_date and e-date &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What if I have to generate the monthly statements for suppose month June then I cannot start with sy-datum right...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I modify in such a way that the user can enter any startdate irrespective of the month and go on calculate the s_date and e-date and pull the data of that month?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot of helping me here.I really appreciate your help. I shall be rewarding you full points here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have any questions I will get back to you on that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 17:24:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937404#M62459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-06T17:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: modification in the query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937405#M62460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need the user's input then you will need a selection screen.  We will modify our code like so....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: sdate type sy-datum.
data: edate type sy-datum.

ranges: r_datum for sy-datum.

&amp;lt;b&amp;gt;parameters: p_datum type sy-datum.&amp;lt;/b&amp;gt;

start-of-selection.

* First day of month will always be 01.
sdate+0(6) = &amp;lt;b&amp;gt;p_datum&amp;lt;/b&amp;gt;+0(6).
sdate+6(2) = '01'.

* Get the end of the month date
call function 'RP_LAST_DAY_OF_MONTHS'
     exporting
          day_in            = sdate
     importing
          last_day_of_month = edate.

* Set up your range with the start and end dates
r_datum-sign   = 'I'.
r_datum-option = 'BT'.
r_datum-low    = sdate.
r_datum-high   = edate.
append r_datum.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jul 2005 17:29:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modification-in-the-query/m-p/937405#M62460</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-06T17:29:30Z</dc:date>
    </item>
  </channel>
</rss>

