How to get monday date if you enter any date for the current month.

Hi All,
I have requirement to create on char variable for 0calday and need to code in such a way that if you enter the date
For example today is 20th March, the following dates will be returned.
February 4th, 11th, 18th, 25th 
March 3rd, 10th, 17th, 24th 31st
i.e date of Monday of current month and previous month.
Thanks in Advance.
Kind Regards,
Raghu

Hi,
Have a look on this code.
data :  zdate like VTBBEWE-DVALUT.
data : day_val(1) type n.
      CALL FUNCTION 'DATE_COMPUTE_DAY'
      EXPORTING
        DATE         = your_date
      IMPORTING
        DAY = day_val.
if day_val = 1.
' Place ur code for monday because day_val = 1 then it is monday.
endif.
Vivek

Similar Messages

  • How to set the filter on a report to show the data for the Current Month

    Hi all,
    I am working on a report, which currently has this filter: Date First Worked is greater than or equal to 10/01/2010. This reports show the data for the current month, so at the beginning of each month we have to remember to change the date on the filter.
    Does anyone know what the criteria should say, so that it automatically changes and shows the information for the current month, without us having to go in and change anything?
    Any help would be greatly appreciated!
    Thanks,
    AA

    You need to add a session variable to date fir worked assuming that this is a date field.
    To do this open up the filter on the field then at then press add Variable then "session" and enter the following CURRENT_MONTH into the Server Variable section.

  • You have insufficient privileges for the current operation-Getting error running OAF page in R12

    I have a custom OAF page in R11 which is working fine.
    Same page is giving below errors in R12.
    Any suggestions how to resolve this issue..please advice.
    [167]:STATEMENT:[fnd.framework.webui.OAPageSecurity]:MAC validation status = false   
    [167]:STATEMENT:[fnd.framework.webui.OAPageSecurity]:Request parameters validation status = false   
    [167]:ERROR:[fnd.framework.webui.OAPageSecurity]:You cannot run a page which is not SelfSecured when the MAC fails.   
    [169]:ERROR:[fnd.common.Message.auto_log]:FNDFND_INSUFF_PRIVILEGES   
    [169]:ERROR:[fnd.framework.OAException]:You have insufficient privileges for the current operation. Please contact your System Administrator.   
    [170]:EVENT:[fnd.framework.webui.OAPageContextImpl]:OAF LOG: Event : Redirect Page, in: oracle.apps.fnd.framework.webui.OAPageContextImpl: OA.jsp?akRegionCode=FNDDIALOGPAGE&akRegionApplicationId=0&transactionid=817211813&oapc=10&oas=YyMjRI6buFwrYehD8b25iQ..&retainAM=Y&addBreadCrumb=S&OAMC=G   
    [170]:PROCEDURE:[fnd.profiles.Profiles]:getProfileOptionValue:  name=JTF_PF_MASTER_ENABLED; levelID=10001; levelValue=0; levelValueApplID=0   
    [170]:EVENT:[jtf.activity.CorePageObject]: PATBE START currentPageObject : PAT STATUS:false   
    [170]:EVENT:[jtf.activity.CorePageObject]: PATBE END currentPageObject : return factory.dummyProxyUser():   
    [322]:EXCEPTION:[fnd.framework.webui.OAPageBean]:java.lang.NullPointerException   
    Thanks in Advance
    Sridevi K

    Hi Sridevi,
    The custom page is a selfsecured page?
    ie, it will be accessed without login?
    What is the profile option fnd_debuging_level 's value set to.
    I Could see one your other thread
    Re: You have insufficient privileges for the current Operation error
    you mentioned that you did tried setting the profile options
    Framework Validation Level
    FND Function Validation LEvel
    FND Validation Level
    to none, still you are facing the issue,
    At what level you tried the profile options.
    Thanks,
    With regards,
    Kali.
    OSSi.    

  • Getting error "You have insufficiant priviliges for the current operation"

    Hi,
    we are calling one seeded self service page from one custom self service page. But it is showing error like *"You have insufficiant priviliges for the current operation. Pls contact your system administrator."* Pls advice how to resolve this issue.
    Thanks in advance,
    Hanimi.....

    Hanimi
    This can be possible that in the instance in which it is working, In that the user with which you are testing the page is having access to that particular responsibility to which this page is attached.
    So try to assign this page's responsibility to your user and try again.
    Thanks
    AJ

  • Creation of a Query to show the values for the current month and the last 12 months data.

    Dear All,
    Good day!
    I have to create a Query with the below requirement.
    I have to create a Query to show the values for the current month and the last 12 months data.
    Can you please guide me how to achieve this ??
    thank you,
    Regards,
    Hema

    Hema
    explain the exact problem..? as you mentioned you want to create query to show values for current month and last 12 months.. so I think you want to show values for 12 months from current data.. you can achive this by multiple way..
    you can have selection screen and field with date .. and restrict based on system current date and 12 months before or you can handle this at your target.. .. I mean there are multiple ways to restrict data by date range..
    for some more hints..
    http://www.forumtopics.com/busobj/viewtopic.php?t=34393&sid=7fba465d0463bf7ff5ec46c128754ed6
    http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos8-l/how-to-display-last-12-months-in-report-based-on-todays-date-3231850
    http://scn.sap.com/thread/3217381
    search on SDN you will get many other ways..
    Thanks,
    Bhupesh

  • You have insufficient privileges for the current operation error

    Dear All,
    i am getting the You have insufficient privileges for the current operation. Please contact your System Administrator error while opening the oaf page in same window of oracle apps .
    below is the apache log file error
    File does not exist: "instance"/portal/oa.jsp
    Please let me know what is the problem .
    Thanks
    Maheswara Raju

    Try adding the System Administrator responsibility to your user.

  • How to get NFC SE SIM...and when for the 1028

    I am trying to figure out how and where to get my NFC SE SIM card that is supposed to be a free upgrade. Any help?
    Also, is it true the 1028 will be on VZW soon? If so I'm sending the 928 back to Amazon and upgrading; it's ** that it has NFC and cannot be used for payments, even though it came with the wallet app.

        newtowindowsp,
    Help is our middle name. And as advised you can order a NFC SE SIM via customer service (*611 from your VZW phone). Also, you can check with your local corporate store to call ahead and find out if they have any http://bit.ly/3SdsA . Finally, regarding the 1028, no word yet but stay up to date with news on product releases at http://bit.ly/n5snpq .
    EvanO_VZW
    Please follow us on twitter @VZWSupport

  • How to get rid of mutiple events showing in calenders for the same event

    How do you get rid of mutiple events that show up in your calender of the same event. It doesn't matter what kind of event it is whether personel or yearly holiday it shows up mutiple times in the month view, list view. I've gone through and deleted events manually and said for all future events but this is time consuming, because you have to do it for each event. Is there a qicker way of getting this done? Also just an off note I found out that my bluetooth headsets stop ringing throught the ear piece like they did before the upgrade, any insight into this?

    If I understand your question correctly...
    try the following
    from Sources, choose the greyed out streaming library that you want to be rid of...in your case, make sure it is the right one, since they both have the same name.
    You should get a screen that says "Library Unavailable" with 2 menu choices below that, "OK" and "Disconnect from iTunes".
    Choose disconnect from iTunes and the library should be gone from your Sources.

  • How to get the current month starting date and ending date by default ?

    Hello Creators,
    This is my requirement, kindly do the needful, Please dont gimme any links i've no access for other sites, gimme the right solution.
    My Requirement :
    Creation Date (VBAK-ERDAT) - Select Option. By default, the program should run for the current Month ie between the starting and ending date of the current month when the program is run. Today the date is 18th using sy-datum we can bring the current date by calling it in the initialization event, but the requirement is it should not give me the current date, it should only give me the month starting date and the end date. Kindly help.
    Thanks in advance ...

    DATA: gv_datum LIKE vbak-erdat.
    SELECT-OPTIONS: so_date FOR gv_datum.
    INITIALIZATION.
      CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
        EXPORTING
          iv_date             = sy-datum
        IMPORTING
          ev_month_begin_date = so_date-low
          ev_month_end_date   = so_date-high.
      so_date-option = 'BT'.
      APPEND so_date.
    START-OF-SELECTION.
    Hope this solves the issue. Don't forget to be generous
    Cheers,
    Sougata.

  • Help:Unable to get the Current Month Data

    Hello Folks,
    Hello Folks i have this scenario where i need to modify this code so that it has to return data from the Current month First Day to the previous Day if its a daily report and previous month data if its a monthly report.
    BEGIN
    if v_lowdate is null or v_highdate is null then
    select to_number(to_char(sysdate, 'DD')) into v_cur_day from dual;
    if v_cur_day < 25 then
    -- this is for the previous month run
    Select Add_Months(trunc(sysdate, 'MONTH'), -1)
    INTO V_LOWDATE
    FROM DUAL;
    SELECT Last_Day(ADD_Months(Sysdate, -1)) INTO V_Highdate From Dual;
    else
    -- this is for the current month run
    Select trunc(sysdate, 'MONTH') INTO V_LOWDATE FROM DUAL;
    SELECT Last_Day(Sysdate) INTO V_Highdate From Dual;
    end if;
    end if;
    I have replaced the above code with the code below but its still returning the previous month Data. Any help would be appreciated.
    v_lob := get_admin_value(p_admin_procedure_name => 'CLIENT_DATAFEED_CODE',p_err_msg => v_error_text);
    if v_lowdate is null or v_highdate is null then
    v_cur_day := TO_CHAR (SYSDATE, 'DD');
    IF report_type = 'D' -- Daily report
    AND v_cur_day > '01' -- (except when run on 1st of the month)
    THEN -- will cover from
    v_lowdate := TRUNC (SYSDATE, 'MONTH'); -- 1st of this month to
    v_highdate := TRUNC (SYSDATE - 1); -- yesterday
    ELSIF report_type = 'M' -- Monthly report
    OR ( report_type = 'D' -- (or Daily report
    AND v_cur_day = '01' -- if run on the 1st of the month)
    ) -- will cover from
    THEN
    v_lowdate := ADD_MONTHS ( TRUNC (SYSDATE, 'MONTH')
    , -1
    ); -- 1st of last month
    v_highdate := TRUNC (SYSDATE, 'MONTH') - 1; -- last day of last month
    END IF;
    END IF:

    How are you testing this? It works for me, or at least generates the dates I think you want.
    SQL> var fake VARCHAR2(25);
    SQL> var report_type VARCHAR2(1);
    SQL> exec :fake := '16-oct-2009'; :report_type := 'M';
    PL/SQL procedure successfully completed.
    SQL> DECLARE
      2     v_cur_day  VARCHAR2(2);
      3     v_lowdate  DATE;
      4     v_highdate DATE;
      5     fake_date  DATE := TO_DATE(:fake, 'dd-mon-yyyy');
      6  BEGIN
      7     v_cur_day := TO_CHAR (fake_date, 'DD');
      8     IF :report_type = 'D' AND v_cur_day > '01' THEN
      9        v_lowdate := TRUNC (fake_date, 'MONTH'); -- 1st of this month to
    10        v_highdate := TRUNC (fake_date - 1); -- yesterday
    11     ELSIF :report_type = 'M' OR (:report_type = 'D' AND v_cur_day = '01') THEN
    12        v_lowdate := ADD_MONTHS ( TRUNC (fake_date, 'MONTH'), -1); -- 1st of last month
    13        v_highdate := TRUNC (fake_date, 'MONTH') - 1; -- last day of last month
    14     END IF;
    15     DBMS_OUTPUT.Put_Line('Low: '||TO_CHAR(v_lowdate, 'dd-mon-yyyy'));
    16     DBMS_OUTPUT.Put_Line('High: '||TO_CHAR(v_highdate, 'dd-mon-yyyy'));
    17  END;
    18  /
    Low: 01-sep-2009
    High: 30-sep-2009
    PL/SQL procedure successfully completed.
    SQL> exec :report_type := 'D';
    PL/SQL procedure successfully completed.
    SQL> /
    Low: 01-oct-2009
    High: 15-oct-2009
    PL/SQL procedure successfully completed.
    SQL> exec :fake := '01-oct-2009';
    PL/SQL procedure successfully completed.
    SQL> /
    Low: 01-sep-2009
    High: 30-sep-2009
    PL/SQL procedure successfully completed.John

  • How to calculate the measure for the next month using the AGO Function

    Hi,
    I need to calculate the measure for the current month and the next month.
    Can anyone please let me know the syntax to use AGO function for the above requirement.
    Regards,
    Ambika Nanda.

    Hi.
    You can also use Oracle analytic functions LAG and LEAD inside the EVALUATE obiee function. The second one will give you the next measure.
    For example the report is:
    TIMES.CALENDAR_MONTH_DESC
    SALES.AMOUNT_SOLD
    LAG column: EVALUATE('LAG(%1, 1) OVER (ORDER BY %2)' AS DOUBLE, SALES.AMOUNT_SOLD, TIMES.CALENDAR_MONTH_DESC)
    LEAD column: EVALUATE('LEAD(%1, 1) OVER (ORDER BY %2)' AS DOUBLE, SALES.AMOUNT_SOLD, TIMES.CALENDAR_MONTH_DESC)
    And the result is:
    CALENDAR_MONTH_DESC--------AMOUNT_SOLD--------LAG--------------LEAD
    2000-01----------------------------------8025513.84---------------------------8474475.88
    2000-02----------------------------------8474475.88----- 8025513.84-----7439568.24
    2000-03----------------------------------7439568.24------8474475.88-----7062040.48
    2000-04----------------------------------7062040.48------7439568.24-----7497971.40
    Regards
    Goran
    http://108obiee.blogspot.com

  • How to get Item-Code wise stock quantity and value for a previous date

    Dear Sir,
    As per the government legal requirement , we are required to furnish a list for items having stock as on a date ( date is not the current date but it is some past date)  and  in the list we need to provide material wise stock quantity and value .
    We can generate a list  for the current date , but do not know how to get it for a previous date .
    We request you to kindly guide us about such a list .
    With Thanks and Regards
    Sonia Agarwal

    hi,
    might be this reports will be help full for your requirement.
    MMBE
    MB53
    MB52
    MB5M
    MB5B
    MB5T
    MBLB
    MBBS
    MB54
    ME56
    Thanking you

  • I received a phishing email supposedly from my bank and clicked on url - didn't enter any data though.Bank says to get ipad checked for viruses,but I understood ipad has built in security.I've cleared cookies in safari via settings.  Anything else to do?

    I received a phishing email supposedly from my bank and clicked on url - didn't enter any data though.Bank says to get ipad checked for viruses,but I understood ipad has built in security.I've cleared cookies in safari via settings.  Anything else to do?

    I know this has been solved as you reported, but I think you need to check with your e-mail provider. Did you also get this same e-mail on your computer? If you use the same ID for e-mail on computer and ipad, it should have appeared on both. It's very common spam. Check your computer to see if on it, the e-mail is in spam, or, if you deleted it on your ipad, check your recently deleted e-mails.
    You might want to consider changing your password, though people sending spam, don't need it. My e-mail provider had me change my password, not because I was getting spam, but unknown to me, I was sending it!  (You'll still get some spam, though.) It's when you learn that you're unknowingly sending spam...that you must change your password.
    Hope this helps.
    (Ss I was sending this, I just got an e-mail notification from the Nigerian... it got to my e-mail instead of going to spam.)

  • I cannot see my Iphone 4 in my device window in the finder anymore.  It use to appear so I could copy the camera pictures off of it and transfer them to other folders.  Does anyone have and idea how to get it back when you plug it in initially.  Thanks

    I cannot see my Iphone 4 in my device window in the finder anymore.  It use to appear so I could copy the camera pictures off of it and transfer them to other folders.  Does anyone have and idea how to get it back when you plug it in initially.  Thanks

    You will want to open iPhoto, go to the iPhoto menu and select Preferences. Under the General tab, next to Connecting camera opens: select iPhoto. Close the preferences and quit iPhoto. Reconnect your iPhone 4. iPhoto should open automatically and offer to import your pictures. Import them and then do what you want with them.
    Best of luck.

  • I'm in Brazil and need to talk via e-mail or chat, with the USA App Store. It happens that I made a purchase and did not get because I live in Brazil and mistakenly bought the site of the USA. How do I? Do you have any e-mail the department in charge?

    I'm in Brazil and need to talk via e-mail or chat, with the USA App Store. It happens that I made a purchase and did not get because I live in Brazil and mistakenly bought the site of the USA. How do I? Do you have any e-mail the department in charge?

    I've tried, said they could not help and I should get in touch with the USA App Store. But the problem of getting in touch with the App Store USA is the only option I have on the phone, and my English is not very helpful. Therefore needed a complete address e-mail.

Maybe you are looking for

  • I keep getting the following error message---"We're sorry but the Safari browser version you are currently using does not support the community toolbar."

    When I log in I get this message I keep getting the following error message---"We're sorry but the Safari browser version you are currently using does not support the community toolbar." Also, I can seem to down load my Adobe Flash, I did download wh

  • Types of Display

    I own a Santa Rosa Macbook Pro (Silver, 15.4" with a matte LED display). It is a year old. My screen recently started to get patches on it so I went to the Apple Care Center and got my display replaced. Now the problem I have with my new display is t

  • Dynamic Calc

    Have a Dyname Calc member using this 1. formula and IT IS working fine. I want to add another piece to it so that my monthly members act the same way 2. So far the 2. part does nothing. Can anyone provide me some hints or tips on why this has no affe

  • Recommended way to start db on oracle10g asm in cluster

    We have a oracle 10g asm instance running on Solaris 10 cluster. During maintenance activity, we shutdown the database using cluster but startup of the database is carried out by DBA & not thru cluster. We then start the cluster service of the databa

  • Sql Queries - adding calculated variables to views

    Hello: I'm trying to do add a calculated variable to my view that isn't an Entity Attribute, its simple really but i don't know if I'm leaving something out or not. I add the "new Attribute" , call it nCompleted, type - number I then check off everyt