<?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: how to select the data in the same table for diff dates in selection-screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619938#M277400</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 am not very clear about what is required but if for 2 different date selections you want to get data in same internal table then it's very simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make a range.&lt;/P&gt;&lt;P&gt;Ranges: ra_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Append all the data of the select-options into the range.&lt;/P&gt;&lt;P&gt;In the selection from the DB table in where condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use where &amp;lt;date_field name&amp;gt; IN ra_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Sep 2006 07:56:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-15T07:56:02Z</dc:date>
    <item>
      <title>how to select the data in the same table for diff dates in selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619931#M277393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i would like to select the data for two dates selection and would like to comapre them in the output for basic list.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS:     p_werks TYPE s997-werks obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_matnr FOR s997-matnr, " Material Number&lt;/P&gt;&lt;P&gt;                s_mvgr1 FOR s997-mvgr1, " Material Group 1&lt;/P&gt;&lt;P&gt;                s_mvgr2 FOR s997-mvgr2, " Material Group 2&lt;/P&gt;&lt;P&gt;                s_mvgr3 FOR s997-mvgr3, " Material Group 3&lt;/P&gt;&lt;P&gt;                s_vkorg FOR s997-vkorg, " Sales Organization&lt;/P&gt;&lt;P&gt;                s_vtweg FOR s997-vtweg, " Distribution Channel&lt;/P&gt;&lt;P&gt;                s_pkunag FOR s997-pkunag."Sold to Party&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_sptag FOR s997-sptag obligatory,          " Date 1&lt;/P&gt;&lt;P&gt;                s_sptag1 FOR s997-sptag obligatory.         " Date 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b2.&lt;/P&gt;&lt;P&gt;as selection screen can any body suggest how to select them as it should be displayed  at end of city ort01.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 03:40:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619931#M277393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T03:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to select the data in the same table for diff dates in selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619932#M277394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi KKK , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think u are trying to compare current data with history data.&lt;/P&gt;&lt;P&gt;u can do  one thing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.First get the data for Current date ( date 1 ) and divid this data into Months/dates.&lt;/P&gt;&lt;P&gt;in this case u can make use of &amp;lt;b&amp;gt;MM_ARRANG_SPMON_RANGE&amp;lt;/b&amp;gt;to divid into Months Format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like this i given data1 = 01.2005 - 02.2005. &lt;/P&gt;&lt;P&gt;then get the data for this range 01-02 &lt;/P&gt;&lt;P&gt;and divid this data like this &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;01       02&lt;/P&gt;&lt;P&gt;100KG    200 KG&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;2.get the data for date2 = 01.2004-02.2004&lt;/P&gt;&lt;P&gt;then get the data for this range 01-02 &lt;/P&gt;&lt;P&gt;and divid this data like this &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;01       02&lt;/P&gt;&lt;P&gt;120KG    220 KG&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally put into o/p screen like this &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;01/2004 01/2005  02/2004  02/2005
120       100     220      200&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my sugg. is check the std.Sap programs which are avail. in Tcode MCSI.&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>Fri, 15 Sep 2006 04:46:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619932#M277394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T04:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to select the data in the same table for diff dates in selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619933#M277395</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;  One way to extract the data is...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;Make the two dates as PARAMETERS instead of Select-Options&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;Declare an internal table with the fields required&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select &amp;lt;fields&amp;gt; into table it_tab&lt;/P&gt;&lt;P&gt;         from s997&lt;/P&gt;&lt;P&gt;         where ( sptag = p_sptag1&lt;/P&gt;&lt;P&gt;               OR sptag = p_sptag2 )&lt;/P&gt;&lt;P&gt;         and " other conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Now that you have the records for two dates, you can&lt;/P&gt;&lt;P&gt;manipulate as per your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 05:54:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619933#M277395</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T05:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to select the data in the same table for diff dates in selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619934#M277396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;actually user has to select as per his combiation of two diff dates and for that i have to use the select-options for date1 and date2. so please can any body suggest me how to proceed, thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 06:10:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619934#M277396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T06:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to select the data in the same table for diff dates in selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619935#M277397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kalyan,&lt;/P&gt;&lt;P&gt;You cannot impose this dates comparision in the select statement what you can do is select the data first without dates and then loop the table to check for your dates comparision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this PSEUDO Code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*--

  SELECT EKKO~EBELN EKKO~EKGRP EKKO~AEDAT
         EKKO~KDATB EKKO~KDATE EKKO~LIFNR
         EKPO~EBELP EKPO~WERKS EKPO~MATKL
         EKPO~TXZ01 EKPO~NETPR LFA1~NAME1
         INTO CORRESPONDING FIELDS OF TABLE T_DATA
         FROM EKKO JOIN EKPO
         ON EKKO~EBELN = EKPO~EBELN
         JOIN LFA1
         ON EKKO~LIFNR = LFA1~LIFNR
         WHERE EKKO~BSTYP = C_BSTYP
         AND   EKKO~BSART = C_BSART
         AND   EKPO~PSTYP = C_PSTYP
         AND   EKPO~WERKS IN S_WERKS.
*--Process data
  DATA: WAL_OUTPUT TYPE TYPE_DATA.
  FIELD-SYMBOLS: &amp;lt;L_DATA&amp;gt; TYPE TYPE_DATA.
*Sort Input dates
  SORT S_DATE.
  SORT T_OUTPUT BY EBELN EBELP.

  IF NOT T_DATA IS INITIAL.
&amp;lt;b&amp;gt;    LOOP AT S_DATE.
      LOOP AT T_DATA ASSIGNING &amp;lt;L_DATA&amp;gt;
           WHERE ( KDATB &amp;lt;= S_DATE-LOW AND
                   KDATE &amp;gt;= S_DATE-LOW ).&amp;lt;/b&amp;gt;
*--Process for Valid on Dates
        READ TABLE T_OUTPUT TRANSPORTING NO FIELDS
                        WITH KEY EBELN = &amp;lt;L_DATA&amp;gt;-EBELN
                                 EBELP = &amp;lt;L_DATA&amp;gt;-EBELP
                                 BINARY SEARCH.
        IF SY-SUBRC &amp;lt;&amp;gt; 0 .
          MOVE-CORRESPONDING &amp;lt;L_DATA&amp;gt; TO WAL_OUTPUT.
          APPEND WAL_OUTPUT TO T_OUTPUT.
        ELSE.
          EXIT.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
  ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raghav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 06:21:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619935#M277397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T06:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to select the data in the same table for diff dates in selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619936#M277398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kalyan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use Select-Options statement to select data between two dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 06:28:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619936#M277398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T06:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to select the data in the same table for diff dates in selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619937#M277399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kalyan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first select data with first s_option into an itab.&lt;/P&gt;&lt;P&gt;nxt select data again with second s_option into jtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now u have data in two itabs. u can manipulate the data for as per ur req.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; Anyhow user will have to give the values at selection-screen ..know...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Praneeth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 06:35:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619937#M277399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T06:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to select the data in the same table for diff dates in selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619938#M277400</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 am not very clear about what is required but if for 2 different date selections you want to get data in same internal table then it's very simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make a range.&lt;/P&gt;&lt;P&gt;Ranges: ra_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Append all the data of the select-options into the range.&lt;/P&gt;&lt;P&gt;In the selection from the DB table in where condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use where &amp;lt;date_field name&amp;gt; IN ra_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2006 07:56:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-select-the-data-in-the-same-table-for-diff-dates-in-selection-screen/m-p/1619938#M277400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-15T07:56:02Z</dc:date>
    </item>
  </channel>
</rss>

