Week Number of the current week...URGENT

hi gurus,
I want to calculate the week number of the current week as per Fiscal year.
What variable or the Customer Exit code needs to be written for it?
regards

Hi Venu,
   Use the code below. I assume that the client is US based where the Fiscal Year starts 1st October every year.  Just in case the fiscal year starts in some other month then adjust the code (if SY-DATUM+4(2) >= 10.) below. Hope this helps.
DATA: PFY(8)   TYPE C.
DATA: CFY(4)   TYPE C.
DATA: LFY      TYPE I.
DATA: FYD      TYPE I.
DATA: TWD      TYPE I.
DATA: RES      TYPE I.
if SY-DATUM+4(2) >= 10.
  concatenate SY-DATUM+0(6)
              '01'
         into PFY.
else.
  LFY = SY-DATUM+0(4).
  LFY = LFY - 1.
  CFY = LFY.
  concatenate CFY
              SY-DATUM+4(2)
              '01'
         into PFY. 
endif.
FYD = P_FY.
TWD = SY-DATUM.
RES = ( TWD - FYD ) / 7.
Write: Res.

Similar Messages

  • Indesign CS3: How to get the number of the current layer?

    Hallo!
    How to get the number of the current layer in a page?
    Thanks,
    Alois Blaimer

    InterfacePtr<ILayerList> layerList(documentUIDRef, UseDefaultIID());          <br /><br />int32 layerCount = layerList->GetCount();<br /><br />To findout layer name use<br /><br />IDocumentLayer* documentLayer = layerList->QueryLayer(layerIndex);<br />                         <br />PMString layer=documentLayer->GetName();

  • Is there a way go get the item number of the current item?

    In an item with multiple instances: Is there a way to get the item number of the current item? If for instance, I am on the 3rd item, is there some kind of “GET CURRENT RECORD NUMBER” built-in that would return a ‘3' to the program?
    Thanks
    Edited by: WayneFMcKinstry on Apr 9, 2010 10:50 AM

    If i am getting you correctly that in tabular item you want to know the current record or current item you can try this...
    For current record
    :SYSTEM.CURSOR_RECORD;
    or
    :SYSTEM.CURRENT_RECORD;for current item
    :SYSTEM.CURSOR_ITEM;-Ammad

  • I can't get the row number of the current selection

    Hi all,
    How can I get the row number of a selection if I don't know the range selected? I need it to store in variable.
    I've tried in many ways, but unsuccesfully.
    Thank's in advance.

    If you already know the document's name, the sheet's name and the table's name, the easy way is :
    --Here you may replace the three values by the current ones
    set dName to 1
    set sName to 1
    set tName to 1
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    tell first cell of the selection range to set {rowNum1, columnNum1} to {address of its row, address of its column}
    tell last cell of the selection range to set {rowNum2, columnNum2} to {address of its row, address of its column}
    end tell
    Yvan KOENIG (VALLAURIS, France) mercredi 9 février 2011 17:22:21

  • Trap the currently executing line number?

    Hi,
    how can one get the number of the currently executing line of code?
    Like what is generated when there are compilation/runtime errors.
    I saw LineNumberReader() & getLineNumber() but they seem to be for reading files or a jpanel (I think).
    thanks,
    HSC

    ok, with all your help I managed to get this:
                //----------------- stack trace for debugging ------------------           
                StackTraceElement[] e = new Throwable().getStackTrace();
                StackTraceElement stack[] = e;
                // stack[0] contains the method that created the exception.
                // stack[stack.length-1] contains the oldest method call.
                // Enumerate each stack element.
                //for (int i=0; i<stack.length; i++)
                int i=0;
                String filename = stack.getFileName();
    if (filename == null) {
    // The source filename is not available
    String className = stack[i].getClassName();
    String methodName = stack[i].getMethodName();
    boolean isNativeMethod = stack[i].isNativeMethod();
    int line = stack[i].getLineNumber();
    System.out.println(
    " >>className =" + className +
    " >> methodName =" + methodName +
    " >> line = " +line
    // } //end-for
    //----------------- stop stack trace for debugging ------------------
    Still don't quite understand it all but considering I've been learning java on my own for about 3 weeks I figure I'm doing better than a lot of newbies. - I am frustrated as hell, but I don't give up!
    thanks.
    Note: anyone looking for code examples you can look at: "The Java Developers Almanac 1.4" http://javaalmanac.com/

  • Hi. Which of the current macbooks has a keyboard similar to a macbook pro 2012 model?

    Hi,
    I was in PCWorld the other day and tried out the keyboards on a number of the current crop of MacBook Pros and Airs. I have used a number of thinkpads over the years and so I guess I'm kind of used to a certain type of keyboard which gives good tactile feedback and where the keys have a fair amount of 'travel' which I felt wasn't the case with the new macbooks.However, this was not the impression I had when I tried an older MacBook Pro (non-retina) which had a noticeably different feel to it - the keys seemed to be higher and there appeared to be a greater amount of travel - the end result being a much better typing experience. My question is, do any of the current MacBook models have the same keyboard of typing 'feel' of the older MacBook pro?
    Thanks in advance.

    Sorry about the typo in the last sentence. It should read: 'My question is, do any of the current MacBook models have the same keyboard or typing 'feel' of the older MacBook pro?'

  • Urgent ---calculate version  from the current week number

    hi,
         i have an requrenment to modify the charasteric routines
      i have xxx table with parameter i have to read this paramater n  if this parameter contains value 'D' then calculate version(eg:- A00,A01 ...) from the current week number.
    pls advice me which FM i have to call or provide me with some sample codeing.
    points wil be rewarded
    ravi

    There is a FM "WEEKNR_GET".
    This will give you the week no. You need to read the param value from the table that you mentioned and call this FM and updat the version.
    You will need a ABAP person to do this.
    Ravi Thothadri

  • Number of the week in Ical

    Howcome the number of the week isn´t shown in Ical????

    there's no option for a week view in iCal, but John Maisey wrote this applescript.
    paste it in the Script Editor (Applications --> AppleScript --> Script Editor) and run it once...
    if your weekview starts on an other day change this line:
    set daysText to "MonTueWedThuFriSatSun"
    to (example)
    set daysText to "SunMonTueWedThuFriSat"
    --Copy below this line into Script Editor and click run --
    --Annual Week numbers
    --John Maisey
    --4/2/5
    set numberOfWeeks to 1000 -- change as needed
    set daysText to "MonTueWedThuFriSatSun"
    set aDate to (current date)
    set day of aDate to 1
    set month of aDate to January
    set aDay to weekday of aDate
    set weekNo to 1
    --Day of week as num. starting with 0
    set aDayText to (characters 1 thru 3 of (aDay as text)) as text
    set dayOff to ((offset of aDayText in daysText) - 1) / 3 as integer
    if dayOff is less than 5 then
    set StartDate to aDate - dayOff * days
    else
    set StartDate to aDate + (7 - dayOff) * days
    end if
    tell application "iCal"
    set newCal to make new calendar at end of calendars with properties {title:"Week No."}
    set myCal to (count of every calendar)
    end tell
    repeat with myCount from 1 to numberOfWeeks
    if (month of StartDate is December) and (day of StartDate is greater than 28) then set weekNo to 1
    if (month of StartDate is January) and (day of StartDate is less than 5) then set weekNo to 1
    set weekText to "Week No. " & weekNo
    tell application "iCal"
    tell calendar myCal
    make new event at end of events with properties {start date:StartDate, allday event:true, summary:weekText}
    end tell
    end tell
    set weekNo to weekNo + 1
    set StartDate to StartDate + 7 * days
    end repeat
    --

  • How to know the number of the week in iCal ?

    Hi !
    I'm very enjoying iCal. But, there is something very important for me that I can't find in iCal !
    I need to know the number of the week (in Month, Week or Day views).
    Is that a way to easily see it ?
    Regards,
    ant
    iMac G5   Mac OS X (10.4.2)  

    there's no option for a week view in iCal, but John Maisey wrote this applescript.
    paste it in the Script Editor (Applications --> AppleScript --> Script Editor) and run it once...
    if your weekview starts on an other day change this line:
    set daysText to "MonTueWedThuFriSatSun"
    to (example)
    set daysText to "SunMonTueWedThuFriSat"
    --Copy below this line into Script Editor and click run --
    --Annual Week numbers
    --John Maisey
    --4/2/5
    set numberOfWeeks to 1000 -- change as needed
    set daysText to "MonTueWedThuFriSatSun"
    set aDate to (current date)
    set day of aDate to 1
    set month of aDate to January
    set aDay to weekday of aDate
    set weekNo to 1
    --Day of week as num. starting with 0
    set aDayText to (characters 1 thru 3 of (aDay as text)) as text
    set dayOff to ((offset of aDayText in daysText) - 1) / 3 as integer
    if dayOff is less than 5 then
    set StartDate to aDate - dayOff * days
    else
    set StartDate to aDate + (7 - dayOff) * days
    end if
    tell application "iCal"
    set newCal to make new calendar at end of calendars with properties {title:"Week No."}
    set myCal to (count of every calendar)
    end tell
    repeat with myCount from 1 to numberOfWeeks
    if (month of StartDate is December) and (day of StartDate is greater than 28) then set weekNo to 1
    if (month of StartDate is January) and (day of StartDate is less than 5) then set weekNo to 1
    set weekText to "Week No. " & weekNo
    tell application "iCal"
    tell calendar myCal
    make new event at end of events with properties {start date:StartDate, allday event:true, summary:weekText}
    end tell
    end tell
    set weekNo to weekNo + 1
    set StartDate to StartDate + 7 * days
    end repeat
    --

  • We sent you three weeks ago add-on ImageExchange 2.9.4 and it still did not pass "fully reviewed" is there a reason? The current version do not support FF 18

    We sent you three weeks ago add-on ImageExchange 2.9.4 and it still did not pass "fully reviewed" is there a reason?
    The current version do not support FF 18 so the issue is urgent
    Thanks
    Eyal Shaked - Picscout

    I talked to the Addons people, and apparently your add-on was rejected several weeks ago. They said to read the email you received from them for those reasons. I'm locking this thread as this is a Firefox support forum, not an extension dev support site.

  • I recently upgraded to iWork v9.0.3, but when I access each applications the versions are different (i.e. Pages V.4.1, Numbers V2.6, Keynote V5.1.1) with a install date of 3/18/09 -- which is not the current install date of 2 weeks ago. Why?

    I recently upgraded to iWork v9.0.3, but when I access each applications the versions are different (i.e. Pages V.4.1, Numbers V2.6, Keynote V5.1.1) with a install date of 3/18/09 -- which is not the current install date of 2 weeks ago. Shouldn't Pages, Numbers, and Keynote show version 9.?? My MAC confirned installation of v9.0.3 and even accepted the software code. With this discrepancy, how can I determine if the latest was installed and operational? I even downloading v9.0.4, 9.0.5, and 9.1. When I tried installing these downloads it popped up note stating that a later version of Keynote was already installed.

    You used the data.  Verizon can not see what it was sued for.  However your phone can see whats apps used the data.  go to settings-data usage- there will be a place that says data usage cycle.  line the dates up with your cycle.  then there will be a bar graph below that   extend bother white bars one all the way to the left and one all the way to the right.  after those are extended below that will be a list of apps,  there should be one that used over 2 gb and that will show you what app used that data in her purse

  • Date - how to get the number of the week

    I have a Date - string - w/e can be convered thats not the problem
    but how do I get the number of the week cuz the database holds events per week so I need to know the number of the week.
    I tried going true the api but I failed to find the right fuction, aldoh I recall seeing it somewhere a while ago.
    anyways got a deathline so easy dukies, first come first serve.

    how's this then?int weekOfYear = 0;
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); //your String format
    Date date = null;
    String dateString = "2003/06/16";
    try {
      date = sdf.parse(dateString);
    } catch (ParseException pe) {
      //hande bad date format
    if (date != null) {
      GregorianCalendar calendar = new GregorianCalendar();
      calendar.setTime(date);
      weekOfYear = calendar.get(Calendar.WEEK_OF_YEAR);
    Warning: Be careful of your locale settings when using week of year, you may need to investigate setFirstDayOfWeek(int value) and setMinimalDaysInFirstWeek(int value) to ensure you get the results you expect.

  • How to get week of the current month

    Hi all,
    Is there any way to find out week of the current month.
    Please help..

    Do not confuse date format and the parameter in the file NqsConfig.ini
    http://gerardnico.com/wiki/dat/obiee/bi_server/nqsconfig
    As say in the previous link, you must check in the NqsCOnfig.ini file that you have this line
    DATE_TIME_DISPLAY_FORMAT = "yyyy/mm/dd hh:mi:ss" ;because the cast function take it as format to discover the day, month and year.
    Besides, the functions WEEK_OF_YEAR AND MONTH don't care about the date format, they only need a date.
    Check here this article :
    http://gerardnico.com/wiki/ide/toad/toad_date_format
    To see that the date format is much more a question of rendering (for OBIEE, Toad or SqlPlus) than of data.
    Verify your NqsConfig.ini and give a try.
    Success
    Nico

  • How to get the current week from sysdate?

    Hi sir,
    i want to know how to get the current week from sysdate?
    thanks

    Hi Nicolas
    It seems you like to check my post and also make commend ;) thanks for your attention
    Have you ever read the posts above and given solutions ?Yes, I did
    Have you read the docs ? Yes, I checked
    What's the added value here ?Did youYou shared doc with solution(long one), I shared short one which point same solution(Check what Joel posted)..So what is benefit, As you can guess oracle docs are sometimes become so complicated as specialy for beginner...(At least it was like that for me and Belive me somedocs are still sooo complicated even for oracle coworkers ) But for you I dont know ;)
    => Why writting the PS in bold ?Why.. Let me think... Ohh Maybe I am looking some questions(many) and even user get answer they should not changed status so I am reading some posts and try to get problem and loosing time..
    So I am putting that PS wiht BOLD because I dont wanna lose time my friend ;) Because While I am trying to help ppl here In same time I am trying to giving support to my customer prod systems. Which mean time is very important for me...
    Hope my answer could satisfy you..
    One important PS for you.. You may not like my posts (or someone) but my friend I become tired to read&answer and make commend to on your comment which is about my posts.
    I am not newbie in forum(At least I fell like that) and I belive I know how I should make post..
    Thank you
    Regards
    Helios

  • How to get a week number  for the year using oracle sql query?

    hi everyone,
    i have the requirement to find the week number for the calender..
    so that week number should start with 01 when the year starts and it should end with week end date(that is first saturday of the january month).. so next week number starts with sunday and ends with saturday ,continously.. in the end date of the year it should not be 'saturday' but week number should end with last date of the year.. again in the next year it should start with '01'.
    for example:
    01-JAN-13 tuesday 01
    02-JAN-13 wednesday 01
    03-JAN-13 thursday 01
    04-JAN-13 friday 01
    05-JAN-13 saturday 01
    06-JAN-13 sunday 02
    07-JAN-13 monday 02
    26-DEC-13 thursday 52
    27-DEC-13 friday 52
    28-DEC-13 saturday 52
    29-DEC-13 sunday 53
    30-DEC-13 monday 53
    31-DEC-13 tuesday 53
    01-JAN-14 wednesday 01
    02-JAN-14 thursday 01
    how can i achieve this, can anyone please help me out on this..
    i have a query that starts with 01 when year starts but it gives problem in the end of the year .. described below with a query..
    select mydate,
    to_char(mydate,'day') as weekday,
    to_char(next_day(mydate,'sunday'),'iw') as week_num
    FROM ( SELECT TRUNC (SYSDATE, 'yy') - 1 + LEVEL AS mydate
    FROM dual
    CONNECT BY LEVEL <= (SELECT TRUNC (ADD_MONTHS (SYSDATE, 24), 'yy')
    - TRUNC (SYSDATE, 'yy')
    FROM DUAL))
    this query gives date, weekday and week_num for 2 years 2013 and 2014,
    when i run this query ,at the end of the 2013 it gives the result as,
    26-DEC-13     thursday      52
    27-DEC-13     friday      52
    28-DEC-13     saturday      52
    29-DEC-13     sunday      01
    30-DEC-13     monday      01
    31-DEC-13     tuesday      01
    01-JAN-14     wednesday     01
    02-JAN-14     thursday      01
    for dates 29 ,30,31st it should give 53 .. how can i achieve that using this this query .. can any one help me out on this please...
    thanks,
    pradeep

    I tried with the IW ...
    it is giving week_id for the year.
    select
    mydate,
    to_char(mydate,'day'),
    case when mydate between trunc(mydate,'yyyy') and next_day(trunc(mydate,'yyyy'),'saturday')
    then to_number(to_char(mydate,'yyyy')||to_char(trunc(mydate,'yyyy'),'iw'))
    when mydate between next_day(trunc(mydate,'yyyy'),'saturday') and trunc(add_months(trunc(mydate,'yyyy'),12)-1,'d')-1
    then to_number(to_char(mydate,'yyyy')||to_char(next_day(mydate,'sunday'),'iw'))
    when mydate between trunc(add_months(trunc(mydate,'yyyy'),12)-1,'d') and add_months(trunc(mydate,'yyyy'),12)-1
    then to_number(to_char(mydate,'yyyy')||to_char(trunc(add_months(trunc(mydate,'yyyy'),12)-1,'d')-1,'iw')+1) end as WEEK_ID
    FROM ( SELECT TRUNC (SYSDATE, 'yy') - 1 + LEVEL AS mydate
    FROM dual
    CONNECT BY LEVEL <= (SELECT TRUNC (ADD_MONTHS (SYSDATE, 24), 'yy')
    - TRUNC (SYSDATE, 'yy')
    FROM DUAL
    ))

Maybe you are looking for

  • Can not filter the data with the extended class

    Hi, I have a quick question about PortableObject format. I have created a class which extends PortableObject interface and implemented serializer methods as well. I have updated it in the pof-config.xml file as well. If I insert the objects of this t

  • Oracle Java Call

    Dear All, Need your help. I am posting my sample class below public static java.sql.ResultSet getData(String dbConnectStr,String dbuserID,String dbpwd,String query) throws Exception // Obtain default connection // Query all columns from the EMP table

  • "Java Concurrent Program" java.lang.ClassNotFoundException:

    I am creating one Concurrent Program Type "Java Concurrent Program", I followed steps as notes "250964.1" Deployed the java file to specific Directory in $JAVA_TOP Bounce the apache. I am getting this issue? java.lang.ClassNotFoundException: oracle.a

  • (Video) LightSwitch Cloud Business Apps and SharePoint Workflows

    You can create advanced enterprise applications when you incorporate Visual Studio LightSwitch Cloud Business Apps and SharePoint Workflows into your solutions. Microsoft SharePoint workflows are powerful, but the non-code version created with the Sh

  • Hi Plan not workinG

    Hi i don't if this is the correct place i have been charged for my 400min plan and it won't work, i'm using my own credit i was charged on the 18th, and on the my account i can read that minutes would start on tge 21th , today. What should i do?