Regarding the first day of the previous month

hi experts,
              suppose the date is '010406' what i want that is der any function module so that i can get the first date of the previous month i.e '010306' plz let me know......or sud i add logic for that if yes plz help me........

better to use own logic for your requirement....
suppose you have date field
data : date1 like sy-datum,
mon(2) type n,
year(4),
         prev like sy-datum.
date1 = '20070720'.
mon = date1+4(2).
year = date1+0(4).
if mon ne '01'.
mon = mon - 1.
concatenate year mon '01' into prev.
else.
mon = '12'.
year = year - 1.
concatenate year mon '01' into prev.
endif.
write : / prev.
if the date is like your format i.e. 010406 then
data : date1(6) value '010406',
mon(2) type n,
year(4),
         prev like sy-datum.
date1 = '20070720'.
mon = date1+2(2).
year = date1+4(2).
if mon ne '01'.
mon = mon - 1.
concatenate year mon '01' into prev.
else.
mon = '12'.
year = year - 1.
concatenate year mon '01' into prev.
endif.
write : / prev.
regards
shiba dutta

Similar Messages

  • I want the minimum of the horizontal axis to be the first day of the month.

    I have a situation where I want the minimum of the horizontal
    axis(with date time axis) to be the first day of the month. I
    attempt it like so:
    var max:Date = new Date();//current date is our max from
    which we will calculate the min
    var min:Date = new Date(max.fullYear,max.month,1);
    dateTimeAxis.minimum = min;
    However this first date on this axis is the last day of the
    previous month for example 31 August instead of 1 September. Any
    ideas how to fix?

    Nikos, the only thing I can think of (off hand) is that it's
    defaulting to "zero" hour on that date, if you tried:
    var min:Date = new Date(max.fullYear,max.month,1,13);
    Would that make it work? That would set the date to 1pm.
    Have you considered defining the axis with the data you are
    binding to?
    Cheers,
    David

  • How to get the first day in the month from a domain date ?

    Hi,
    I like to know how to get the first day in the month from a domain date?
    Thanks
    Stephen

    Hi Gokul...
    Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
    Its similar to the above one but instead of writing case statement you can achive the following.
    data : w_res type i,
             w_data type d,
    w_res = w_date mod 7.
    w_date = w_date - w_res.
    write w_date.
    This works.
    Regards,
    Siddarth

  • On my iPad 3, how do I make calendar items lasting more than one day appear as such on the monthly view of my calendar? Right now only the first day of the item appears.

    On iPad 3, all of my calendar items lasting more than one day do not appear correctly when looking at the monthly view of the calendar; only the first day of the appointment appears. For example, if I am taking a vacation for 4 days, only the first day of the vacation is marked on the calendar, instead of being listed on all 4 days. When I look at the weekly view, however, it is correct and is listed on all 4 days. The problem here of course is that at a glance, there is no way to look at my monthly schedule. On my iPhone, everything is correct, regardless of month or week view, so clearly this is an iPad problem I guess? Please advise on how this can be corrected. Thank you!

    Unfortunately you can't do what you want. Many people have complained to Apple about this. I suggest you provide Apple feedback directly at http://www.apple.com/feedback/macosx.html. They will not provide a direct response but hopefully if enough people provide feedback Apple will fix this.

  • Sunday as the first day of the week in month view on the iTouch

    Does anyone know how to change Sunday to the first day of the wek in the month view of the calendar on itouch?
    BTW, I have selected Sunday as the first day of the week in ical on my imac which syncs the ipod itouch. Am I forgetting something or is there a hidden preferences page?
    Tom

    TLGreen58 wrote:
    Does anyone know how to change Sunday to the first day of the wek in the month view of the calendar on itouch?
    BTW, I have selected Sunday as the first day of the week in ical on my imac which syncs the ipod itouch. Am I forgetting something or is there a hidden preferences page?
    Tom
    Hi,
    OMG! How bizzarre, another quirk of the "Region Fortmats" setting.
    *Settings > General > International > Region Format*
    If I set mine to U.K. (where I happen to live), Monday is apparently the first day of the week on the calendar and I have no 12/24 hour clock option.
    If set to U.S., Sunday is the first day and the 12/24 hour clock option is available.
    I guess changing the Region is your answer.
    How odd! Not to say irritating.
    Dud.
    Message was edited by: Duddo

  • How  to  get the FIRST DAY OF THE CURRENT MONTH

    how to get the FIRST DAY OF THE CURRENT MONTH in oracle 9i.
    plzzzzz send immedaily.advance thanks

    TEST@test SQL> select trunc(sysdate,'MON') from dual;
    TRUNC(SYS
    01-OCT-06
    TEST@test SQL>                                  

  • Why multi day events are shown only on the first day in calendar (in month view)

    Why multi day events are shown only on the first day in calendar (in month view)?

    Figured it out - the event has to be marked as full day event in order to be shown in monthly calendar. Disregard my question.

  • Changing the first day-of-the-week on the MyTimesheets app

    IN the SAP ECC and Portal implementations of the timesheet app, we were recently able to change the display so the first day of the week is listed as Monday, rather than Sunday. I would like to do the same thing with Fiori.
    That is, when the app starts up the first view a calendar view of the whole month. If a person wants to enter time manually, they click the button labeled "manual" and a data entry screen pops up. The first day of the week listed across the top is Sunday, which does not reflect our settings in ECC. We need the 1st day of the week to be Monday.
    Is there a configuration change we can make to force the 1st day of the week to be Monday, as it is in ECC?
    thanks for your help!
    -Rob Solomon

    Hi Rob,
    Are you using Wave2 app? You could change the setting for first day of the week in CAC1 and Fiori Timesheet app will adjust te calendar accordingly.
    Nothing needs to be done for Fiori app.
    Please update UIX01HCM to SP03 if you are using Wave2 app?
    Best Regards
    Pankaj

  • United Kingdom Regional Format sets Monday as the first day of the week.

    With the Region Settings (Settings -> General -> International -> Region Format) set to United Kingdom, Calendar displays Monday as the first day of the week. I have seen other posts whereby it was suggested to change to US Internationalization but this will also change the date and telephone number formats to US settings, far more frustrating.
    Have I been sheltered from properly formatted calendars all my life or is this a mistake and it should start the week on Sunday. It is consistent in both the Week and Month view.
    Am I crazy or does anyone else agree with is?

    Same here. One of the first things I do in this sort of application is switch week start to Mondays.
    Terry, East Grinstead, UK
    Message was edited by: Terry P

  • Want to make Monday as the first day of the week in GregorianCalendar. how?

    hi
    I need to know what day is the first of the month is. for example the 1st of Nov 2004 is Moday and 1st of Dec 2004 is saturday.
    I am using the GregorianCalendar:
    1.  GregorianCalendar calendar = new GregorianCalendar(2004,11,1);    //set date to 1st Nov 2004
    2.  int firstDay = calendar.get(Calendar.DAY_OF_WEEK);now firstDay is 2. This is because the week starts from Sunday, so Monday is the 2nd day.
    But I am in Uk and my Uk Calendar shows monday as the first day (even in Windows 2000 Calendar).
    I would like the GregorianCalendar to have Monday as the first day of the week, so that the
    int firstDay = calendar.get(Calendar.DAY_OF_WEEK);
    returns 1 in the above case.
    I also tried adding
    calendar.setFirstDayOfWeek(Calendar.MONDAY); just between line 1 and line 2, but it did not help.
    This is because i don't want to manually subtract 1. If i manually subtract one, then the program might not work in other locale and timezones.
    Also if I subtract 1, then for 1 Feb 2004,
    int firstDay = calendar.get(Calendar.DAY_OF_WEEK);
    will return 1 as 1st Feb 2004 falls on Sunday. so if i subtract 1 it will be 0, so I have to do a extra checking for 0.
    Is there anyway to make the Calendar have Monday as the first day of the week??
    Tanveer

    hi
    I need to know what day is the first of the month is.Why does this matter? Since we know that 1 == Sunday and 2 == Monday... Why do you need Monday to be == 1? and couldn't you just subtract 1 if it's so important?
    for example the 1st of Nov 2004 is Moday and 1st of
    Dec 2004 is saturday.
    I am using the GregorianCalendar:
    1.  GregorianCalendar calendar = new
    GregorianCalendar(2004,11,1);    //set date to 1st Nov
    2004
    2.  int firstDay = calendar.get(Calendar.DAY_OF_WEEK);now firstDay is 2. This is because the week starts
    from Sunday, so Monday is the 2nd day.
    But I am in Uk and my Uk Calendar shows monday as the
    first day (even in Windows 2000 Calendar).
    I would like the GregorianCalendar to have Monday as
    the first day of the week, so that the
    int firstDay = calendar.get(Calendar.DAY_OF_WEEK);
    returns 1 in the above case.
    I also tried adding
    calendar.setFirstDayOfWeek(Calendar.MONDAY);[/cod
    ] just between line 1 and line 2, but it did not help.
    This is because i don't want to manually subtract 1.
    If i manually subtract one, then the program might not
    work in other locale and timezones.
    Also if I subtract 1, then for 1 Feb 2004,
    int firstDay = calendar.get(Calendar.DAY_OF_WEEK);
    will return 1 as 1st Feb 2004 falls on Sunday. so if i
    subtract 1 it will be 0, so I have to do a extra
    checking for 0.
    Is there anyway to make the Calendar have Monday as
    the first day of the week??
    Tanveer

  • Setting the first day of the week

    Hi,
    Is there any other place in Mac OS X where I could set system's first day of the week, except iCal? In iCal it's set to Sunday, but in OmniFocus mini calendars show Monday as the first day of the week, although even there in OmniFocus preferences I've set it to use Sunday as the first day of the week. Developer says that OmniFocus is using system's settings, but nowhere in my system (except iCal) I can find where I could set the first day of the week. I have set English as the default language and order of list sorting in the International settings. Any ideas or suggestions?

    Unless it is set with the Country in the International preferences, I don't think their tech support knows what they are talking about. However, if that is where it would be set, you should be able to override it with the custom settings, but you can't.
    I'd ask them to tell you where that gets set, or is stored. Ask them what system call is used to get that value. My guess is they won't be able to tell you.

  • Changing the calendar settings: Sunday as the first day of the week

    Dear Masters of SAP universe,
    In ECC6.0, I am using a LIS info-structure with the period split set to week.
    I would like to know how can I change the calendar settings in order to consider Sunday as the first day of the week, instead of Monday.
    For example:
    A sales order created on Dec 12th creates the record 201049 in the info structure S900 - SPWOC.
    I would like to have it as 201050, where 50 is the currently week in the system.
    I already checked OSS notes and the transaction SCAL for customizing. But I did not find a solution this issue.
    Your help is highly appreciated!

    hi,
    this seems to be a calendar issue.
    please check for OSS also - 1158474.
    balajia

  • Can I change the first day of the week on my ipod touch

    I have a new Ipod touch, which i recently upgraded to OS 3.0. I was wondering if it is possible to set the first day of the week in Ical to Sunday instead of Saturday?
    Thanks

    The International Region Format controls the start day of your calendar display. UK region format sets the display to start on Monday. US region format will start the calendar on Sunday. However, that setting also controls your date, time and phone number formats, so using it would only cause you more problems.
    Tell Apple you want the option to set the calendar week start independent of the international region format using the feedback page. http://www.apple.com/feedback/ipodtouch.html

  • How do I change the first day of the week in calendar?

    I recently updated to ios 5.
    unfortunately, this made sunday day one of the week in calendar, not Monday which is my preference (and the convention in Australia).
    I was able to change it to Monday by changing international settings to UK, but this changed other settings such as uk version of google as default search engine, which I would prefer to avoid.
    Is there a way to make Monday the first day of the week in calendar AND keep my other international settings as Australia?
    Many thanks for suggestions.
    Chris.

    I don't think you can. Your best bet is to send Apple feedback and ask for that functionality.

  • Is there any way to change the first day of the week back to Monday in iCal for iPhone?

    With the new upgrade, iCal in my iphone is now showing Sunday as the first day of the week.
    Is there a way to change it back to Monday as the first day of the week?

    Hi! The only way I know of is changing the screen resolution. Tom

  • Moving a GregorianCalendar to the first day of the week

    I'm using a GregorianCalendar class in order to get the time stamp for the nearest Sunday's date.
    here's what I'm trying to do:
    1. get a timeStamp and set it into a date
    Date startDate = new Date(startTime);2. create a new GregorianCalendar using the above date as the start time.
    GregorianCalendar calendar = new GregorianCalendar((startDate.getYear()+1900),startDate.getMonth(),startDate.getDate());3. the tricky part: make sure the calnedar's date is set to Sunday, if the current date is on any day other then Sunday, I will have to move it back to the nearest Sunday. I'm trying to do this by using:
    calendar.set(Calendar.DAY_OF_WEEK, 0);     for some reason this does not work...
    am I doing anything wrong here?

    thanks for that info but the problem is still there. here's some more input:
    //creating the date, the ts here is 1153858800000 which is the dated in 7/25/2006
    Date startDate = new Date(startTime);
    //creating the new calendar
    GregorianCalendar calendar = new GregorianCalendar((startDate.getYear()+1900),startDate.getMonth(),startDate.getDate());
    //setting the calendar to the first hour (not sure it necessary)
    calendar.set(Calendar.HOUR, 1);
    //setting the calendar to the first day of the week
    calendar.set(Calendar.DAY_OF_WEEK, 1);
    //this returns 1153778400000 which is still dated 7/25/2006 whic is a Tuesday I would expect it to returns a different date
    calendar.getTimeInMillis()     

Maybe you are looking for

  • Which is better as UI technology among Flex and Oracle ADF for oracle SOA s

    We have one application which is using oracle's Service oriented Architecture (SoA) suite. Currently, there is a debate on the technology for UI in the new architecture that will be rich, easy to maintain, scalable and integrates well with SOA suite.

  • Enhancement on VA03/VA02

    Hi All, In Transaction VA03, when the Net Value of an Order exceeds 10,000 USD, I want that the delivery should be blocked for all other Users. That Order can only released by some certain users(may be by some higher authority). What I have to do? Wh

  • Need help connecting my iPhone 6 to my MacBook Pro to stream the internet

    Need help connecting my iPhone 6 to my MacBook Pro to stream the internet

  • Environment help requested

    OK I made it over the first hurdle... I usually shy away from the environment, but I am starting to get the hang of it. I am trying to send note on messages to a fader, result affecting meta event #51 "go to marker." This will allow me to dictate my

  • Very Slow H.264 Encoding in FCP 10.1.2 and Compressor 4.1 on nMP

    I have a fully maxed out 12-core nMP and editing with this machine in FCP 10.1.1 has been a delight.   I recently completed a 4K project from footage shot with the Sony AX-100 and then output the project from FCP X using File>Share>Master File to Pro