<?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: date issue in selection screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753856#M326759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alka&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare a variable as type sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the initialization event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get the sy-datum in the variable and using the offset change the last 2 digits of the variable to 01.&lt;/P&gt;&lt;P&gt;and then use that variable in ur selection screen as default value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Dec 2006 07:29:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-15T07:29:15Z</dc:date>
    <item>
      <title>date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753853#M326756</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;the requirement is: date,customers and sales order are the selection parameters for excecuting the report. now the requirement is that this report is executed monthly on the 1st working day of the every month and seclection screen should show the date as date of  the 1st working day of that month when ever that report's screen is opened for exectution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;alka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 07:21:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753853#M326756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T07:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753854#M326757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;U can do the coding in INITIALIZATION event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U have to use factory calender....there is function module to get factory calender based on the input date....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 07:26:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753854#M326757</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T07:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753855#M326758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt;  What you can do is in the INITIALIZATION event write the code for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and since you want the first working day , so you need to know the factory calender ID , once you know that use the FM DATE_CONVERT_TO_FACTORYDATE , to check whether a day is working day or not . &lt;/P&gt;&lt;P&gt;So start from 1'st of the month and try this FM to check if it is a working day or not , else move to next date.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Arun R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 07:28:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753855#M326758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T07:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753856#M326759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alka&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare a variable as type sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the initialization event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get the sy-datum in the variable and using the offset change the last 2 digits of the variable to 01.&lt;/P&gt;&lt;P&gt;and then use that variable in ur selection screen as default value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 07:29:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753856#M326759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T07:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753857#M326760</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 dont think there is any direct way to get that date,&lt;/P&gt;&lt;P&gt;but with some calculations with FM DATE_CHECK_WORKINGDAY you will get that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 07:29:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753857#M326760</guid>
      <dc:creator>amit_khare</dc:creator>
      <dc:date>2006-12-15T07:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753858#M326761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alka,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can use FM DATE_CONVERT_TO_FACTORYDATE  and check if it is working day or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 07:43:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753858#M326761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T07:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753859#M326762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;confirm this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;the date is being picked up on plant level or company code .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for this the field has to go through a chk on the  factory calender id ..&lt;/P&gt;&lt;P&gt;TFACD .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the calender id  associated with it ( plant/company code ) u need to confirm this before writing a code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the entry T001W-FABKL for the plant and see what is the calender id it is referring to .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; is date in ur query a parameter?&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 07:54:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753859#M326762</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T07:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753860#M326763</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;Initialization.&lt;/P&gt;&lt;P&gt;p_date = sy-datum.&lt;/P&gt;&lt;P&gt;concatenate sy-datum&lt;EM&gt;0(4)  p_date&lt;/EM&gt;4(2) '01' into p_date.&lt;/P&gt;&lt;P&gt;use fm date_check_working_day as suggested.&lt;/P&gt;&lt;P&gt;If p_date is not working day,try adding p_date = p_date + 1.&lt;/P&gt;&lt;P&gt;Then check again using fm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 08:03:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753860#M326763</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-12-15T08:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753861#M326764</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;the missing link ( of ur calender id  ) u did not mail us back  u will have to find this if not now but by the end of ur application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When ever u r making a check on working day u need to specify for what calender id .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is a sample code for ur understanding .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZVIJ2 .

DATA : V_DATE LIKE SY-DATUM.


parameters :p_date like sy-datum .
**first working day of the month .

Initialization.       " u need to put ur code over here.
data :  cdat  like sy-datum.

        cdat = sy-datum.    "YYYYMMDD

        CDAT+6(2) = '01'. "RESET THE MONTH TO FIRST DATE
        PERFORM GET_FIRST_WRK_DAY.
*        write:/ 'First working day ' , v_date.
         p_date = v_date.
form GET_FIRST_WRK_DAY.


 CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
             EXPORTING
               date                             = cdat
               factory_calendar_id              = 'US'
               message_type                     = 'I'
            EXCEPTIONS
              DATE_AFTER_RANGE                 = 1
              DATE_BEFORE_RANGE                = 2
              DATE_INVALID                     = 3
              DATE_NO_WORKINGDAY               = 4
              FACTORY_CALENDAR_NOT_FOUND       = 5
              MESSAGE_TYPE_INVALID             = 6
              OTHERS                           = 7
                     .

          IF SY-SUBRC EQ 0.
            v_date = cdat.
           ELSE.
            add 1 to cdat.
            perform GET_FIRST_WRK_DAY.
          ENDIF.

endform.                    " GET_FIRST_WRK_DAY&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_date parameter is automatically populated with the first working day .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will chk for the first hit of the working day for that particular calid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;execute this for ur understanding .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;Here 's the link u have to check  in the FM u need to pass  CALID factory calender id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so for reference sake im using for US (usa) , i have hard quoted it but u need to pass it as a parameter from t001W-fabkl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so here u need to give the country u r referring to as the parameter. &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;this is the vital link to ur query .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example say may 1 of 2006 is working day in usa but for china it is a holiday .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so reference to calid will look for the application of the working calender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so in order to fetch this simply do &lt;/P&gt;&lt;P&gt; DATA: calid LIKE tfacd-ident.&lt;/P&gt;&lt;P&gt;   SELECT SINGLE fabkl INTO calid FROM t001w&lt;/P&gt;&lt;P&gt;           WHERE werks  "  = the missing link. " &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and pass this calid to ur Fm insted of hard quoted value as  shown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 08:40:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753861#M326764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T08:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753862#M326765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To keep things simple,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can do it without changing the code of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save a variant and change the attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For doing so, follow as below:&lt;/P&gt;&lt;P&gt;1. Go the selection-screen&lt;/P&gt;&lt;P&gt;2. Click on save&lt;/P&gt;&lt;P&gt;3. In the next screen give name and description for the variant&lt;/P&gt;&lt;P&gt;4. Select the check box under 'L- Selection Varable' corresponding to the date parameter.&lt;/P&gt;&lt;P&gt;5. Now click on selection-variables from the application toolbar&lt;/P&gt;&lt;P&gt;6. Click on Icon under 'D' in the next screen&lt;/P&gt;&lt;P&gt;7. Click on Arrow pointing down beside the parameter&lt;/P&gt;&lt;P&gt;8. From the list that pops up, select "First day of current month".&lt;/P&gt;&lt;P&gt;9. Save twice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now select the variant to see that the first date of the current month has come to the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try practising this approach as this helps especially while scheduling the jobs...&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 Dec 2006 08:50:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753862#M326765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T08:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: date issue in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753863#M326766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx a lots for helping me in resolving the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Dec 2006 02:36:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date-issue-in-selection-screen/m-p/1753863#M326766</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-19T02:36:13Z</dc:date>
    </item>
  </channel>
</rss>

