Identify the current week using macro

Hi all,
I have to write a macro to do some calculation if we are in current week and for future weeks some different calculation.
My question is how to determine the current week.
Please help me on this.
Prabhat

Dear Prabhat,
As Edgar has suggested, you can use date functions as follows:
Please let me know if it meets your requirement.
Regards,
JB

Similar Messages

  • 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.

  • Using PHP to identify the current page - by David Powers

    Hi There,
    I'm trying to write a script so I can identify the sub-pages under "Gallery" in my website
    Under Gallery I have more than hundred pages describing the photos but I want to identify them as the "Gallery" page.
    How do I achieve that?
    It would be tedious to write the "PHP if" statement for each photo link.
    I trust there is a simpler solution.
    In PHP solutions by David Powers, Ch.4 "Using PHP to identify the current page"
    The script is:
    <?php $currentPage = basename($_SERVER['SCRIPT_NAME']); ?>
    <ul id="nav">
      <li><a href="index.php" <?php if ($currentPage == 'index02.php') {echo 'id="here"';} ?>>Home</a></li>
      <li><a href="journal.php" <?php if ($currentPage == 'journal.php') {echo 'id="here"';} ?>>Journal</a></li>
      <li><a href="gallery.php" <?php if ($currentPage == 'gallery.php') {echo 'id="here"';} ?>>Gallery</a></li>
      <li><a href="contact.php" <?php if ($currentPage == 'contact.php') {echo 'id="here"';} ?>>Contact</a></li>
    </ul>
    Let's say that the gallery pages contains hundreds of links gallery like gallery/photos1.php, gallery/photos2.php, gallery/photos3.php, gallery/photos4.php, gallery/photos5.php, gallery/photos6.php, gallery/photos7.php etc...
    How would I identify the sub-pages so when we are there Gallery is highlighted?
    Thank you!
    Best,

    Hello Siddhardha,
    To get the details of a process you need to use Locator class from BPEL api. You can locate your process by listInstances method which accepts WhereCondition parameter used to build a query on process instances. Once you've found the process you were looking for you can use getAuditTrail method to retrieve audit trail of a given instance. You can also use setStatus() method from a BPELX java exec tag within your process and later retrieve it from instance handle by getStatus method.
    A sample snippet to retrieve instance handles to all child processes of a given process:
    StringBuffer sb = new StringBuffer();
    Locator locator = new Locator(domain,domainpassword);
    WhereCondition wc = new WhereCondition();
    String query = sb.append(SQLDefs.AL_ci_root_id).append(" = ? ").toString();
    wc.append(query);
    wc.setLong(1,parentInstance);
    IInstanceHandle[] ih = locator.listInstances(wc);
    You can read more about querying processes on http://blogs.oracle.com/matt/2006/06/27?print-friendly=true
    Radoslaw

  • 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.

  • Filter the current week in Outlook Calendar with SQL DASL

    Hello!
    I'm trying to make a new view in Outlook Calendar that displays meetings with a specific subject. The problem is that I can't find anywhere how to show the meetings for the current week only.
    My SQL DASL syntax is so far:
    "http://schemas.microsoft.com/mapi/proptag/0x0037001f" LIKE '%21%'
    And the result is:
    I have tried to use the %thisweek% parameter without result as I don't know how this should be used (look here to see what I mean
    http://blogs.msdn.com/b/andrewdelin/archive/2005/05/11/416312.aspx?Redirected=true).
    Thanks in advance!

    Hi,
    I think it should be an Outlook related question. Please post a new one on Outlook forum via:
    http://social.technet.microsoft.com/Forums/office/en-US/home?forum=outlook
    Thanks,
    Simon Wu
    TechNet Community Support

  • 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

  • Can I recover the database to the current time using a backup control file?

    Can I recover the database to the current time using a backup control file? How far can I recover this database?
    I have an Oracle 10g(10.2.3) database on RHEL4.3 system.
    I have lost all the current control files and all the online redo logs, archived redo logs and all other files are OK.
    Now I have to recovery this database using a backup control file.
    Can I recover the database without any data lost?

    If
    a) it was a Shutdown Abort or an Instance Crash (i.e. backgrounds died on detecting loss of redo logs),
    b) redo logs are lost
    c) data files are intact
    You'd have to
    a) Restore datafiles
    b) Do an Incomplete Recovery to the last available ArchiveLog
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • 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

  • Detect the current transaction used in MIRO :EXIT_SAPLMR1M_001

    hi ,
    my requirment is to find  a way to detect the current transaction used within the MIRO transaction ,which can be one among
    invoice/ credit memo/ subsequent debit/subsequent credit .if the user  is using the credit memo ,  then prevent him from posting based on the authority /role given to him. Im making use of the Exit:EXIT_SAPLMR1M_001 for this.
    Please let me know which field of the exit parameters should be made use for detecting if the user is in credit memo transaction.
    Thanks in advance,
    Shyam.

    Hi
    Define a variable for VORGANG and set a value in the same way that from VORGANG SAP gives values for other fields in include LMR1MF5G (FORM vorgang)
      CASE rm08m-vorgang.
        WHEN '1'.                          " Rechnung
          rbkpv-xrech      = 'X'.          " - Rechnungs-Kennzeichen
          rbkpv-tbtkz      = space.        " - Nachbelastungs-Kennzeichen
          rbkpv-xrechl     = 'S'.
          rbkpv-xrechr     = 'H'.
        WHEN '2'.                          " Gutschrift
          rbkpv-xrech      = space.
          rbkpv-tbtkz      = space.
          rbkpv-xrechl     = 'H'.
          rbkpv-xrechr     = 'H'.
        WHEN '3'.                          " nachträgliche Belastung
          rbkpv-xrech      = 'X'.
          rbkpv-tbtkz      = 'X'.
          rbkpv-xrechl     = 'S'.
          rbkpv-xrechr     = 'H'.
        WHEN '4'.                          " nachträgliche Entlastung
          rbkpv-xrech      = space.
          rbkpv-tbtkz      = 'X'.
          rbkpv-xrechl     = 'H'.
          rbkpv-xrechr     = 'S'.
    So, do the algorithm in the reverse for fields XRECH, TBTKZ, XRECHL and XRECHR in MRM_RBKPV.
    I hope this helps you
    Regards
    Eduardo

  • Refining a query to only show entries for the current week

    Hello.
    Does anyone know how to modify a query to only show records that have dates in the current week? Records have a start date and a finish date so the query should recognise that an entry may be valid for more than one week?
    Kind Regards,
    swelch

    Assuming week ends on a saturday and dates aren't NULL - change as appropriate - this is one way
    All rows....
    SELECT TO_CHAR (begin_date, 'DD-Mon-YYYY HH24:MI:SS') AS begin_date
    , TO_CHAR (end_date, 'DD-Mon-YYYY HH24:MI:SS') AS end_date
    FROM mydates
    ORDER BY begin_date;
    BEGIN_DATE,END_DATE
    05-Jul-2011 06:49:25,15-Jul-2011 06:49:25
    05-Jun-2011 06:48:57,15-Jun-2011 06:48:57
    15-Jun-2011 06:48:29,25-Jun-2011 06:48:29
    25-Jun-2011 06:47:57,05-Jul-2011 06:47:57
    Current week rows....
    SELECT TO_CHAR (begin_date, 'DD-Mon-YYYY HH24:MI:SS') AS begin_date,
    TO_CHAR (end_date, 'DD-Mon-YYYY HH24:MI:SS') AS end_date
    FROM mydates
    WHERE TRUNC (begin_date) < NEXT_DAY (TRUNC (SYSDATE) - 1, 'Sat') + 1
    AND TRUNC (end_date) > NEXT_DAY (TRUNC (SYSDATE) - 1, 'Sat') - 7
    ORDER BY begin_date
    BEGIN_DATE,END_DATE
    15-Jun-2011 06:48:29,25-Jun-2011 06:48:29
    25-Jun-2011 06:47:57,05-Jul-2011 06:47:57
    Edited by: Robert Chalton on 25-Jun-2011 07:01

  • How do we identify the standard texts used in a sap script?

    Hi,
    Is there any way that i can identify the standard texts used in SAP scripts?
    Not manually going to each window in the script and checking.
    Will there be any table where I can look ?
    Thanks,
    krishna.

    Hi,
    GO to the forminfo of the sapscript in SE71..and then search for INCLUDE
    after displaying the form...utilities->form info..
    hope this works..
    Thanks
    Naren

  • PERSG previous bet different from the current PERSG using info-type pa0000

    Hi Friends,
    Please guid me how get the PERSG previous bet different from the current PERSG
    using info type pa0000.
    Regards,
    Durga

    Folks,
    even after having repaired the inbox folder under "properties" a few times, I still had some e-mails where the contents are different from the subject line.
    In other words in the inbox there are two e-mails: one with subject line "abc", and another one with subject line "def".
    When I display the e-mail with the subject line "abc", the contents are from the e-mail with the subject line "def" in the in-basket.
    What else can be done to correct this problem?
    Thanks and best regards.
    Fred Kunz-Shirzad
    Chemin Ronzeures 6A
    1297 Founex VD
    Switzerland
    [email protected]

  • Highlight the current word using the keyboard

    How do you highlight the current word using the keyboard
    eg lets say the cursor is after the letter d in AddComments would like to highlight the AddComments using the keyboard
                mediatorMap.mapView(AddComments, LoginFormMediator);

    Hi
    I dont think its possible. In Java you have something like Select Enclosing Element, which mimicks selecting a word (Alt-Shift-Up). However, FB does not have this feature, AFAIK.
    There is an Eclipse enhancement request for this behaviour, which should address this in some future release. Given the fact that its still not implemented in core Eclipse, and the lame speed at which FB develops, I wouldn't expect anything before 2012.
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=23080

  • How to identify the current lead selection is child or parent in rec node

    Hi
    I am using a recursive node to populate a table with TreeByNestingTableColumn as master column. Now my problem is how do I identify if the current selected row in the table is a child or parent? When I get the lead selection value, I find that its the same for the parent and the child. I am setting the isLeaf and hasChildren boolean properties appropriately as false and true for parent and true and false for child. But since the lead selection is returning the same the below rsTableElement always gives me the parent, I always get those parameter values as that of parent. I am writing this inside the onleadSelect event of the table.
    IRsTableElement rsTableElement = (IRsTableElement) wdContext.nodeRsTable().getElementAt(wdContext.nodeRsTable().getLeadSelection());
    In this scenario how do I know if the current selection is made on a child?
    Appreciate for all help and any code snippets.
    Thanks,
    KN.

    Hi KN,
    I guess you want to check if the node that you selected is parent or child.. This can be achieved by using getTreeSelection() method of IWDNode.
    If you write following code in your lead selection action, you can determine the if it is a parent or child node.
    wdComponentAPI.getMessageManager().reportSuccess(wdContext.nodeRsTable().getTreeSelection() +"");
    the output will be something like
    <ViewName>.RsTable.0.ChildRsTable.1.ChildRsTable.0.. depending upon which node you have selected.
    That way you can find out if it is a parent or child node.
    Abhinav

  • How do I create a new calendar for the current year, using last years calendar's birthday's/photos and comments from the lower pages?

    Each year for the past 5 years I make a family calendar and send copies to all he family members around the globe.  I hate that I have to recreate all the birthdays and special occasions from scratch, and re-drag all the photos onto these dates, in the lower half of the page of each month on the new calendar.  How can I create a new calendar for the current year and port all of these photos/comments into the new calendar from last years calendar, to save having to redo all this work!!  I am not talking about the upper half page of the photos only...I am referring to the calendar page of each month.
    Thanks in advance. 
    Colin

    Welcome to the Apple Discussions. Open iWeb so you see your original site in the left hand pane. Use the File->New Site menu option to create a new site. Give it the name you want.
    Now select a page in your original site and type Command+D. That will duplicate the page. Drag the duplicate page down to the new site and rename it as needed. Do that for the other pages you need in the original site.
    OT

Maybe you are looking for

  • Dom can't parse dtd reference in xml file

    Hi all, I am trying to parse a xml file (hibernate mapping file *.hbm.xml) using DOM. But itis getting timeout errorwhile parsing due to the external dtd reference in the xml file. <!DOCTYPE hibernate-mapping PUBLIC     "-//Hibernate/Hibernate Mappin

  • Business Transactions and Document Types

    Hi eXperts ! Can anyone please explain these business transactions like when they are created, what is the document type related to these. KOAE     Actual Settlement CO External RFBU     FI Postings COIN     CO Interface      RKU1     CO Act. Primary

  • Quicktime Plug In for Safari/Leopard (audio no video) HELP

    I'm having trouble viewing video from a website. What happens is the video begins but only get audio, no video at all. I'm not sure what is causing this issue. I can access the video on an old pc laptop on IE. Also I do have the latest version of Fli

  • Lost the isync folder....

    I'm having trouble syncing my calendar with my new 30GB ipod. It used to sync, but suddenly stopped. In my quest to fix things, I was exploring the ipod from 'My Computer' and looking at it's files as a hard drive. It contained four folders....calend

  • Dodgy sound on iBook

    Hi, I have an iBook, and I have just noticed that when I'm playing music and DVD's through headphones the sound is really bad...echoey, mettalic and sometimes vocal is almost inaudible over the background music (on a dvd). I have used several differe