Number of all Mondays to Fridays in specific month

Hi Experts,
How to find number of all Mondays to Fridays in specific month?
Is the any standar FM for the same?
regards

Hi Ashish,
use the below function module to count the no of weekdays(monday-friday).
first find the first day and last day of the month..by passing any date of the monthe to below function modules..
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'    " returns last day of the month..
EXPORTING
        VALUE = SY-DATUM
  IMPORTING
         VALUE = w_lastdate
CALL FUNCTION  "RS_VARI_V_1_ACTUAL_MONTH" --Returns first day of the actual month.
  EXPORTING
        VALUE = SY-DATUM
  IMPORTING
         VALUE = w_firstdate
do 31 times.    "max days is 31...
if w_lastdate GE w_firstdate.
  CALL FUNCTION DATE_GET_WEEK..
       EXPORTING
             DATE    = SCAL-DATE  "result from RP_LAST_DAY_OF_MONTHS
       IMPORTING
             VALUE = w_WEEK.
  if w_week = 1.
     monday = monday +1.
  elseif w_week = 2.
   tuesday = tuesday + 1.
  elseif w_week = 2.
   tuesday = tuesday + 1.
  elseif w_week = 3.
   wednesday = wednesday + 1.
  elseif w_week = 4.
   thursday = thursday + 1.
  elseif w_week = 5.
   friday = friday + 1.
  endif.
  if w_week ge 1 and le 5.
   weekdays = weekdays + 1.  "counting totoal number of modays - fridays in the month
  endif.
ELSE.
EXIT.
endif.
endloop.
DATE_GET_WEEK Returns week for a date
if it returns 1 = monday
2 = tuesday
3 = wednesday
4 = thursday
5 = friday
6 = saturday
7 = sunday
RP_LAST_DAY_OF_MONTHS
Regards,m
Prabhudas
Edited by: Prabhu Das on May 13, 2009 7:49 PM

Similar Messages

  • Can i count the number of Mondays in a specific month with a formula?

    Hi
    I am looking for a streamlined way of calculating an amount to invoice for a job that I am paid for weekly, but for which I invoice monthly, meaning that I am invoicing different amounts each month, depending on how many Mondays fall in a given month (i.e. 4 or 5).
    So I am wondering if there is a function I can use to calculate the number of Mondays in a given month automatically and then I can use this value to multiply by my weekly charge to calculate the amount to invoice each month.
    Thanks
    Nick

    Responses below apply to my earlier post.
    nick_harambee wrote:
    1. What part of the formula do I need to change to do the same for other days of the week, and for other years?
    No change for other years, as the full date is entered.
    I haven't looked at changes necessary to the version above to show results for other days. See below for a new table that does all days.
    2. Would it be possible to construct one table with the calendar for a whole year, which would generate a count for each day of the week, which I could then use as and when needed? Or would it make more sense to construct a separate table for each day of the week (as I am referring to in question 1)?
    Depends what information you need.
    If you need the count for only one week day, then a table showing only the count for that day of week will avoid having to search it out.
    If you need the number of occurrences of each weekday in each month, then a table showing those, with or without an attached calendar, is in order.
    Here's one that shows the count of each weekday for each month. It uses two formulas, derived from the earlier posts by Yvan and Jerry:
    B1: =DATE($A,COLUMN()-1,1)
    B2: =IF(AND(DAY(EOMONTH(B$1,0))>28,MOD(WEEKDAY(EOMONTH(B$1,0))+7-(ROW()-1),7)<(DAY( EOMONTH(B$1,0))-28)),5,4)
    The formula in B1 is filled right to M1, and the cells are formatted to show only the Month and Year. Note that the cells actually contain Date and Time values, which are used in the second formula's calculations.
    The formula in B2 is filled right to M2 and Down to M8.
    Day names in column A are entered directly and are not used in the calculations.
    The 4 digit year number is entered directly in A1. Change this number to change the year.
    <img src="http://i963.photobucket.com/albums/ae116/Barry_images/iWork09screen/Countw eekdaysinMonth.png" border="0" alt="Count of weekdays in month(s)">
    Conditional formatting is used to fill cells whose value is equal to 5 with a yellow background.
    Regards,
    Barry
    Edit:
    Direct address to image for use if not showing above.
    http://i963.photobucket.com/albums/ae116/Barry_images/iWork09screen/Countweekday sinMonth.png
    Message was edited by: Barry

  • Change FAX number for all vendors and customers in a massive way.

    Hello,
    I need to change the FAX number for all the vendors and custormers in Q01 so that every form should output through an specific test fax-printer. The problem is that I don't know which field I should change and how can i do it in a massive way. I have heard something about catts but i don't know almost anything.
    Could you help me?
    Thanks in advance.
    Luis Álvarez.

    Hi Luis,
    Use tcode XK99 for vendor mass change, select the Fax no field. You have to take note that this changes will be only 1 fax number for all vendors.
    Else you have to use BAPI for mass change.
    regards,
    maia

  • Need Monday and Friday  dates for 12 weeks.

    Hi All,
    I need a core java class which takes a curdate as argument and gives the oupt put as only monday and friday dates from that date for 12 weeks.
    For example..if u enter the date 07/06/2005.
    The ou put:
    07/06/2005 07/08/2005 and it should skips the sat&sunday.
    o7/11/2005 07/15/2005
    07/18 -07/22
    07/25 -07/29
    08/01 -08/05
    08/08 -08/12
    08/15 -08/19
    like this why because i need to diplay the data in the form of buckets.between these dates.Please help.

    Take a look at java.util.Calendar. It has all the methods you need to make your own class for this.

  • How to get terminate status and number of all steps executed in Teststand

    Hi ! Could someone teach me,pls?
    1. Query:
        How can i get the sequence status of Terminated?
        Aim:
        I want to Terminate  sequence execution while something wrong happened, then i want to aquire the Terminated Staus.
        My action:
        i add a ActiveX API step into a callbacks file called SequenceFilePostStepFailure , but i can't get the value well 
    2. Query:
        How can i get the number of all steps executed in Cleanup of one sequence?
        Aim:
        I  want  to get the number of all steps executed include Setup, Main and Cleanup, after i terminating the sequence
        My action:
        call a variable from RunState.NumStepsExecuted . but it only the number of steps executed from Setup or Main or Cleanup , not all.
    Thank you in advance!
    Solved!
    Go to Solution.

    AllanXu wrote:
    Hi ! Could someone teach me,pls?
    1. Query:
        How can i get the sequence status of Terminated?
        Aim:
        I want to Terminate  sequence execution while something wrong happened, then i want to aquire the Terminated Staus.
        My action:
        i add a ActiveX API step into a callbacks file called SequenceFilePostStepFailure , but i can't get the value well 
    2. Query:
        How can i get the number of all steps executed in Cleanup of one sequence?
        Aim:
        I  want  to get the number of all steps executed include Setup, Main and Cleanup, after i terminating the sequence
        My action:
        call a variable from RunState.NumStepsExecuted . but it only the number of steps executed from Setup or Main or Cleanup , not all.
    Thank you in advance!
    1. Execution.GetStates() - look at the termination status. Termination is an execution specific state, not a thread state.
    2. You could use a PostStep callback and do the counting yourself (e.g. in a file global or station global variable), however there is a performance cost to poststep callbacks so it depends on whether or not it's worth the performance cost in your particular use case.
    Hope this helps,
    -Doug

  • Apple, please fix this bug.  Sending scanned images to "Pictures" is not what I want nor what I was able to do in every previous operation system.   I want to save all scanned items in a specific folder - NOT "PICTURES"  Please fix this bug NOW!

    Apple, please fix this bug.  Sending scanned images to "Pictures" is not what I want nor what I was able to do in every previous operation system.   I want to save all scanned items in a specific folder - NOT "PICTURES"  Please fix this bug NOW!

    I only use Image Capture, so I can't speak for other software.
    Here is how I select a Scan To destination:
    If you are using the minimal details screen, you should have the same submenu to the left of the page size.

  • How to get all oneorder header_guids for a specific reference PRODUCT_ID?

    Hi,
    in servicerequest we add iobjects as reference objects.
    The iobject represents the machine a customer has an issue with.
    Within the iobject master we have a PRODUCT_ID. The product_ID represents the machine type.
    So:
    1 product_id could have 1:n iobjects (machines)
    1 servicerequest has 1:1 iobject.
    The requirement is to select all oneorder documents with a specific product_id within the assigned iobject.
    I do not realy know which database tables i have to join?
    Or is there already a function module in standard which can be used?
    Thank you
    Kind regards
    Manfred

    Hi,
    OBJECT_ID can´t be the import parameter for IOBJECTs because it is from type CRMT_OBJECT_ID - which is the ID of transactions and not IOBJECTs.
    I have played arround with this function module CRM_SERVICE_PORTAL_SEARCH but haven´t found an option to get all servicerequests (one order documents) for a specific reference object or a list of reference objects.
    Are there other ideas how to use this or another function module for my requirement.
    Thanks a lot.
    Kind regards
    Manfred

  • How to generate a report for all Analyses which conatins a specific column

    Hello Experts
    I am trying to generate a report of all Analyses which contains a specific column. We are currently using OBIEE 11.1.1.7.0.
    I have tried to use the command line options using ./runcat.sh, but did not find any arguments that can filter the analyses by a specific column used.
    Any help is much appreciated.
    Regards
    Rakesh 

    Hi Rakesh,
    SampleApp has your answer: everything is available for free, just copy/paste and run on your own instance.
    http://slc02ojw.oracle.com:7780/analytics/saw.dll?Dashboard&PortalPath=%2Fshared%2F10.%20Lifecycle%20and%20Admin%2F_port…
    (as long as this instance will be up...)
    In the dashboard named "10.31 Webcat Analysis" you have a columns to analysis report where you select the presentation column and you get all the reports using it.
    This dashboard require a script to be run on your catalog, it will parse it and extract all the column info (and many other interesting things) and load it in a database. The scripts are simple and well documented, so you can easily adapt them to your own environment.
    If you want the script there is no miracle solution: download SampleApp and extract it (it's not small, but with all the great content it has we can't complain about that ...).

  • How to schedule a job Monday thru Friday only

    How can I schedule a job Monday thru Friday only?  I tried to use a Factory Calendar but we do not have any M-F calendars setup.  If I need to create a new factory calendar, how can I create on without any holidays?
    Thanks.
    Ryan

    Hi
    see this
    Create a Variant for the Program and
    Schedule JOB in background:
    Go to SM36 create a Job
    enter Program and Variant for that program in STEP..
    click on Start Condition
    Click on DATE and TIME enter date scheduled Start and END times
    click on Period Values
    Click on HOURLY/WEEKLY etc
    CLick on RESTRICTIONS also to use further criteria.
    so your job will be scheduled and run as per your requirement.
    and in SM37 Transaction check the status of that JOB
    Check this link for scheduling jobs..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm
    Regards
    Anji

  • How to schedule a job every 10 minutes from 07 to 19 from Monday to Friday

    Hi,
    I would like to schedule a job in a way that runs every 10 minutes starting from 07 up to 19 from Monday to Friday
    How to do this?
    thanks in advance
    lk
    Oracle rdbms 10.2.0.4

    Off the top of my head :
    begin
    dbms_scheduler.create_job('OTN_JOB',
       job_action=> 'YOUR_STORED_PROCEDURE'  ,
       repeat_interval => 'FREQ=DAILY; BYHOUR=07,08,09,10,11,12,13,14,15,16,17,18,19; BYMINUTE=0,10,20,30,40,50',
       job_type=>'STORED_PROCEDURE', enabled=>TRUE);
    end;
    /Best Regards
    mseberg

  • HT4528 My friend switched from an iphone to a non apple phone. All my texts to him in groups and one on one still come up as imessages. How do I get rid of the imessage when i talk to him? I have tried deleting his number, deleting all messages he was apa

    My friend switched from an iphone to a non apple phone. All my texts to him in groups and one on one still come up as imessages. How do I get rid of the imessage when i talk to him? I have tried deleting his number, deleting all messages he was apart of

    Did you try to unregister the phone?
    Check this discussion

  • Expire all local cache entries at specific time of day

    Hi,
    We have a need for expiring all local cache entries at specific time(s) of the day (all days, like a crontab).
    Is it possible thru Coherence config ?
    Thanx,

    Hi,
    AFAIK there is no out of the box solution but certainly you can use Coherence API along with quartz to develop a simple class that can be triggered to remove all the entries from the cache at certain time. You can also define your custom cache factory configuration and an example is available here http://sites.google.com/site/miscellaneouscomponents/Home/time-service-for-oracle-coherence
    Hope this helps!
    Cheers,
    NJ

  • How do I set up a default dial-in number for all live meetings?

    How do I set up a default dial-in number for all live meetings?

    Never mind.  Found my answer.  Sometimes all you have to do is type it - then you can figure it out! 

  • Updated to iOS 5.1.1 and lost all contacts, messages, and photos specific to this iPhone.  Is there anything to retrieve the lost info?

    Updated software to iOS 5.1.1 and lost all contacts, messages, and photos specific to this iPhone.  Is there any way to retrieve the lost info?

    if you don't have a backup on iclouds or itunes that you can restore to, then all is gone.  http://support.apple.com/kb/HT1766

  • I have my brother i phone 5 but i dont have i cloud id or password i have serial number and all package the iphone can any one help me cuz i want open it please cuz my brother is dead sorry for time

    i have my brother i phone 5 but i dont have i cloud id or password i have serial number and all package the iphone can any one help me cuz i want open it please cuz my brother is dead sorry for time

    first i thank u
    but i just want apple id for his wife can remmber the password for the id he was have much more 5 apple id and i try to put them and i think u and apple can help us for we are older users of apple . them cant help us for just 1 time i have all package of phone the serial number and IMEI all of it . and thx u agine

Maybe you are looking for