Hwo to calculate first week for this year in variable

The logic is taking today's date and subtracting 7 days.  It uses that date to determine the week which when run today is week one of 2010.but if this is for this year then  jan8 if i deduct 7 wit will comes as jan1 which will be as 1 st week.
i have to change code such way when this happened it has to show as previous week not current week
can u guys help me out
ex: if i run this on jna 8th ..the i get results jan1st ..but the day falls in previous week but its gives me current week... hwo to fix this..? here is the old code
DATA PREV_WEEK_DT LIKE SY-DATUM.
  PREV_WEEK_DT = SY-DATUM - 7.
  CALL FUNCTION 'Z_DATE_GET_FISC_WEEK'
    EXPORTING
      DATE         = PREV_WEEK_DT
    IMPORTING
      WEEK         = YR_WEEK
    EXCEPTIONS
      DATE_INVALID = 1.
  IF SY-SUBRC <> 0.
    CLEAR YR_WEEK

wrote logic

Similar Messages

  • Want to create analysis for this year week vs last year week

    All,
    My requirement is to create an analysis for the passed week number of this year vs same last year week no.
    So basically user will pass the week no. and report should display the passed week no. this year sales number plus same week no. last year sales number.
    How can I achieve this?
    Thanks

    If you ask like this ..I would say like using presentation variable for week
    use measure with exp like
    CASE WHEN WEEK=@{WK} AND Time.year=VALUEOF("PREVIOUS_YEAR") THEN #sales END.
    In this case week is from your subject area and PREVIOUS_YEAR is rep variable you might have it.
    there are other options to get output, need details about your rpd and value of week.

  • Adobe Creative Cloud 2015: When Adobe Creative Cloud restart its trial for this year?

    When Adobe Creative Cloud restart its trial for this year?

    Does your Cloud subscription show on your account page?
    https://www.adobe.com/account.html for subscriptions on your Adobe page
    Some general information for a Cloud subscription
    Log out of your Cloud account... Restart your computer... Log in to your paid Cloud account
    -Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    or
    A chat session where an agent may remotely look inside your computer may help
    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • - How to Display Sales Qty & Value for This Year & Last Year in 2 Columns -

    Dear All,
    I'm having trouble in extracting the last year figures based date entered. I'm actually would like to create a query where I'm able to know the "TOP 10 item sold based item category". I've created a query, which show the top10 item sold (total quantity & value) for this year, but not able to display the last year figure (quantity). Please advise & thanks for your help and time.
    SET ROWCOUNT 10
    SELECT T1.ItemCode, T2.ItemName, T3.ItmsGrpNam, SUM(T1.Quantity) as "Total Qty Sold", SUM(T1.TotalSumSy) as "Total Amount"
    FROM ODLN T0  INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
    WHERE T0.DocDate >='[%0]' AND  T0.DocDate <='[%1]' AND  T3.ItmsGrpNam ='[%A]' 
    GROUP BY T1.ItemCode, T2.ItemName, T3.ItmsGrpNam
    ORDER by SUM(T1.Quantity) DESC
    I wish to have the output as follow
    Item   Qty (2008)  Qty (2007)    Value(2008)   Value(2007)
    A       300             150               1000                      500
    B       250             300                 800                      650
    C       100             250                 700                      550
    Currently, My results display:
    Item   Qty (2008)  Value(2008) 
    A       300             1000                     
    B       250               800                     
    C       100               700                     
    Cheers,
    Serene

    Hi,
    if you want more flexible, you could try this modified Istvan's query:
    SELECT top 10 T1.ItemCode, T2.ItemName, T3.ItmsGrpNam,   SUM(T1.Quantity) as "Total Qty Sold",
      SUM(T1.TotalSumSy) as "Total Amount" ,
      (select sum (r.Quantity) from ODLN h
         inner join DLN1 r on h.DocEntry=r.DocEntry  
         where h.DocDate>='[%4]' and h.DocDate<='[%5]'
             and r.ItemCode=T1.ItemCode) '2007 Sold',
      (select sum (r.TotalSumSy) from ODLN h
         inner join DLN1 r on h.DocEntry=r.DocEntry  
         where h.DocDate>='[%6]' and h.DocDate<='[%7]'
             and r.ItemCode=T1.ItemCode) '2007 Amount'
    FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON T2.ItmsGrpCod = T3.ItmsGrpCod
    WHERE T0.DocDate >='[%0]' AND T0.DocDate <='[%1]' AND T3.ItmsGrpNam between '[%2]'  and '[%3]'
    GROUP BY T1.ItemCode, T2.ItemName, T3.ItmsGrpNam
    ORDER by SUM(T1.Quantity) DESC
    Rgds,

  • Will we have an iPhone 6 for this year?

    Does anyone know if Apple is going to design and sell an iPhone 6 for this year (2013)?

    As soon as Apple is ready to announce it and no sooner.
    Allan

  • Can standard program RMCBIN00  calculate cycle count for 2 years?

    Hi Experts,
       Can any one clarify my doubt.
               The calculation of cycle counting period to be two (2) years rather than the one (1) year that standard SAP uses. The cycle count indicators that determine the frequency of the counts for each material need to be used in conjunction with the 2 year cycle. Is  standard RMCBIN00 calculate for Two year cycle count??
    Moderator message: not directly related to ABAP development, please have a look in the respective functional forum.
    Edited by: Thomas Zloch on Apr 5, 2011 4:14 PM

    Hello,
    You can do cycle counting with Rf transaction LM59 for the serialised material.
    1.My experience says when you have HUM activated then to track material HU & serialisation profile works together.
    2.You can do cycle counting of serailised & non serialsed material through Rf gun but clearance of this material will be issue. You may have to create one more transaction to clear the difference of  serialised materials like LI20
    Hope this input helps.
    Regards,
    Prashant

  • Formula to always calculate first week of next month

    Can you please give me pointers regarding the following problem:
    A System generated report that I want to be able to e-mail (no manual parameter selection involved!) . 
    New Customers that have a start date the first week of the following month.
    Using today as an example Monday, JUly 25: create a formula that counts new starts 8/1/2011 - 8/7/2011 and then when it generates again on Monday, August 1: the result should be a count of new starts Sept 1 - sept 7, 2011.... and so forth.

    Hi
    I think you don't have to count True or False by using a formula.  You can very well create record selection formula (filter condition) using the below :
    {ServiceInfo.StartDate} >= DateAdd ("m",1 ,CurrentDate) - DatePart ("d",CurrentDate )+1
    and
    {ServiceInfo.StartDate} <= DateAdd ("m",1 ,CurrentDate) - DatePart ("d",CurrentDate )+7
    This will filter data and can be inserted count without any issues.
    Thanks,
    Sastry

  • My mac book air no longer supports the audio speakers on my panasonic tv when playing movies? what has changed in the last week for this not to work any more?

    I used to be able to plug my mac book air to my tv via mini dvi to hdmi cable to tv and watch movies.
    The audio no longer projects through the tv? in system preferences, sound, driver for sound output is not supported for my panasonic tv.
    Just a couple weeks ago this was not a problem.  I just plugged in my computer to the tv and it worked.  what has changed?

    Have you tried a PRAM reset?
    http://support.apple.com/kb/HT1379
    Ciao.

  • TS1702 I have followed all instructions through iTunes to cancel Jillian Michaels Slimdown app on iPhone4 and impossible.  Do I need to cancel my credit card or change number on credit card to avoid being charged weekly for this app?

    I have followed all instructions in iTunes to cancel Jillian Michaels Slimdown app on iPhone 4.  I downloaded the app via my iPhone 4.  Will I have to call and cancel credit card or change the number on my credit card to avoid being charged for this app weekly?  Can I just delete app and my credit card will not be charged?  Please help!

    I have followed all instructions in iTunes to cancel Jillian Michaels Slimdown app on iPhone 4.  I downloaded the app via my iPhone 4.  Will I have to call and cancel credit card or change the number on my credit card to avoid being charged for this app weekly?  Can I just delete app and my credit card will not be charged?  Please help!

  • Sir i was get only one mail at my permanent email id at rediffmail and i m not get other mail where the apple server to i login and finish the process whats going on there i suffering from last one week for this one id is it apple or what ?

    sir
    i was not get any mail at my permanent mail addres [email protected] and this mail id also same at apple so where the apple server for login and finish the process tell me is this way to apple to customer support and this is last mail for this  other wise i will go through the public protest comision and i will make
    statement for this type of fake process
    reply soon

    You are not addressing Apple here.
    This is a user to user forum, this is spelled out in the terms of service you agreed to when you joined.
    There is no Apple server for your email.
    servers are set up, used and maintained by whatever email service you use-such as rediffmail.
    Go threaten them.

  • Is there any fix or work around for this year old dictation bug that messes up Photoshop??

    Other than disabling it?
    Details here https://forums.adobe.com/message/5835501
    Encounted a very major bug today that I need to figure out how to get around asap as it's completely preventing me from doing any work.
    Whenever I edit any text - be it editing an existing text layer, or with a new one, whatever text is there just randomly and without warning disappears.  Doesn't matter wether I'm changing the color, font, font size or any other type settings.  Sometimes I just move the mouse while in editing mode and the text just vanishes.
    Made a video of the bug in action.  Virtual keyboard on screen so you can see that I'm not hitting any keys to make the text disappears.  Today is the first day I noticed this issue and I have absolutely no idea what is causing it but it happens 99.9% of the time that I try editing any text.  Latest version of Photoshop, CC, OS X etc.
    http://f.cl.ly/items/2s3y0d2d1R1c2Y173Q38/photoshop-bug.mov
    Please advise, I really need to get it figured out as soon as I can - as you can imagine impossible to do any sort of work without being able to type a single character.
    Adobe claims it's an Apple problem:
    Chris Cox   (Staff)
    The bug is in the dictation code in MacOS.  We are not ignoring the problem - but we cannot fix bugs in Apple's OS code.
    So far they say all you can do is just disable diction: http://feedback.photoshop.com/photoshop_family/topics/cs5_text_deleted_upon_sele cting_after_updated_to_os_10_9

    If it was a bug in Apple's dictation code, every other program with text entry would be affected.

  • Idea that get apple store more profit for this year.

    hello..
    my name is suliman and i am from kuwait but am living in dubai
    i have a good idea to let the people to use the itunes card and get apps from apple store without going to other programs and download for free
    this idea can get more profit for apple company and i will be glad if you give me a chance to expalne my idea
    if you can share me a mail so i can send my idea as a presntaion or you can let me contact from apple in dubai and explane them the idea that may incres the company profit.
    hope i have a chance to explane my idea
    thank you very much.

    You are not addressing Apple here in the user to user technical forum.
    Furthermore, I think Apple have the right people and ideas for their store.
    If you still want to suggest, use the feedback link:
    http://www.apple.com/feedback/iphone.html

  • How to calculate first date and end date of this year in Query

    Hi Expert
    I want to calculate following dates with inputted date in query.
    I have no knowledge on ABAP and I just can create a query with simple logic.
    Could you teach me how to calculate following date?
    (If inputted date is April 12 2009)
    - First date of this year (Ex January 1 2009)
    - End date  of this year (Ex December 31 2009)
    - First date of last year (Ex January 1 2008)
    - End date of last year  (Ex December 31 2008)
    - First date of this month (Ex April 1 2009)
    Thank you!
    Take

    HR_JP_MONTH_BEGIN_END_DATE   use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
    04/01/2009 as begin date
    04/30/2009 as end date
    pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
    Abh

  • I cancelled my creative cloud membership on the 29th of janurary but I've just been sent an invoice for the bill of this years payment. Luckily there isn't enough money in my bank account for it to go through. But why am I still being billed?

    I don't know why Im being billed for it when i spoke to the online service team he told me that i wouldn't be billed for this year and now they are trying to charge me for it. I'm a student and I don't have that kind of money to pay for it so I'm not keeping anything in my card account to make sure that it can't be taken out. How do I tell them again that I'm not paying for it anymore
    Seriously annoyed

    This is an open forum, not Adobe support... You need Adobe support to cancel a subscription
    -start here https://forums.adobe.com/thread/1703848
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html
    --and two links which may provide more details, if the above links don't help you
    -http://helpx.adobe.com/x-productkb/policy-pricing/return-cancel-or-change-order.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html

  • Query for getting data for every quarter for financial year

    Hi,
    My problem is I need to get the data for every quarter for financial year and also I need data for every week for financial year.
    For example for financial year 2012-13, Apr2012 to Jun2012 would be Q1, Jul2012 to Sep2012 would be Q2 and so on. Total 8quarters should come upto Apr2013.
    In the same way  1st apr 2012 to 7th apr 2012 would be week1, 8th apr to 15th apr would be week2 and son on. How to write a query for this scenario in oracle. Can anybody help me on this. very urgent..
    Thanks in advance.

    lakmesri wrote:
    Hi,
    My problem is I need to get the data for every quarter for financial year and also I need data for every week for financial year.
    For example for financial year 2012-13, Apr2012 to Jun2012 would be Q1, Jul2012 to Sep2012 would be Q2 and so on. Total 8quarters should come upto Apr2013.
    In the same way  1st apr 2012 to 7th apr 2012 would be week1, 8th apr to 15th apr would be week2 and son on. How to write a query for this scenario in oracle. Can anybody help me on this. very urgent..
    Thanks in advance.
    How can you get 8 quarters within a year ? I'b be concerned here.
    lakmesri wrote:
    Hi,
    In the same way  1st apr 2012 to 7th apr 2012 would be week1, 8th apr to 15th apr would be week2 and son on. How to write a query for this scenario in oracle. Can anybody help me on this. very urgent..
    Thanks in advance.
    First, that question is really not clearly asked. Second how could it be urgent ? You even did not tell us your Oracle version, did not show any tables descr, output sample nor any effort on your side to work on.
    Nicolas.

Maybe you are looking for