Date from the given week nr and year

hi to all
With weeknr, yearnr i need to find STARTDATE (first day of the week), ENDDATE (last day of the week) The first day of the week is always a Monday.
example 44 2007
week nr is 44
year is 2007
how to find it.
is there any standard function module to find.
regards
prathap

Hello Pratap,
Please check the function module 'VELO03_WEEK_OR_MONTH_TO_DATE'.
I also wrote a demo program to test it.
PARAMETER: p_week  TYPE vlc_week DEFAULT '01',
           p_gjahr TYPE gjahr.
DATA: v_dat1 TYPE sy-datum, "Start Date
      v_dat2 TYPE sy-datum. "End Daye
CALL FUNCTION 'VELO03_WEEK_OR_MONTH_TO_DATE'
  EXPORTING
   week_iv             = p_week
    year_iv             = p_gjahr
IMPORTING
   date_ev             = v_dat1
EXCEPTIONS
   week_invalid        = 1
   month_invalid       = 2
   OTHERS              = 3.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
v_dat2 = v_dat1 + 5. "Assuming Saturday is the last day
WRITE: v_dat1, / v_dat2.
Hope this helps. Award points if helpful.
Thanks & Regards,
Suhas.
PS: You can also use the FM 'WEEK_GET_FIRST_DAY'.
Edited by: Suhas Saha on Jan 2, 2008 8:08 AM

Similar Messages

  • DATE FROM THE GIVEN WEEK NUMBER AND YEAR

    hi to all
    With weeknr, yearnr  i need to find STARTDATE  (first day of the week), ENDDATE (last day of the week) The first day of the week is always a Monday.
    example 44 2007
    week nr is 44
    year is 2007
    how to find it.
    is there any standard function module to find.
    regards
    prathap

    hi prathap,
    WEEK_GET_FIRST_DAY For a given week (YYYYMM format), this function returns the date of the Monday of that week.
    try using this function module...
    some other function modules may be helpful...
    DATE_COMPUTE_DAY Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.
    DATE_GET_WEEK will return the week that a date is in.
    DATE_IN_FUTURE Calculate a date N days in the future.
    DAY_ATTRIBUTES_GET Return useful information about a day. Will tell you the day of the week as a word (Tuesday), the day of the week (2 would be Tuedsay), whether the day is a holiday, and more.
    reward if helpful
    regards,
    sravanthi.

  • Ways to get data from the internet with XCode and Objective-C

    Hey guys,
    Thanks in advance for any help. I was simple wondering what the best ways are to get data from the internet to use in an application. For example, is it best to store the data in a MySQL database with PHP and then use C code and MySQL commands to get that data from my Mac app? Is JSON better? Any help would be awesome!
    Josh

    What kind of data are you after?
    Eric

  • Monday's Date  of the given week  and year

    Hi gurus,
    I have the data for week ( eg.52 ) and year ( eg. 08 ) and I need to get the date of the Monday of that week (21-DEC-2008...i.e 52th week of 2008 Year.)
    Pls let me knw the sql statement solution for this ..
    THanks,
    shashi..

    Hi, Shashi,
    There's a bug in what I posted before.
    Do this instead:
    TRUNC ( TO_DATE ( '01-Jul-' || :year_txt
                    , 'DD-Mon-YYYY'
          , 'IY'
          ) + (7 * (:week_val - 1))The only change is in TO_DATE.
    Here's the problem.
    TO_DATE won't work with ISO years; it only takes calendar years.
    When you don't specify a day and month in TO_DATE (like I originally did) it defaults to the first day of the current month. So TO_DATE ('2011', 'YYYY') returns October 1, 2011 when the current month is October, and it returns January 1, 2011 when the current month is January.
    January 1, 2011, however, is in ISO year 2010. (ISO 2011 begins on the Monday closest to January 1, which is January 3, 2011). My original solution, therefore, would return dates from ISO year 2010 when anyone asked for year 2011 and they happend to be running the program during January.
    Specifying a full date makes the expression behave the same regardless of when it is run.

  • How to load dynamic data from the DB...and the answer is not JSP!!!

    The information to be shown on the page has to be loaded dynamically from the database. As opposed to creating in static jsp pages, the fields and their attributes (name, label, etc.) are stored in the database tables, mag_registration_form_header and mag_registration_form_fields.
    So somehow i have to be able to display all the fields and there data on a JSP. The motive behind this is that there will be something like a common template which many modules can use and there will be a single jsp file which will display the contents as per the event...
    The template will be prepared in the java end..
    This has to be done using struts framework....

    AJAX (and a JSP/Servlet that delivers the info the AJAX call requests).
    Edit: If you're talking about changing info already appearing on a loaded page.
    And how is the answer not JSP, when you yourself said you would use JSP to display it.
    I don't believe you know enough about any of this to even be starting on this "project".

  • Export the master data from the existing B1 DB and importing to a new B1 DB

    Hi
    Is there any way to export the master data like item, GL, Business partners from the existing B1 database to a newly created DB. (export from the exissitng DB to a new DB as such) so that all the data will be available in the new DB without transactions
    Thanks in advance

    Dear Sanath
    You may use CopyExpress Add on to do the same . Here you can copy masters from one Database to another with out transactions . This process is very easy also. Some of the customizations also u can do the same way.
    Thanks and Regards
    Rashid

  • 've Password job a year ago to Mobil iPhone 4, and now lost and I can not wipe data from the device or transferred to the new device .. What do I do?

    've Password job a year ago to Mobil iPhone 4, and now lost and I can not wipe data from the device or transferred to the new device .. What do I do?

    iPhones require a SIM for activation.
    Put the device in DFU mode (google it) and restore via iTunes.

  • How to capture the data within the given range of maximum and minimum values ? from csv files

    My requirement,
    1. Here, the user will provide the range like maximum and minimum values, based on this range, the VI should capture the data within the given range. ( from CSV file as attached )
    2. Then VI should calcluate the average value for captured data and export it to excel.
    This is my requirement can anyone help me on this.
    Many thanks in advance
    rc_cks
    Attachments:
    sample_short.csv ‏2439 KB

    Hi,
    Thanks for remnding me. I forgt to attach the VI, 
    Here I am attaching the VI, what I tried. 
    From attached CSV file, I have to find an average value for columns B,C,D,E,F,G,H,I and AJ, AK. ( data range will be defined  by user ), focused only on these columns
    Here, the scope is to calculate an average value for given data range by user as MAX and MIN data.  
    FYI:  I tried manually for two instance i.e column H & I.  As per H column one steady state values from  7500 to 10500 and similarly in I column 7875 to 10050. So, I gave these as a limit to capture and calculate the average value. But unfortunaltely, requirement has been modified as per below requirements.
    More Info on requirement: 
    --> The user will define the range of data by giving some MAXIMUM and MINIMUM values(for above mentioned columns induvidually), then VI should capture          that data range and it has to caculate the average value for that range of data. This is the task I have to complete. 
    --> I am stuck in creating a logic for data capturing for given range of MAX and MIN value from user, 
         Can anyone help me on this. 
    If my explanation is not clear, Please let me know.  
    Many thanks, help mw
    rc
    Attachments:
    VI_rc.vi ‏25 KB
    sample.zip ‏4166 KB

  • Function module to get the dates from the year and the period

    Is there a function Module to get the dates from the year and the period

    Check with :
    To get last day of period use .
    LAST_DAY_IN_PERIOD_GET.
    To get last of month Use :
    RE_LAST_DAY_OF_MONTH
    HRVE_LAST_DAY_OF_MONTH
    LAST_DAY_OF_MONTHS
    ISB_PREVIOUS_PERIOD_DATE_GET
    Thanks
    Seshu

  • Ok, so I want to buy the new iPod touch 5g this week and I have an iPhone 4. I want to transfer all the data from the phone to the iPod and have the files the exact same. I don't want to redo data, say erase game data (campaigns, achievements)...

    Ok, so I want to buy the new iPod touch 5g this week and I have an iPhone 4. I want to transfer all the data from the iPhone to the iPod and have the files the exact same. I don't want to redo data, say erase game data (campaigns, achievements)... I have apps that have very important data on them and if I sync it to iTunes and then transfer all that data to the iPod Touch 5g, will that erase app data?

    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device

  • How to get the date of Friday for the given week

    HI,
    I have a requirement to get the date of Friday for the given week.
    Eg: I have an input of 200722 (Yearweek), From this I need to get the Date of the friday for this week 22 of Year 2007.
    Plz let me know how to get this..
    Thanks in advance..
    Sridhar.

    Hi,
    Thanks for your reply...
    I have implemented your logic but not getting exact output as required.
    Suppose, If i give the input as 200720, I am getting an output as 18 (friday of week 20 of year 2007), but i need to get an output of 18.05.2007
    Plz let me know how to do thdi.
    Thanks in advance..

  • Cannot select a Date in the 2nd week of any month from "Month View"

    Looking for some help with a strange problem that has started within the last day or 2. In Calendar, under the Month view, it will not allow me to select a date in the current week (or the second Week dates in ANY Month for that matter i.e. 6-8-08 thru 6-14-08, 8-3-08 thru 8-9-08, 4-6-08 thru 4-12-08). It skips from the 1st week of June (6-1-08 thru 6-7-08), to the 3rd and 4th weeks of June (6-15-08 thru the end of the month). It is like it is not recognizing where my finger is pointing. I can access the current week through the list view and day view, and it will allow me to post an event by choosing the current week in the add option, but will not let me pick that date to view it once it has been scheduled. The dot shows up, and it shows on list view, but cannot get to the date by selecting it in month view. That section of my phone screen will let me access other applications and recognize where I am touching, so I don't believe it is a sensor issue. I have tried rebooting, but it has not helped. Any ideas out there? Please let me know. Thank You! for any guidance.

    Clearwater Randy,
    If the screen is only not responding in that particular application, you may want to first do a reset. To reset, press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears.
    If that does not resolve your issue, try restoring in iTunes. To restore, connect your iPhone into iTunes and click Restore on the Summary page. Note: All of your information will be erased from the iPhone, so make sure to have a backup of important information on your computer before restoring.
    Hope this helps,
    Jennifer B.

  • I use since 1 year iTunes match. Do I get a mail from apple to renew my subscription or do I have to renew my subscription for my own? I don't know the exactly date from the end of lifetime?

    I use since 1 year iTunes match. Do I get a mail from apple to renew my subscription or do I have to renew my subscription for my own? I don't know the exactly date from the end of lifetime?
    Kind best regards - sunshine34778

    The subscription will renew automatically (unless you have disabled that) and you will get an email approximately one month before renewal.

  • Who worked with ICS' Model 4896 GPIB? I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    Hello. Most of the engineers in developer exchange are more familiar
    with NI products. Contacting ICS for technical support is a better
    course of action.

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

Maybe you are looking for

  • Transfer apps song & video from iPhone 3G to a new PC

    Dear All, I was using iTunes in my old PC. where I did purchased few apps and has song and video. I didn't have any back up of those. Only those are in my iPhone. Can I use a new PC (OS - Windows XP) to Sync few more songs & apps without loosing exis

  • Apple AV cables

    The Apple av cables are awesome. They look great and also give a really crisp picture when connecting the video ipod to a t.v. However if your t.v is more than 25 cm from where you plug in the audio leads then make sure you get a coupler and a photo

  • Infotype Data Upload through transaction PFAL

    Hi All, Is there any option to distrubute data infotype wise in the transaction PFAL, i.e., i want to move the data into a particular infotype only.

  • Unicast Clustering in Weblogic 10.3

    We are using Multicast with Weblogic 9.2 for clustering now but are now migrating to Weblogic 10.3 and want to switch to unicast. The documentation seems kind of hazy for Unicast clustering. I have a few questions. 1)The Unicast Broadcast Channel. Wh

  • Restore ringtones

    Had to get a new iPhone because mine had water damage.  How can I get my ringtones back?