<?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: Create a flat list from SELECTION-SCREEN in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447137#M1248818</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably better to change the design of your program, but here is a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zrich_0001.

DATA: lv_date TYPE sy-datum.

SELECTION-SCREEN  BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : dat_rang FOR sy-datum.
SELECTION-SCREEN END OF  BLOCK blk1.

INITIALIZATION.

  lv_date = '19000101'.

START-OF-SELECTION.

  DO.

    IF lv_date IN dat_rang.
      WRITE:/ lv_date.
    ENDIF.
    lv_date = lv_date + 1.
    IF lv_date = '20500101'.
      EXIT.
    ENDIF.

  ENDDO.&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>Fri, 27 Mar 2009 17:27:42 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2009-03-27T17:27:42Z</dc:date>
    <item>
      <title>Create a flat list from SELECTION-SCREEN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447135#M1248816</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 a selection for date on in an report,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECTION-SCREEN  BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : dat_rang FOR sy-datum.
SELECTION-SCREEN END OF  BLOCK blk1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a flat list of dates from this selection. This list should exclude the date(s), which are excluded in the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give some starters on how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;CD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 17:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447135#M1248816</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T17:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flat list from SELECTION-SCREEN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447136#M1248817</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;Can you explain with example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 17:21:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447136#M1248817</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T17:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flat list from SELECTION-SCREEN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447137#M1248818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably better to change the design of your program, but here is a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zrich_0001.

DATA: lv_date TYPE sy-datum.

SELECTION-SCREEN  BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : dat_rang FOR sy-datum.
SELECTION-SCREEN END OF  BLOCK blk1.

INITIALIZATION.

  lv_date = '19000101'.

START-OF-SELECTION.

  DO.

    IF lv_date IN dat_rang.
      WRITE:/ lv_date.
    ENDIF.
    lv_date = lv_date + 1.
    IF lv_date = '20500101'.
      EXIT.
    ENDIF.

  ENDDO.&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>Fri, 27 Mar 2009 17:27:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447137#M1248818</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2009-03-27T17:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flat list from SELECTION-SCREEN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447138#M1248819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ex: If user selects date 06/1/2008, 07/01/2008 to 07/31/2008, and exlcude 07/4/2008, 07/07/2008 - 07/10/2008&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I want a list of all dates to be included ex: in this case, 06/1/2008, 07/01/2008, 07/02/2008, 07/03/2008, 07/05/2008, 07/05/2008, and from 07/11/2008 to 07/31/2008&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to bring all this dates in an internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be a silly question, but I am new to ABAP so please help me with some hints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;CD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 17:29:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447138#M1248819</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T17:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flat list from SELECTION-SCREEN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447139#M1248820</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;PRE&gt;&lt;CODE&gt;If date IN dat_rang. ---&amp;gt; It will take care of exclusion if date provided to exlude in the dat_rang you need to write any logic for this
 
 Write the Data.

ENDIF.

SELECTION-SCREEN  BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : dat_rang FOR sy-datum.
SELECTION-SCREEN END OF  BLOCK blk1.

If user selects date  06/1/2008 to 06/30/2008, and exlcude 06/4/2008, 06/10/2008 - 06/20/2008

l_date = '20080601'.
DO 30 TIMES.
   IF l_date IN dat_rang.
    Write:/  l_date.
  Endif.
ENDDO.

OUTPUT:.

06/1/2008 - 06/3/2008 
06/5/2008 - 06/9/2008
06/21/2008 - 06/30/2008

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Avinash Kodarapu on Mar 27, 2009 11:03 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 17:31:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447139#M1248820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T17:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flat list from SELECTION-SCREEN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447140#M1248821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is another example, adding the dates to an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zrich_0001.

TYPES: BEGIN OF t_datum,
        datum TYPE sy-datum,
       END OF t_datum.

DATA: lt_datum TYPE TABLE OF t_datum.
DATA: ls_datum LIKE LINE OF lt_datum.

DATA: lv_date TYPE sy-datum.

SELECTION-SCREEN  BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : dat_rang FOR sy-datum.
SELECTION-SCREEN END OF  BLOCK blk1.

INITIALIZATION.

  lv_date = '19000101'.

START-OF-SELECTION.

  DO.
    IF lv_date IN dat_rang.
      ls_datum-datum = lv_date.
      APPEND ls_datum TO lt_datum.
    ENDIF.
    lv_date = lv_date + 1.
    IF lv_date = '20500101'.
      EXIT.
    ENDIF.

  ENDDO.

  LOOP AT lt_datum INTO ls_datum.
    WRITE:/ ls_datum-datum.
  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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 17:33:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447140#M1248821</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2009-03-27T17:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a flat list from SELECTION-SCREEN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447141#M1248822</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;Check this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT-OPTIONS so_date FOR sy-datum.

DATA: t_dates TYPE STANDARD TABLE OF sydatum,
      s_dates TYPE sydatum.

START-OF-SELECTION.

* get the records that are included.
  LOOP AT so_date WHERE sign = 'I'.

    s_dates = so_date-low.
    APPEND s_dates TO t_dates.

    CHECK NOT so_date-high IS INITIAL.

* Add the dates in between low and high.
    WHILE s_dates &amp;lt; so_date-high.

      s_dates = s_dates + 1.
      APPEND s_dates TO t_dates.

    ENDWHILE.

  ENDLOOP.

* Display the dates.
  LOOP AT t_dates INTO s_dates.
    WRITE: / s_dates.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2009 17:39:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/create-a-flat-list-from-selection-screen/m-p/5447141#M1248822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-27T17:39:22Z</dc:date>
    </item>
  </channel>
</rss>

