<?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: Select statement for selection screen - my first ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921361#M1963897</link>
    <description>&lt;P&gt;I am not a programist. But wanted to learn ABAP so started  few days ago. This is my first contact with such language. That's why asking for little help.&lt;/P&gt;&lt;P&gt;Now my code looks like below. I want to include:&lt;/P&gt;&lt;P&gt;1. my_box1 when zemployees-domestic eq 'x'&lt;/P&gt;&lt;P&gt;2. my_box2 when zemployees-domestic is initial.&lt;/P&gt;&lt;P&gt;3. my_rb1 when zemployees-form -&amp;gt; all values&lt;/P&gt;&lt;P&gt;4. my_rb2 when zemployees-form -&amp;gt; for value "UoP"&lt;/P&gt;&lt;P&gt;5. my_rb3 when zemployees-form -&amp;gt; for value "B2B"&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT z_employee_list_01
LINE-SIZE 132
NO STANDARD PAGE HEADING.


TABLES zemployees.




*****


SELECTION-SCREEN BEGIN OF BLOCK myblock1 WITH FRAME TITLE text-001.


PARAMETERS:


                my_bb     TYPE zemployees-gender       NO-DISPLAY.


SELECT-OPTIONS:


                 my_ee    FOR  zemployees-employee DEFAULT  '10000001' TO '19999999',
                 my_dob   FOR  zemployees-dob,
                 my_g     FOR  zemployees-gender.


SELECTION-SCREEN END OF BLOCK   myblock1.




SELECTION-SCREEN BEGIN OF BLOCK myblock2 WITH FRAME TITLE text-002.


PARAMETERS:
  my_box1 AS CHECKBOX        LIKE zemployees-domestic DEFAULT 'X',                     "Domestic employee
  my_box2 AS CHECKBOX        LIKE zemployees-domestic DEFAULT 'X'.                     "Foreign employee


SELECTION-SCREEN SKIP.


PARAMETERS:
  my_rb3 RADIOBUTTON GROUP       gr1,                                                  "All types of employment
  my_rb1 RADIOBUTTON GROUP       gr1,                                                  "Contract of emploment
  my_rb2 RADIOBUTTON GROUP       gr1.                                                  "B2B




SELECTION-SCREEN END OF BLOCK   myblock2.




**********
INITIALIZATION.


AT SELECTION-SCREEN.                                                
  IF
    my_g IS INITIAL AND
    my_dob IS INITIAL AND
    my_ee IS INITIAL.


    MESSAGE e000(zmes1).




  ENDIF.


*****


START-OF-SELECTION.


  SELECT * FROM zemployees.


    IF


      zemployees-dob        IN my_dob    AND
      zemployees-employee   IN my_ee     AND
      zemployees-gender     IN my_g.


      WRITE: / zemployees.


    ENDIF.
  ENDSELECT.
END-OF-SELECTION.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Apr 2019 11:01:50 GMT</pubDate>
    <dc:creator>mateusz_wrobel</dc:creator>
    <dc:date>2019-04-19T11:01:50Z</dc:date>
    <item>
      <title>Select statement for selection screen - my first ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921356#M1963892</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
  &lt;P&gt;I am working on my first program with ABAP. I have created table zemployees with the structure &amp;amp; data attached - &lt;A href="https://answers.sap.com/storage/temp/1667721-employee.png"&gt;employee.png&lt;/A&gt;.&lt;/P&gt;
  &lt;P&gt;Then wrote some code, see below.&lt;/P&gt;
  &lt;P&gt;I am struggling with two (2) problems: &lt;/P&gt;
  &lt;P&gt;1. When &lt;STRONG&gt;Initalization &lt;/STRONG&gt;and &lt;STRONG&gt;At selection screen &lt;/STRONG&gt;is turned on, the select statement does not work. When its turned off (*) it works.&lt;/P&gt;
  &lt;P&gt;2. I do not know how to wrote a code for parameters to select data based what is entered on the screen. I only managed to wrote for my_dob and my_ee, but have more to handle below:&lt;/P&gt;
  &lt;P&gt;my_g &lt;/P&gt;
  &lt;P&gt;mybox1, mybox2&lt;/P&gt;
  &lt;P&gt;my_rb1, my_rb2, my_rb3&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;SELECTION-SCREEN BEGIN OF BLOCK myblock1 WITH FRAME TITLE text-001.

PARAMETERS:

*  my_ee LIKE zemployees-employee VALUE CHECK,

  my_g  LIKE zemployees-gender VALUE CHECK.

SELECT-OPTIONS my_dob FOR zemployees-dob.

SELECT-OPTIONS my_ee FOR zemployees-employee.



SELECTION-SCREEN END OF BLOCK myblock1.





SELECTION-SCREEN BEGIN OF BLOCK myblock2 WITH FRAME TITLE text-002.



PARAMETERS:

  my_box1 AS CHECKBOX,                                                            "Domestic employee ?

  my_box2 AS CHECKBOX,                                                            "Foreign employee ?

  my_rb3  RADIOBUTTON GROUP gr1,                                                  "All Employees

  my_rb1  RADIOBUTTON GROUP gr1,                                                  "Contract of Employment

  my_rb2  RADIOBUTTON GROUP gr1.                                                  "B2B





SELECTION-SCREEN END OF BLOCK myblock2.








INITIALIZATION.



AT SELECTION-SCREEN.                                                

  IF
    my_g IS INITIAL AND
    my_dob IS INITIAL AND
    my_ee IS INITIAL.

    MESSAGE e000(zmes1).                "Fill data on selection screen
ENDIF.


SELECT * FROM zemployees.

  IF
    zemployees-dob        IN my_dob    AND
    zemployees-employee   IN my_ee.
   WRITE: / zemployees.
  ENDIF.

ENDSELECT.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 12:57:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921356#M1963892</guid>
      <dc:creator>mateusz_wrobel</dc:creator>
      <dc:date>2019-04-18T12:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement for selection screen - my first ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921357#M1963893</link>
      <description>&lt;P&gt;Display the data after &lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapstart-of-selection.htm"&gt;START-OF-SELECTION. &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 13:26:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921357#M1963893</guid>
      <dc:creator>srikanthnalluri</dc:creator>
      <dc:date>2019-04-18T13:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement for selection screen - my first ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921358#M1963894</link>
      <description>&lt;P&gt;First, read some documentation on &lt;A href="https://help.sap.com/viewer/search?q=Event%20Blocks%20in%20Executable%20Programs"&gt;event block in executable programs&lt;/A&gt; - &lt;A href="https://help.sap.com/doc/PRODUCTION/cfae740a0a21455dbe6e510c2d86e36a/7.3.16/en-US/loio2694c1cb475546e8912dddb56be14584_LowRes.png"&gt;picture&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 13:35:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921358#M1963894</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2019-04-18T13:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement for selection screen - my first ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921359#M1963895</link>
      <description>&lt;P&gt;question 1 handled, thank you.&lt;/P&gt;&lt;P&gt;Can anyone help me with question 2 ?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2019 07:57:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921359#M1963895</guid>
      <dc:creator>mateusz_wrobel</dc:creator>
      <dc:date>2019-04-19T07:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement for selection screen - my first ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921360#M1963896</link>
      <description>&lt;P&gt;Why dont you put it in where clause of select, its basic SQL?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2019 10:19:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921360#M1963896</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2019-04-19T10:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement for selection screen - my first ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921361#M1963897</link>
      <description>&lt;P&gt;I am not a programist. But wanted to learn ABAP so started  few days ago. This is my first contact with such language. That's why asking for little help.&lt;/P&gt;&lt;P&gt;Now my code looks like below. I want to include:&lt;/P&gt;&lt;P&gt;1. my_box1 when zemployees-domestic eq 'x'&lt;/P&gt;&lt;P&gt;2. my_box2 when zemployees-domestic is initial.&lt;/P&gt;&lt;P&gt;3. my_rb1 when zemployees-form -&amp;gt; all values&lt;/P&gt;&lt;P&gt;4. my_rb2 when zemployees-form -&amp;gt; for value "UoP"&lt;/P&gt;&lt;P&gt;5. my_rb3 when zemployees-form -&amp;gt; for value "B2B"&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT z_employee_list_01
LINE-SIZE 132
NO STANDARD PAGE HEADING.


TABLES zemployees.




*****


SELECTION-SCREEN BEGIN OF BLOCK myblock1 WITH FRAME TITLE text-001.


PARAMETERS:


                my_bb     TYPE zemployees-gender       NO-DISPLAY.


SELECT-OPTIONS:


                 my_ee    FOR  zemployees-employee DEFAULT  '10000001' TO '19999999',
                 my_dob   FOR  zemployees-dob,
                 my_g     FOR  zemployees-gender.


SELECTION-SCREEN END OF BLOCK   myblock1.




SELECTION-SCREEN BEGIN OF BLOCK myblock2 WITH FRAME TITLE text-002.


PARAMETERS:
  my_box1 AS CHECKBOX        LIKE zemployees-domestic DEFAULT 'X',                     "Domestic employee
  my_box2 AS CHECKBOX        LIKE zemployees-domestic DEFAULT 'X'.                     "Foreign employee


SELECTION-SCREEN SKIP.


PARAMETERS:
  my_rb3 RADIOBUTTON GROUP       gr1,                                                  "All types of employment
  my_rb1 RADIOBUTTON GROUP       gr1,                                                  "Contract of emploment
  my_rb2 RADIOBUTTON GROUP       gr1.                                                  "B2B




SELECTION-SCREEN END OF BLOCK   myblock2.




**********
INITIALIZATION.


AT SELECTION-SCREEN.                                                
  IF
    my_g IS INITIAL AND
    my_dob IS INITIAL AND
    my_ee IS INITIAL.


    MESSAGE e000(zmes1).




  ENDIF.


*****


START-OF-SELECTION.


  SELECT * FROM zemployees.


    IF


      zemployees-dob        IN my_dob    AND
      zemployees-employee   IN my_ee     AND
      zemployees-gender     IN my_g.


      WRITE: / zemployees.


    ENDIF.
  ENDSELECT.
END-OF-SELECTION.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Apr 2019 11:01:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921361#M1963897</guid>
      <dc:creator>mateusz_wrobel</dc:creator>
      <dc:date>2019-04-19T11:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement for selection screen - my first ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921362#M1963898</link>
      <description>&lt;P&gt;First, you dont have to SELECT...ENDSELECT to check the parameter, put it in where clause like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM zemployees
WHERE 
  dob        IN my_dob    AND
  employee   IN my_ee     AND
  gender     IN my_g.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Second, you have condition for SQL so build it first, after that put it into where clause too:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if my_box1 = 'X'.
 lv_1 = 'X'
endif.
SELECT * FROM zemployees
WHERE 
  dob        IN my_dob    AND
  employee   IN my_ee     AND
  gender     IN my_g AND
  domestic   EQ lv_1.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Apr 2019 01:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921362#M1963898</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2019-04-22T01:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement for selection screen - my first ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921363#M1963899</link>
      <description>&lt;P&gt;&lt;A href="https://www.w3schools.com/sql/"&gt;SQL tutorial&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 03:34:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921363#M1963899</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-04-22T03:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement for selection screen - my first ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921364#M1963900</link>
      <description>&lt;P&gt;Read more tutorials  SQL and ABAP programming.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 10:25:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement-for-selection-screen-my-first-abap/m-p/11921364#M1963900</guid>
      <dc:creator>former_member184158</dc:creator>
      <dc:date>2019-04-22T10:25:59Z</dc:date>
    </item>
  </channel>
</rss>

