Need to get data till last month end by using Calday

Hello SAPiens,
Could anybody please guide me how to get the data till last month end date.
Example: If i m executing a report in 05 November 2009 then i should get all the details of last month till last date of the Calmonth. thanks in advance.
Regards,
Sandy.S

Hi,
you can do the following:
Create a Customer Variable for Calday
EXIT_SAPLRSOO_001 ---> Include ZXRSRUO1 write the code for the variable created above
DATA : date TYPE sy-datum.
date = sy-datum. "Today
date+6(2) = '01'. "First day of this month
date = date - 1. "Previous day before first day of this month = last day of last month
Or
you can you many function Modules
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS
FKK_LAST_DAY_OF_MONTH
OIL_LAST_DAY_OF_PREVIOUS_MONTH
Santosh

Similar Messages

  • Getting Error while doing month end provisions using FS00

    Hi Guru,
    please suggest.
    while making month end provisions for salraies by using t code FS00 geeting error that Account XXXXX does not exist in company code level
    please help me on reslove this.
    Rgds..Suresh

    Hello Suresh,
    The GL Account does not exist for that Company code. Hence extend the GL Account to the Company Code by using Copy with template in FS00.
    Regards
    Kalpana

  • Getting Last Month End date

    Dear Experts,
    I want the following result. I have a date parameter. I want to
    get the last / end date of the previous month
    for any given date which the user inputs.
    For ex:
    If user puts the date 15.06.2008
    then i want to get the previous month end date i.e. 31.05.2008.
    The reason being i am creating a program for updating Opening and Closing Stocks of every month in a ZTABLE. The user will put the date in the parameter and system will bring the closing stock of previous month and then calculate for the current month.
    I hope i am not complicating matters too much....
    Basic funda is to arrive at the end date of the previous month for any date which the user puts.
    Please help me... it is mission critical..
    Thanks & Regards,
    Jitesh M Nair

    hi,
    use this to get last month end date.
    ex:
    data: d2 like sy-datum.
    d2 = sy-datum.
    d2+6(2) = '01'.
    d2 = d2 - 1. "prev mnth last date
    write:/ d2.

  • Last month end date based on current date

    Hi,
    How to show last month end date based on the current date.
    Eg:
    Current date = "08/26/09"
    Var- Last Month End Date = "07/31/09" etc...,
    Please help me how to get it...
    Thank You!

    Good to hear that it worked for you. but not for me.
    I tried like this:
    1st::
    1. var1= ToDate("06/30/09","MM/dd/yyyy")
    2.Var2= RelativeDate([Var1];-DayNumberOfMonth([Var1]))
    result: 5/30/09
    2nd:
    RelativeDate('6/30/2009';-DayNumberOfMonth('6/30/2009'))
    result: 5/30/09
    Am working on SAP OLAP cubes.
    Please help me where am going wrong....
    Thank You!

  • I have the "Hanvon 5040 drawing tablet",it was working perfectly with mac till last month.As soon as i plug the USB of my tablet into my macbook pro the computer is blocked and an error apears: "you need to restart your computer..."nothing works.Any help?

    I have the "Hanvon 5040 drawing tablet",it was working perfectly with mac till last month.As soon as i plug the USB of my tablet into my macbook pro the computer is blocked and an error apears: "you need to restart your computer..."nothing works.Any help?

    Check with the manufacturer for updated drivers for your tablet.

  • Need to get data for month entered in  user prompt to prior 12months.

    Hi,
    I have a report where i need to display total amount for current month  to prior  12 months data...first column will be current month, second column is (current month-1),3rd col: (current month-2)....( current month-12).
    Is there any way I could use current date to get previous 12 months in  variables?
    For example: if  current date is 02/15/2010, I need get  data for 01/2010, 12/2009, 11/2009,....01/2009.
    For example: if I entered Month: 03  and year:2010 in prompt , then I need to get data for prior 12 months to that in the prompt for month:03?.

    The only way to do this is using restrictions on Universe... here you can have the restrictions for every month or a range using the user prompt and the system date.
    Regards

  • Get dates of last week - Please Help !

    Hi All,
    I have to make a query for retrieving the data for the last one week from a table say "Orderdata".
    So can anybody please tell me how to retrieve date of last weak from the current date. I mean if current date is 12/08/2004 (mm/dd/yyyy) then I would be needing date as :--
    12/01/2004 (mm/dd/yyyy) to 12/07/2004 (mm/dd/yyyy).
    To more clear, here is the query that am using :
    select * from orderdata where orderdate between 12/01/2004 AND 12/07/2004
    I know I would be needing java.sql.timestamp class to set date . but it is the last thing to do .
    First I have to get date of last weak...........
    Here is the code----------that i have just start to write ..
    Calendar cal;
    TimeZone tz;
    String estTimezone="GMT-05:00";
    tz=TimeZone.getTimeZone(estTimezone);
    cal=new GregorianCalendar(tz);
    cal.setTimeZone(tz);
    String currentdate=String.valueOf(cal.get(Calendar.MONTH)+1);
    currentdate+="/"+String.valueOf(cal.get(Calendar.DAY_OF_MONTH)-1);
    currentdate+="/"+String.valueOf(cal.get(Calendar.YEAR));
    out.println(currentdate);And assume if current date is 12/1/2004 (mm/dd/yyyy) then subtracting -1 form the current date will give 12/00/2004 so not getting the correct result .
    Hope it is clear to all................
    Please Help !
    amitindia

    Hi All,
    Thanks chirag813 for your coding. and thanks to all.
    By the way I have to change time in EST and also required start date and end date of last weak. So my final coding is as:
    Please have a look into the code and tell me whether the code is correct / fine or not.
    Do I need to call the getInstance() method in my code as you (chirag813) have put in your code
    Calendar calendar = Calendar.getInstance();
    Is my code fine ?
    Please Answer..................
    String startdate;
    String enddate;
    Calendar cal;
    TimeZone tz;
    String estTimezone="GMT-05:00";
    // is this line correct to get startdate
    SimpleDateFormat sdfStartdate= new SimpleDateFormat("yyyy-MM-dd 00:00:00");
    // is this line correct to get enddate
    SimpleDateFormat sdfEnddate= new SimpleDateFormat("yyyy-MM-dd 23:59:59");
    tz=TimeZone.getTimeZone(estTimezone);
    cal=new GregorianCalendar(tz);
    cal.setTimeZone(tz);
    cal.add(Calendar.DATE,-7);
    startdate=sdfStartdate.format(cal.getTime());
    cal.add(Calendar.DATE,6);
    enddate=sdfEnddate.format(cal.getTime());
    Timestamp t1=Timestamp.valueOf(startdate);
    Timestamp t2=Timestamp.valueOf(enddate);
    out.println(t1);
    out.println("<br>"+t2);
    And finally I have used Timestamp class to change the date (String) to Timestampt.
    Thanks !
    amitindia
    SCJP 1.2

  • Get data from more than 1 subtype using RP_PROVIDE_FROM LAST

    Hi all,
    I need to get data from infotype 2013 subtype 90 and subtype 91.
    Currently the codes only allow me to use it one time for the same infotype. If I use it again for the same infotype, pnp-sw-found will equal to zero. Anyone have any idea on this?
    Example:
    Get pernr.
    Start of selection.
    rp_provide_from_last p2013 0090 pn-begda pn-endda.
      IF pnp-sw-found =  1.
    **--> Populate internal table
        MOVE p2013-ktart TO ls_quota-ktart.
        MOVE p2013-aedtm to ls_quota-aedtm.
        MOVE p2013-uname to ls_quota-uname.
        MOVE p2013-accnu to ls_quota-accnu.
        MOVE p2013-accop to ls_quota-accop.
      ELSE.
        REJECT.
      ENDIF.
    End of selection.

    Using RP_PROVIDE_FROM_LAST you can only use for one infotype and one subtype. For reading data for IT2013 with subtypes 90 and 91....you have to use following....
    Get pernr.
    Start of selection.
    rp_provide_from_last p2013 0090 pn-begda pn-endda.
    IF pnp-sw-found = 1.
    **--> Populate internal table
        MOVE:
               p2013-ktart TO ls_quota-ktart,
               p2013-aedtm to ls_quota-aedtm,
               p2013-uname to ls_quota-uname,
               p2013-accnu to ls_quota-accnu,
               p2013-accop to ls_quota-accop.
    ELSE.
      rp_provide_from_last p2013 0091 pn-begda pn-endda.
      IF pnp-sw-found = 1.
         **--> Populate internal table
         MOVE:
               p2013-ktart TO ls_quota-ktart,
               p2013-aedtm to ls_quota-aedtm,
               p2013-uname to ls_quota-uname,
               p2013-accnu to ls_quota-accnu,
               p2013-accop to ls_quota-accop.
       ELSE.
           REJECT.
       ENDIF.
    ENDIF.
    End of selection.
    Hope this answer is helpful

  • Need to Get Data From Siebel On Demand ( I am new to Siebel Please Help)

    Hi All,
    I have a project in which i need to get data from Siebel On Demand and Automate this process.
    I have downloaded the Custom WSDL file and the Schema file from Oracle Siebel On Demand. I am using IDE WSAD and when i import these files into WSAD i am getting an error stating the schema definitions are wrong. Can anyone help me.....
    I need to complete it asap....
    Edited by: user491578 on Nov 11, 2008 6:50 PM

    You should probably ask Advantech. This question really has nothing to do with LabVIEW SE or NI-ELVIS. You could try posting to the LabVIEW board but there have only ever been two posts regarding 'advantech 4716'.

  • How to get data from a USB-UIRT device using Labview?

    How to get data from a USB-UIRT device using Labview?
    I'm trying to get data from a USB-UIRT device, is it posible with Labview?
    I really appreciate your help, 
    thanks

    You may want to contact the developer of the device for the API and DLL.
    http://65.36.202.170/phpBB2/viewforum.php?f=3

  • What is Month End Procedure using in Business Area?

    Hi All,
    What is Month End Procedure using In Business Area?
    Thank you
    Ramakanth

    Hi,
    As my experience business area month end to check the profitability each b. areawise and all the month end adjustment entries should be enter business area wise. We can also check the clearning for one business area to anyother b.area.
    Regards,
    Pankaj

  • Data Modelling - Complex issue need to get DATE values

    Gurus and Experts
    I have a situation where i have a infoobject-A which is char having value 10.
    I always get the values to this infoobject as 0001032008 from the source system
    means 0001 is constant
        and 032008 is month and year
    Now i want to use this as a dynamic query where user enters 0001032008 it should get values for T+23 months
    where T = 0001032008 and T+23 would be 0001022010 (or february 2010) in short.
    I get only make this work if i can use this infoobject to mapto  0calmonth and in query use variable for offsets with range as T to T+23.
    Steps would be
    1)Create infoobject -B ,reference it to 0CALMONTH
    2)In Transfer structure ,take always last 6 values ,so we get date as 032008
    Now the 0CALMONTH always work with value such as 200803 and not 032008 ,so how would this work ,so will this solution work ,how to achieve this complex logic.
    Or is there any other alternative best simple solution
    please help
    thanks

    Hi
    Sometimes what seems complex can be solved by going back to the root.
    Let me explain:
    Your source system sends you an information with a format 0001MMYYYY. If I catch you, you created an IO to get the information as a master data. That's fine.
    But your aim is to interpret your source data as 0CALMONTH. So I suggest that you add 0CALMONTH in you Transfer rule, feed 0CALMONTH by ABAP code in the transfer rule to extract the information from your source system.
    If you want, you can keep the original IO, but I do not know what you can do with it....
    If you took BW310 course, your problem looks like the first exercise where you play with the cost center comming from another source system.
    May be I did not catch everything but it is getting late for me
    Cheers
    PYG

  • Some assistance needed on getting data off of a Time Machine backup

    To make this short, I had a major HD failure on an older external Lacie drive that I used as storage for all kinds of things. I had that drive backed up, along with everything else, onto another Lacie external drive. Coincidentally, after the storage drive failed, so did my newer Lacie drive used for backup, BUT it is assumed that this one if just a bad power supply. A new one should be here today so we'll see if it will spin up.
    While waiting on the PS to arrive, I've decided to change backup strategy a bit and purchased a RAID array set up as RAID1. At least this way a drive failure won't screw me. I know, I still need to be careful since the drives are mirror's of each other so if the data is corrupted...anyway.
    The RAID is up and running and Time Machine is working flawlessly (for now) on it. Once I get the PS for my other drive and providing it spins up, I need to pull data off of the old Time Machine backup in that drive, specifically for the storage drive. I know that on the TM drive there is a directory for that storage drive, but what I don't know is if I can just copy the latest dated directory for that drive and I'll get all the data or am I going to have to go through Time Machine to get at.
    And that is the other problem. I don't think TM will give me access to that drives data since the drive is no longer connected to my system. I'm hoping I'm wrong on that and that there is a simple solution to get at the data.
    So help if you can and keep your fingers crossed that the drive will spin up!
    Anthony

    WOW. After letting DW do it's thing and failing to be able to write a new directory, it WAS able to create one and use it create a preview of the the drive. It said the drive was damaged and the new directory couldn't be written.
    Well, the preview seems to have worked OK and I was able to copy the data from my old "storage" drive to a new folder on my new backup drive. That took an incredibly long time, but it looks like all 67GB of data is intact. I'm currently writing zeros to the old drive after repartitioning it. That should take care of the volume structure problem, but certainly doesn't make me feel all warm and fuzzy about the drive stability.
    And all this leaves me with another question. What the heck caused the volume structure to get completely hosed at the same time the other drive failed totally? Since TM was backing up the "storage" drive to this one, could the failure have caused something to get majorly messed up on the TM drive?
    Or, could the TM drive failure been caused by all these darn TM errors that keep popping up for no rhyme or reason? And oh yeah, the errors are popping up on the brand new 3 day old drive, too. TM seems to work when it wants to!
    All this mess makes me feel really uneasy about using TM at all. Should I change to Retrospect or something? Should I continue to use it and ignore the errors that so many of us seem to be plagued with? Can TM totally FUBAR a drive with these errors?
    I need a drink after this mess, so please feel free to chime in with your thoughts and suggestions.
    Thanks all for giving me advise and encouragement.
    Anthony

  • Need to get data for specific user logged in

    Hi All,
    I need some pointers for the sql query. I have a query that extracts approval history information along with current status of person who submitted for changes of his direct reportee.
    what I need is to get the only the approval data of logged in person( top to bottom/bottom to top persons involved) in approval process.
    we built the report, but it gets all of the approvals data from HRSS related tables.
    I need to get the data of person who logged in.
    is this possible? can someone please provide some pointers?
    Thanks in advance..

    @Pablolee, Thanks for the reply
    Pointer number 1.
    Provide a (working)test case so that your requirements are clear.
    -- scenario
    lets say we have   Manager1, Manager2, Manager3
    Here is test case
       Manager1 - Submitted person salary change and went for approval. In this approval process It went upto manager level say Manager3.
    the sql query i have gets all approval process data of all other's manager's involved in whole approval process. as Manager1 when i logged in I wanted to see where this salary change record is pending i.e Manager3.
    but my query show all others data also. can you tell me how to get Manager1(top to bottom OR bottom to top of this person logged in) change record submitted data in approval process.
    I hope you understand this, If possible please let me know how to achieve this.
    Thx..

  • Help to  get date before (six month)

    hi,
    i have to get in field  the date of six month ago  what is the best way to do that?
    example.
    if now_date = 14.10.07
    i wont in l_date 14.4.07
    or if now_date =  15.1.2003
    l_date = 15.7.2002
    Regards

    Hi,
    For this logic to work,we will have to use the Offset method for the month as well as the Year part of the date.
    Please refer to the sample code mentioned below:
    data:cur_date type sy-datum.  "Date entered by the user.
    data:wanted_date type sy-datum.    "Date six months ago.
    if suppose the month for the current date is greater than June,i.e from July to December,then the logic should be,
    wanted_date = cur_date + 2(0) - 6.   "Only reduce the month part of the date by 6.
    if suppose the month for the current date is either equal to or less than June,i.e
    from January to June,then the logic should be,
    wanted_date = cur_date + 2(0) - 6.    "Reduce the month by 6.
    wanted_date = cur_date + 4(0) - 1.    "For reducing the year by one as the year also gets changed in this case.
    I hope you understood my point.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

Maybe you are looking for