<?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: Looking for a function to convert data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451721#M213916</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xavier,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          Use FM &amp;lt;b&amp;gt;WEEK_GET_FIRST_DAY&amp;lt;/b&amp;gt; to get the first day of the week.&lt;/P&gt;&lt;P&gt;This will accept WEEK as YYYYWW and gives DATE as DD.MM.YYYY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA V_DATE LIKE SCAL-DATE.&lt;/P&gt;&lt;P&gt;DATA V_WEEK LIKE SCAL-WEEK VALUE '&amp;lt;b&amp;gt;YYYYWW&amp;lt;/b&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL FUNCTION 'WEEK_GET_FIRST_DAY'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    week               = V_WEEK&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   DATE               = V_DATE&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   WEEK_INVALID       = 1&lt;/P&gt;&lt;P&gt;   OTHERS             = 2.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;WRITE:/ V_DATE. "&amp;lt;b&amp;gt;DD.MM.YYYY&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jun 2006 13:58:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-28T13:58:19Z</dc:date>
    <item>
      <title>Looking for a function to convert data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451717#M213912</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 want to know if exists a function to convert from weekly date 'ww.yyyy' to the first day of this week: 'yyyymmdd'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if not, just some idea to do it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's in advance!&lt;/P&gt;&lt;P&gt;Xavi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 13:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451717#M213912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-28T13:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function to convert data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451718#M213913</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;Use FM BWSO_DATE_GET_FIRST_WEEKDAY to get the first day of the week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FM WEEK_GET_FIRST_DAY:-&lt;/P&gt;&lt;P&gt;e.g input 200602 (YYYYWW)&lt;/P&gt;&lt;P&gt;output 09.01.2006 (DDMMYYYY)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sameena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 13:37:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451718#M213913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-28T13:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function to convert data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451719#M213914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi you could use the FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For beginning date use yyyy from your field concatenated with 0101&lt;/P&gt;&lt;P&gt;that is yyyy0101&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the duration multiply  by ww say (03) by 7 and subtract 7 or ww-1 multiplied by 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g 032005 would give&lt;/P&gt;&lt;P&gt;begin date 20050101&lt;/P&gt;&lt;P&gt;and duration would be (03-1) *7 = 14&lt;/P&gt;&lt;P&gt;so the field caldd in wa_duration would be equal to 14.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        id_date                  = begin_date&lt;/P&gt;&lt;P&gt;        id_operator              = '+'&lt;/P&gt;&lt;P&gt;        is_duration              = wa_duration&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        ed_date                  = date&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        conversion_not_specified = 1&lt;/P&gt;&lt;P&gt;        conversion_not_possible  = 2&lt;/P&gt;&lt;P&gt;        OTHERS                   = 3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 13:39:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451719#M213914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-28T13:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function to convert data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451720#M213915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this sample program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


report zrich_0001 .

data: monday type sy-datum.
data: sunday type sy-datum.
data: week type scal-week.

call function 'GET_WEEK_INFO_BASED_ON_DATE'
     exporting
          date   = sy-datum
     importing
          week   = week
          monday = monday
          sunday = sunday.

write:/ 'This week is', week.
write:/ 'Last Monday was', monday.
write:/ 'Next Sunday is', sunday.
&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>Wed, 28 Jun 2006 13:42:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451720#M213915</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-28T13:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function to convert data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451721#M213916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xavier,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          Use FM &amp;lt;b&amp;gt;WEEK_GET_FIRST_DAY&amp;lt;/b&amp;gt; to get the first day of the week.&lt;/P&gt;&lt;P&gt;This will accept WEEK as YYYYWW and gives DATE as DD.MM.YYYY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA V_DATE LIKE SCAL-DATE.&lt;/P&gt;&lt;P&gt;DATA V_WEEK LIKE SCAL-WEEK VALUE '&amp;lt;b&amp;gt;YYYYWW&amp;lt;/b&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL FUNCTION 'WEEK_GET_FIRST_DAY'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    week               = V_WEEK&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   DATE               = V_DATE&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   WEEK_INVALID       = 1&lt;/P&gt;&lt;P&gt;   OTHERS             = 2.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;WRITE:/ V_DATE. "&amp;lt;b&amp;gt;DD.MM.YYYY&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jun 2006 13:58:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451721#M213916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-28T13:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a function to convert data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451722#M213917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi people!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally I used this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my date was: RV45A-KETDAT type 'wwyyyy' and the function needs the week date like 'yyyyww'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE RV45A-KETDAT+3(4) RV45A-KETDAT(2) INTO Ex_Week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'WEEK_GET_FIRST_DAY'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          week         = Ex_Week&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          DATE         = Ex_Monday&lt;/P&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;P&gt;          WEEK_INVALID = 1&lt;/P&gt;&lt;P&gt;          OTHERS       = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the first day of the week is: Ex_Monday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Vinay... I didn't see yours! hehe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 08:05:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-a-function-to-convert-data/m-p/1451722#M213917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T08:05:30Z</dc:date>
    </item>
  </channel>
</rss>

