How to get Current week and No of Weeks for each quarter!!

Hi,
As a part of report development I have to derive Current week and No.of Weeks in Curreny Query. Based on these information I have to calculate Phased target (Calculated KYF).
Phased target = (Target for Quarter / No of weeks in Current Quarter) X Current Week.
We have to derive Current Quarter and Current week from  Customer Exit (From Invoice date, which is an entry by Users at report level).
My questions are:
1) We have to derive Two Restricted key figures (by Calweek)  for derving No of weeks for Currnet Quarter and Current week in Query level. Based on this info, we have to derive Calculated kef figure for Phased target.
2) And the output is 6 (ex:- 132008) char length for Current week and we have to pick Week info only and we have to populate RKF created for Current week. How we can achieve this.
3) Regarding the No of weeks per for current quarter, we are writing Customer exit to determine Quarter and no of weeks, but how to bring this info in query level.
4) Is there any standard code available (SAP Exit) to find Current week and No of Weeks in Current quarter.
Regards,
Suresh Molli

Hi Venkat Molli,
Follow the below step for the doing the same:
1. Create a customer exit variable on calweek.
2. Restrict the created variable for respective info object.
3. To Populate the data write code in CMOD.
     in enhancement function module: EXIT_SAPLRRS0_001 -> in Include ZXRSRU01 write the below code:
WHEN '<variable name>'.
     IF i_step = 1.
      CLEAR l_s_range.
      CALL FUNCTION 'RSVAREXIT_0P_CWEEK'
        IMPORTING
          e_t_range = lt_week.
      READ TABLE lt_week INTO l_s_range1 INDEX 1.
      v_last_week = l_s_range1-low+4(2).
      v_last_week =  v_last_week - 1.
      l_s_range1-low+4(2) = v_last_week.
      l_s_range-low      =  l_s_range1-low.
      l_s_range-sign     = 'I'.
      l_s_range-opt      = 'EQ'.
      APPEND l_s_range TO e_t_range.
    ENDIF.
4. Execute the report.
I hope you can handle you issue now.
Assign points if it is helpful.
Regards,
S P.

Similar Messages

  • How to get current month and last month dynamically??

    how to get current month and last month dynamically
    like
    month = getCurrentMonth();
    lastmonth = getcurrentMonth() -1;
    please help
    thanks

    hi :-)
    /* depracated but can be still useful */
    java.util.Date dtCurrent = new java.util.Date();
    int month = dtCurrent.getMonth();
    int lastmonth = dtCurrent.getMonth() - 1;
    System.out.println("* " + month);
    System.out.println("* " + lastmonth);
    /* better to use this one */
    Calendar cal = new GregorianCalendar();     
    int imonth = cal.get(Calendar.MONTH);
    int ilastmonth = cal.get(Calendar.MONTH) - 1;
    System.out.println("*** " + imonth);
    System.out.println("*** " + ilastmonth);
    regards,

  • How to get current time and date??

    How to get current time and date from my PC time and date to the java application??
    i use java.util.* package but got error, that is:
    - java.util.* and java.sql.* class are match
    - abstract class cannot be instantiated
    so what can i do, pls guide...thanks...

    There is a method in the System class that will return the current system time. You could also instantiate a Date, Time, Timestamp, or Calendar object, all of which get created with the system time by default.
    Don't import *. Import the specific classes you need.
    Next time, post the actual text of the exceptions/compile errors. If you make people guess, most just won't bother.

  • How could i get the kernel and user cpu usage for each process

    Hi all,
    In order to monitor the system CPU usage, I would like write a script to gather the kernel and user CPU usage for each process, like the prstat or top does. As always missing the shortlived kernel usage, prstat or top cann't get the precise CPU usage. I checked with the dtrace syscall, proc and fbt provider, but don't get which one is useful.
    Please provide your comments and suggestion.
    Thanks in adv

    mail2sleepy wrote:
    As I've studied the "dtrace" for a while, and seems Sun gives a pretty high score on this new feature.....I do want to know whether there's some probe can work for it, like writing a "dtrace" version prstat.You can write a prstat without dtrace. Because that's just polling at specific intervals and reading some process structures from /proc. You could have dtrace fire a probe every 5 seconds and read the same thing, but it wouldn't really be using any features of dtrace. Trhying to write it "in dtrace" doesn't make much sense.
    What you could do that would be harder via other methods is to fire a probe at process exit that displayed the process information including total CPU time. They could print exactly when processes exited. Doing that without dtrace would be very difficult.
    Darren

  • How to get current time and set to yyyy/mm/dd hh:ss

    Dear friend:
    how can i get computer current date and time and set to yyyy/mm/dd hh:ss
    like this "2011/03/02 16:40:23" ? i want to pass this date to my sql server for quering.
    thank for helping

    see this:
    http://livedocs.adobe.com/flex/3_cn/langref/mx/formatters/DateFormatter.html

  • How to get current week data only

    Dear All,
    I'm running a report from January 2014 till date.
    I want a variable that helps me to show only the current week data.
    Please help ASAP if anyone available now.
    Thanks In Advance

    Hi
    You should create a dynamic prompt @ universe level or @ Business layes with @Prompt.
    create a filter in universe with below code
    DATE BETWEEN
    case
    when @Prompt('Week Start Date:','A','<LOV>',,'Week Start Date')='Week Start Date' then getdate()-7
    else @Prompt('Week Start Date:','A','<LOV>',,) end
    AND
    case
    when @Prompt('Enter Date:','A','<LOV>',,'Current Date')='Current Date' then getdate()
    else @Prompt('Enter Date:','A','<LOV>',,) end
    PS: syntax will work for SQL server. Change syntax for other databases
    Now use the filter in the report and you will get the current date data
    Regards
    Anil

  • How to get Current day and month value in Stk applets

    Friends please provide me the hint to get the Current Value of month and date from the Mobile equipment(ME).
    please send feedback to [email protected]

    Use "PROVIDE LOCAL INFORMATION" command as per GSM 11.14. This however queries the handset date and time, and hence depends on the handset clock (which may not always be reliable).

  • How to get current application and page references

    Hi,
    I have buttons (to print and download in PDF, CSV, XLS) on several pages... at the moment I am using following code to get them working...
    http://apex.oracle.com/pls/apex/f?p=31815:3:&SESSION.:PDF
    which means that on every page I need to put the reference in hard coding... is there a way to replace page number and application ID with a reference (similar to what I've done above to the session ID)... something like this
    http://apex.oracle.com/pls/apex/f?p=REF_APP_ID:REF_PAGE_ID:&SESSION.:PDF
    Thanks

    Hi,
    Use substitution strings. And you do not need write whole URL
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/concept.htm#sthref156
    f?p=&APP_ID.:&APP_PAGE_ID.:&SESSION.:PDFRegards,
    Jari

  • How to get current directory and enviroment variables

    Hello, 
       1.- Is there a global variable to get the actual (project, where is DSB and DSQ files) directory? 
       2.- Is there a way to get User directory like reading enviroment variables from Operative System? 
    Thanks in advance.
    PD: I'm using Dasylab12
    Solved!
    Go to Solution.

    Yes, use System Strings
    For example, ${DATA_FOLDER}.
    The easiest way to get the list is to right click and select Global Strings. The bottom half of the dialog box lists system strings, including date, time, the name of the worksheet, with or without path, the DEFAULT folders for worksheet, data, other, black box, etc. 
    - cj
    Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.

  • How to derive  Current week and Number of Weeks for present quarter.

    Hi,
    Currently we are developing a report on Actuals and Planned sales. We have two different data targets to hold these information.
    CRM team will provide targets for BP monthly in CRM table, from where we are extracting the data into BW and report exection frequency is Daily.
    Report Output format:-
    1)  Target1St Month in the quarter,   Target2nd Month in the quarter, Target3rd Month in the quarter, Target Quarter,  Month To date (Taget for Current month - Sales till today),
    Let us assume we are Q1 and user executing this report on end of March Target1 = Jan, Target2 = Feb, Target 3 = March and Quarter target = Target1 + Target2 + Target 3.
    We can achieve this by offset variables.
    But if users are exectuing this report Apr (Q2) then Target1 = Apr target , target2 and target3 =0
    Becoz we are in Q2 and first month of the quarter. If users are executing this report in May target1 should be Apr target and Target 2 = May target and Target3rd month should be Zero.
    2) We have one keyfigure called as Quarter Phased Target = (Quarter target/ No of weeks in current quarter)* current week; For this we have to get No of weeks in every quarter and Curren week (when the reports get executed).
    Let us assume we are executing this report on 25th jan and target for that month = 122units then Quarter phased target =  [(122 + 0 (For Feb)+ 0 (For Mar) )/ 13] X4
    4 is becoz we are in 4th in that quarter,
    13 is becoz no of weeks in that quarter.
    0 (For Feb) - Becoz we are in Jan only..
    Hence please let me know how to get No of weeks in Current quarter and Current week for every quarter..
    All the helpful answers will be awarded with full points.
    Regards,
    suresh

    hi,
    For the first querry.
    the problem is because u are using calmonth.
    Instead of using cal month use fiscal period.
    When u use fiscal period the data will be shown automatically for the Previous months using offsets.
    u have to take taht in ur transformation and should map it to constant value depending on the fiscal periods of ur compnay?
    march- apr,jan-dec etc.
    for teh second querry there would be some charecteristic which might give data in weeks as well just check that and if availabe u can use it.
    am not too sure abt it.

  • Calendar getting current week

    Hi,
    Is there a way to get the current week for a ceratin date.
    (e.g id i input today 17/06/2008, i must receive 15/06/2007 - 21/06/2007)
    if sunday is my first week day or 16/06/2007 - 22/06/2007 if monday is my first day of week.
    kindly advice how can this be done.
    Thank you in advance

    Thank you for your reply.
    But if i do not use the af:choosedate or af:selectinputdate.
    can this be done programatically, il will have on input to write the date and then i will display 2 output for the date of the first day of the week in question and the other for the last.
    Please advice

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • How to display Current Year and Month in Drop Down list

    Hi Dear friends,
    I am devloping a report. It has got 2 pages--input and output(Report) page.
    IN input page, user will select Month and Year from drop down list as one of the input parameters. (seperate drop down list 4 month and year)
    Now, my problem is:
    HOw to display current month and year by default in the dropdown list...........
    I hope my question is clear.
    Please help.
    Regards,
    ASh

    NO da,
    it is not working.
    First i tired with for-loop. I initialized variable "i" to -2 (i=-2) I would get the year drop down list from 2003 but, by default 2003 would come.
    So, i posted the question.
    I tried your code. It is giving following error.
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occured between lines: 122 and 127 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:182: Invalid type expression.
    first.set(Calendar.YEAR, 2003)
    ^
    An error occured between lines: 127 and 131 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:186: Invalid declaration.
    out.write("\r\n \r\nYear : \r\n \r\n"); ^ An error occured between lines: 198 and 203 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:282: Invalid type expression. first1.set(Calendar.YEAR, 2003) ^ An error occured between lines: 203 and 207 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:286: Invalid declaration. out.write("\r\n \r\nYear :\r\n \r\n");
    ^
    4 errors
    Pls. Help.
    Regards,
    Ashu

  • How to get current version of safari. without having safari browser?

    how to get current version of safari. without having safari browser?

    I don't understand the question. Safari is a browser.
    Can you elaborate on what your are trying to do that initiated the question? People may be able to come up with some other option that gets you working the away you want.
    When you respond, please post the version of the Mac OS and the version of Safari you currently have. Otherwise, people are guessing and the quailty of help you get plummets.

  • Get  current date and time

    hello.
    How can I get current date and time in JAVA?
    Thanks.

    Sorry, I mean:
    how can I get the value of DATE, MONTH, and YEAR of the
    current date?
         Date date = new Date();
         System.out.println(date);

Maybe you are looking for

  • SAP PI  Soap Send adapter  is not available.

    Hi  Experts: i encounter a issue when use Soap sender adapter.  i configured  soap sender adapter senario and generate  wsdl  in the id  . and then  import wsdl document to the  soapui to test the webservice.  but throw some exception blow: <!see the

  • Mac OS X Server Forward Proxy(Web Caching)...setup a website for the proxy???

    My office is a Mac environment with a couple of windows pcs. To save on bandwidth i would like to setup a Mac OS X Snow leopard server with a web caching proxy, forward proxy. I read this link from apple Server Admin 10.6 Help: Configuring Web Servic

  • Markers not showing up from emailed project file.

    I couldn't find an asswer to this but for some reason the clip markers that someone painstakingly put in a Premiere project are now not showing up on my end so i can continue working on the project. The project file was uploaded to Creative Cloud and

  • My phone is saying iOS 6.1.4 is up to date, but it's 3:30 pm

    My phone is saying its up to date, what's up?

  • Object locked.  Urgent !!

    If one user is trying to create an InfoArea, and another also tries to create an infoarea with a different name, will creating the info area get locked? I'm facing that problem right now. even though i think i shouldnt, because we are using different