<?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: Variables entered at runtime in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870117#M49709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gaurav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a small tip here. When you are making the post it would be much easier for the readers if the code is properly formatted. For instance, in this case, you SELECT statement could have looked something like this - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT PA0001~UNAME AS P_NAME 
       PA0006~STRAS AS P_STREET 
       PA0006~ORT01 AS P_CITY 
       PA0006~PSTLZ AS P_ZIP 
       PA0008~LGA01 AS P_WAGE_TYPE
  INTO CORRESPONDING FIELDS OF TABLE TEST_TBL
  FROM (   PA0001 INNER JOIN PA0006 
        ON PA0001~PERNR = PA0006~PERNR
           INNER JOIN PA0008 
        ON PA0001~PERNR = PA0008~PERNR )
  WHERE MY_DATE BETWEEN PA0006~BEGDA AND PA0006~ENDDA.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All you need to do is to format your code, select it and use the &amp;lt;b&amp;gt;code&amp;lt;/b&amp;gt; button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jun 2005 14:44:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-06-06T14:44:03Z</dc:date>
    <item>
      <title>Variables entered at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870113#M49705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to extract the values which lie between two dates entered by the user at the run time. For the users to enter the dates, I am using the Select-Options clause.The code is like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS MY_DATE FOR SY-DATUM DEFAULT '19980101' TO '19981231'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: PA0001, PA0006, PA0008.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF TEST_TBL OCCURS 100,&lt;/P&gt;&lt;P&gt;P_NAME LIKE P0001-UNAME,&lt;/P&gt;&lt;P&gt;P_SDATE LIKE P0006-BEGDA,&lt;/P&gt;&lt;P&gt;P_EDATE LIKE P0006-ENDDA,&lt;/P&gt;&lt;P&gt;P_STREET LIKE P0006-STRAS,&lt;/P&gt;&lt;P&gt;P_CITY LIKE P0006-ORT01,&lt;/P&gt;&lt;P&gt;P_ZIP LIKE P0006-PSTLZ,&lt;/P&gt;&lt;P&gt;P_WAGE_TYPE LIKE P0008-LGA01,&lt;/P&gt;&lt;P&gt;END OF TEST_TBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT PA0001&lt;SUB&gt;UNAME AS P_NAME PA0006&lt;/SUB&gt;STRAS AS P_STREET PA0006&lt;SUB&gt;ORT01 AS P_CITY PA0006&lt;/SUB&gt;PSTLZ AS P_ZIP PA0008~LGA01 AS P_WAGE_TYPE&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE TEST_TBL&lt;/P&gt;&lt;P&gt;FROM ( PA0001 INNER JOIN PA0006 ON PA0001&lt;SUB&gt;PERNR = PA0006&lt;/SUB&gt;PERNR &lt;/P&gt;&lt;P&gt;INNER JOIN PA0008 ON PA0001&lt;SUB&gt;PERNR = PA0008&lt;/SUB&gt;PERNR )&lt;/P&gt;&lt;P&gt;WHERE MY_DATE BETWEEN PA0006&lt;SUB&gt;BEGDA AND PA0006&lt;/SUB&gt;ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TEST_TBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: /, TEST_TBL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the dates are entered at runtime, the complier fails to recognize the variable MY_DATE and gives an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2005 14:02:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870113#M49705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-06T14:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Variables entered at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870114#M49706</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;try this logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT PA0001&lt;SUB&gt;UNAME AS P_NAME PA0006&lt;/SUB&gt;STRAS AS P_STREET PA0006&lt;SUB&gt;ORT01 AS P_CITY PA0006&lt;/SUB&gt;PSTLZ AS P_ZIP PA0008~LGA01 AS P_WAGE_TYPE&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE TEST_TBL&lt;/P&gt;&lt;P&gt;FROM ( PA0001 INNER JOIN PA0006 ON PA0001&lt;SUB&gt;PERNR = PA0006&lt;/SUB&gt;PERNR &lt;/P&gt;&lt;P&gt;INNER JOIN PA0008 ON PA0001&lt;SUB&gt;PERNR = PA0008&lt;/SUB&gt;PERNR )&lt;/P&gt;&lt;P&gt;WHERE PA0006~BEGDA le my_date-low&lt;/P&gt;&lt;P&gt;  AND PA0006~ENDDA ge my_date-high&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2005 14:08:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870114#M49706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-06T14:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Variables entered at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870115#M49707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi dear &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz try this&lt;/P&gt;&lt;P&gt;SELECT PA0001&lt;SUB&gt;UNAME AS P_NAME PA0006&lt;/SUB&gt;STRAS AS P_STREET PA0006&lt;SUB&gt;ORT01 AS P_CITY PA0006&lt;/SUB&gt;PSTLZ AS P_ZIP PA0008~LGA01 AS P_WAGE_TYPE&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE TEST_TBL&lt;/P&gt;&lt;P&gt;FROM ( PA0001 INNER JOIN PA0006 ON PA0001&lt;SUB&gt;PERNR = PA0006&lt;/SUB&gt;PERNR &lt;/P&gt;&lt;P&gt;INNER JOIN PA0008 ON PA0001&lt;SUB&gt;PERNR = PA0008&lt;/SUB&gt;PERNR )&lt;/P&gt;&lt;P&gt;WHERE PA0006~BEGDA in MY_DATE &lt;/P&gt;&lt;P&gt;and  PA0006~ENDDA in MY_DATE  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2005 14:22:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870115#M49707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-06T14:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Variables entered at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870116#M49708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that this syntax would cover the bases a little better.  Using select-options,  the user doesn't have to use a positive range.  Try this where statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

where pa0006~begda in my_date
  and pa0006~endda in my_Date.

&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>Mon, 06 Jun 2005 14:24:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870116#M49708</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-06-06T14:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Variables entered at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870117#M49709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gaurav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a small tip here. When you are making the post it would be much easier for the readers if the code is properly formatted. For instance, in this case, you SELECT statement could have looked something like this - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT PA0001~UNAME AS P_NAME 
       PA0006~STRAS AS P_STREET 
       PA0006~ORT01 AS P_CITY 
       PA0006~PSTLZ AS P_ZIP 
       PA0008~LGA01 AS P_WAGE_TYPE
  INTO CORRESPONDING FIELDS OF TABLE TEST_TBL
  FROM (   PA0001 INNER JOIN PA0006 
        ON PA0001~PERNR = PA0006~PERNR
           INNER JOIN PA0008 
        ON PA0001~PERNR = PA0008~PERNR )
  WHERE MY_DATE BETWEEN PA0006~BEGDA AND PA0006~ENDDA.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All you need to do is to format your code, select it and use the &amp;lt;b&amp;gt;code&amp;lt;/b&amp;gt; button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2005 14:44:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870117#M49709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-06T14:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Variables entered at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870118#M49710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to contact you.  Can you please email me at sanghaonline-stuff@yahoo.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2005 19:08:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870118#M49710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-06T19:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Variables entered at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870119#M49711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gaurav&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend you to make the user enter date criteria via PARAMETERS, rather than select-options. This is the way SAP uses in standard, too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have visual concerns to bring two parameter fields to one line in selection screens. Then you can use : (there might be something to edit since I did not try the following code at the system)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN COMMENT 20(15) 'Begin Date' FIELD p_begda .
PARAMETERS p_begda TYPE begda .
SELECTION-SCREEN COMMENT 50(15) 'End Date' FIELD p_endda .
PARAMETERS p_endda TYPE endda .
SELECTION-SCREEN END OF LINE .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After defining your period's begin and end date you can select HR records from an infotype table using the where condition, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT ... FROM PAXXXX
       INTO TABLE gt_itab
       WHERE &amp;lt;other_conditions&amp;gt; AND
             begda LE p_endda AND
             endda GE p_begda .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Serdar &amp;lt;a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d"&amp;gt;[ BC ]&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2005 23:46:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variables-entered-at-runtime/m-p/870119#M49711</guid>
      <dc:creator>ssimsekler</dc:creator>
      <dc:date>2005-06-06T23:46:58Z</dc:date>
    </item>
  </channel>
</rss>

