Get the current week and subtract 12 weeks

Hi Experts,
Am getting the system current date and getting the current week using the FM->GET_WEEK_INFO_BASED_ON_DATE. Again I want to subtract 12 weeks including the current week. But still confused with the logic.
Also I came to know that I can use FM->DATE_GET_WEEK and can subtract 12 weeks from it.
So please advice how can I proceed further and how can I get the weeks that should be lesser than the 12weeks from the current week.
Waiting for your valuable ideas.:)
Thanks and Regards,
Ramakrishnan M

Try this one:
DATA: week      TYPE numc1,
         days      TYPE t5a4a-dlydy,
         date      TYPE p0001-begda,
         months    TYPE t5a4a-dlymo,
         years     TYPE t5a4a-dlyyr.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
     EXPORTING
       date      = s_ord_dt-low
       days      = days
       months    = months
       signum    = '+'
       years     = years
     IMPORTING
       calc_date = date.

Similar Messages

  • Get the Current Quarter  and Current Week from date

    Hi,
    I want to get the Current quarter and Current week from a given date, which function modules should i use?
    I tried using function module - 'HR_99S_GET_QUARTER' for getting the quarter but it is throwing an error while loading data. Moreover it doesnt exist in BI7.
    Similarly for current week.
    Please help. Sample code snippets would be appreciated.
    Thanks
    Jaya

    You can use FORM time_conversion wich is the one used by standard in Update Rules:
    You can select whether convert 0CALDAY to 0CALWEEK or whatever infobject formats you prefer...
      perform time_conversion
                using  '0CALDAY'
                       '0CALMONTH'
                        p_input_date
                        l_fscvtval
                changing RESULT
                         c_t_idocstate
                         c_subrc
                         c_abort.
      if c_subrc <> 0 or c_abort <> 0.
        exit.
      endif.
    form time_conversion
                   using i_timnm_from type rsiobjnm
                         i_timnm_to   type rsiobjnm
                         i_timvl
                         i_fiscvarnt  type t009b-periv
                   changing e_timvl
                            c_t_idocstate  type rsarr_t_idocstate
                            c_subrc   like sy-subrc
                            c_abort   like sy-subrc. "#EC *
    data: l_timvl  type rsd_chavl,
          l_result type rsd_chavl.
      IF i_timvl CO ' 0'.
        CLEAR e_timvl.
        EXIT.
      ENDIF.
      l_timvl = i_timvl.
      CALL FUNCTION 'RST_TOBJ_TO_DERIVED_TOBJ'
        EXPORTING
          i_timnm_from             = i_timnm_from
          i_timnm_to               = i_timnm_to
          i_timvl                  = l_timvl
          I_FISCVARNT              = i_fiscvarnt
          I_BUFFER                 = rs_c_true
        IMPORTING
          E_TIMVL                  = l_result
        EXCEPTIONS
          INCOMPATIBLE_TOBJS       = 1
          NO_INPUT_VALUE           = 2
          FISCVARNT_MISSING        = 3
          INPUT_NOT_NUMERIC        = 4
          WRONG_DATE               = 5
          WRONG_FISCPER            = 6
          X_MESSAGE                = 7
          OTHERS                   = 8
      e_timvl = l_result.
    ENDFORM.                  "TIME_CONVERSION

  • 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

  • When I try to animate Nexrad radar on weatherunderground ..I get yesterdays radar and no animation. On Internet Explorer I get the current radar and animation.

    When I try to animate Nexrad radar on weatherunderground ..I get yesterdays radar and no animation. On Internet Explorer I get the current radar and animation.
    == URL of affected sites ==
    http://www.wunderground.com/radar/mixedcomposite.asp?region=b3&size=2x&type=loop

    You can try Firefox Safe Mode to see if one or more of your add-ons might be causing the problem. Also clearing the cookies for the site might help. The site loaded with current date and animation on my system.
    <u>'''Cookies'''</u>
    See:
    http://support.mozilla.com/en-US/kb/Deleting+cookies#Delete_cookies_for_a_single_site
    http://support.mozilla.com/en-US/kb/Cookies
    <u>'''Safe Mode'''</u>
    You may need to use '''[[Safe Mode]]''' (click on "Safe Mode" and read) to localize the problem. Firefox Safe Mode is a diagnostic mode that disables Extensions and some other features of Firefox. If you are using a theme, switch to the DEFAULT theme: Tools > Add-ons > Themes <u>'''before'''</u> starting Safe Mode. When entering Safe Mode, do not check any items on the entry window, just click "Continue in Safe Mode". Test to see if the problem you are experiencing is corrected.
    See:
    '''[[Troubleshooting extensions and themes]]'''
    '''[[Troubleshooting plugins]]'''
    '''[[Basic Troubleshooting]]'''
    If the problem does not occur in Safe-mode then disable all of your Extensions and Plug-ins and then try to find which is causing it by enabling <u>'''one at a time'''</u> until the problem reappears. <u>'''You MUST close and restart Firefox after EACH change'''</u> via File > Restart Firefox (on Mac: Firefox > Quit). You can use "Disable all add-ons" on the Safe mode start window.

  • Get the Current Date and Time of a Location

    I have created a windowsPhoneApplication in silverLight 8.1.In my application,I have to upload videos on some server.The Uploading get failed If the Date and Time settings of my device is not the current Date and Time.So How can I get the current date
    and time even if the device settings is wrong?

    Hi shifana,
    Do you know server's time zone? If yes, you can manually translate to the correct time zone.
    Otherwise try some online time acquire API.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get the current data and time of SCOM server via SCOM SDK (API) calls?

    Hi,
    I need to read the current date and time of SCOM server via SOM SDK.
    Is there a class in SDK that provides this info ?
    Thanks,
    satheesh

    To get time and date of Alerts of SCOM, You can use following command let "get-scomalert"
    Also, You can refer below links
    http://blog.tyang.org/2013/02/21/using-scom-2012-sdk-to-retrieve-resource-pools-information/
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical

  • How to get the current date and compare dates

    hi
    does anyone know how you would get the current date?
    furthermore, how to compare the current date with a past date to see how many days or months have past since then?
    thanks

    have a look at the Date class. new Date() creates an object containing the exact date and time at creation time. (Date).getTime() might be useful for comparing two dates. GregorianCalendar might be useful, too.

  • How can I get the current user and the current page?

    Hi everyone
    Question..
    It is possible to get the current user (from the user's database on apex) and the current page? (I mean, if I'm in page 4 be able to query a variable / function or something which could give me the current displayed page)
    Thank you very much... I'd been researching without success :-S so I'll appreciate your help
    Regards,
    Fury

    Fury,
    If the user has authenticated, :APP_USER is the name that was used. The current page id is in :APP_PAGE_ID.
    Although I showed bind variable notation for those, & substitution format and v() notation are also available for referencing developer-defined items or built-in names. See the User's Guide for more details.
    Scott

  • Getting the current time and comparing it to a time in the future

    Hello,
    I am seeing in my research some debate on the best way to get the time. I am reading that just using the Date class and calling getTime() is not the most reliable way to do things. Overall, I am trying to get the current time down to the millisecond. I then want to add 5 seconds to that time and then store that value. FInally, when the current time is greater or equal to this stored value, I want to continue on in my program. Can anyone point me in the right direction on how to calculate the time variable? Any help would be much appreciated. I am new to the JAVA world.
    Thanks,
    Tim

    To store the current time, simply use new java.util.Date(). Yes, there might be slight inconsistencies and it might not be the most accurate time possible, but without significant additional effort (perhaps a native O/S call or the use of another time library), you will not do much better. Calendar won't help in this instance either. The easiest way to get five seconds in the future is to do the following:
    Date now = new Date();
    Date future = new Date(now.getTime() + 5000);To store and retrieve the value, it depends on what you are doing. You can place it in the database via JDBC (BTW, if you trust the database timestamp more than Java's you can use something like Oracle's SYSDATE instead of Java's date in your SQL query). You can place it in the filesystem. You can store it in the user's session.
    - Saish

  • Get the current version and level of sp.listitem

    I'm using a client script to get sp.listitem from a context.
    Everything works and load my item
    myCtxtWeb.Load(item);
    myCtxtWeb.ExecuteQuery();item.Versions;//doesn't existitem.Level;//doesn't exist
    Now i need to know the current version and the previous to compare the modified date between them.
    Unfortunately the property doesn't exist and same with property level for having the info if it's approved
    Are there a way to have them?

    For information, i found the solution
    SP.File newsItemFile = targetItem.File;
    SP.FileVersionCollection fileVersions = newsItemFile.Versions;
    myCtxtWeb.Load(fileVersions);
    myCtxtWeb.ExecuteQuery();
    if (fileVersions.Count > 0)
    SP.FileVersion currentVer = fileVersions[fileVersions.Count - 1];//get current version
    if (currentVer.VersionLabel == "1.0")
    return "add";
    Hope it helps some people

  • How to get the current filename and & or path

    How can I get the current path or filename?
    I didn't really find any answers in the net. this.path or app.path were suggested but I couldn't get it to work.
    Thanks in advance for your answer!
    Livecycle Designer ES 8.2.1.3144.1.471865

    Hi,
    event.target.path.toString();  will give the full path including the filename.
    event.target.documentFileName.toString();  will give the filename only.
    Good luck,
    Niall

  • How to get the current cellid and areaid///

    i am undertaking a project as a part of my BE final year and urgently need information that how do we retrive the Base station name (in GSM mobiles network). are there any API's available??? plz do urgetly get back to me...or mail at my email id
    [email protected]
    [email protected]
    i got a new forums for me so ne suggestions or ideas you can leave your reply at
    http://getpass.netfirms.com
    Message was edited by:
    Manani Mitesh

    Not possible with any standard api's. You can do it if your phone support the ATCommand api, but 99% of the phones don't.

  • How to get the current folio from inside a folio with the reading sdk

    Hi there,
    I'm currently trying to get the current folio and its filter value within the reading sdk (custom Navigation).
    In 2.31 there was a "ReadingService" with "currentfolio" (Adobe DPS - Reading SDK 2.31 : adobeDPS-ReadingService : JsDoc Reference).
    However, in 2.32 this Service is gone. "Folio" itself exists tough.
    My question is: How do I get the current folio and its filter?
    I tried with adobeDPS.Folio / adobeDPS.Folio().filter and so on but getting nowhere.
    Best regards,
    Andy

    Aah.. yes, you're right. And since I made a typo (writing adobdeDPS.Readingservice with an uppercase "r") I got an undefined and thought it was really gone
    So... can confirm that adobeDPS.readingService.currentFolio actually works.
    Thank you,
    Andy

  • How to get the current slide Index or Id?

    I can get the selected slide of presentation use blow method.
    Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange, function (asyncResult) {
    if (asyncResult.status == Office.AsyncResultStatus.Failed) {
    write('Action failed. Error: ' + asyncResult.error.message);
    else {
    write('Selected slides: ' + JSON.stringify(asyncResult.value.slides));
    But, How can I get the executor slide?

    ​Hi,
    >> How to get the current slide Index or Id?
    In my option, when you select a slide, it change to current slide. So, you could use the getSelectedDataAsync method to get the current slide, and then get the index or id by using the Slice object. You could refer the link below for Slice Object.
    # Slice.index property (JavaScript API for Office)https://msdn.microsoft.com/EN-US/library/office/jj715285.aspx?f=255&MSPPError=-2147217396
    Some key code as below:
    <script>
    function getText() {
    Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange,
    { valueFormat: "unformatted", filterType: "all" },
    function (asyncResult) {
    var error = asyncResult.error;
    if (asyncResult.status === Office.AsyncResultStatus.Failed) {
    write(error.name + ": " + error.message);
    else {
    // Get selected data.
    var dataValue = asyncResult.value;
    write('Selected data is ' + dataValue.slides[0].index);
    // Function that writes to a div with id='message' on the page.
    function write(message) {
    document.getElementById('message').innerText += message;
    </script>
    >> How can I get the executor slide?
    What do you mean by this? Is this a new issue which is different from the above issue? If so, I will recommend you post a new thread for this issue and share us more information about this.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I get the current user an  resource context  in a portal JSPDynPag

    How can I get the current user (com.sapportals.portal.security.usermanagement.IUser?)an the resource context  in a portal component (JSPDynPage)?
    Thanks.

    Hi Jon,
    Here is the code to get the current user and resource context in your JSPDynPage:
    IPortalComponentRequest  currentRequest  = (IPortalComponentRequest)pageContext.getAttribute(javax.servlet.jsp.PageContext.REQUEST);
    com.sapportals.portal.security.usermanagement.IUser contextUser = (com.sapportals.portal.security.usermanagement.IUser) currentRequest.getUser().getUser();
    ResourceContext resourceContext = new ResourceContext(contextUser);
    Greetings,
    Praveen Gudapati
    p.s. points are always welcome for helpful answers

Maybe you are looking for