Skip to Content
avatar image
Former Member

FM to get the 3rd working day of a month

Hi,

i have the factory calender id. i have the current date. i need to get the 3rd working day of the next month.Send me the Function module name

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Sep 01, 2008 at 01:00 PM

    refer:

    How can i find the first working day of the month?

    in your case it would include some code also.no appropriate fm in SAP as per your requirement.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 01:15 PM

    Using FM CALCULATE_DATE

    you can add the month and the days into the current date u have.

    Then use FM DATE_CONVERT_TO_FACTORYDATE

    to get the factory date for the date fetched from the above FM.

    Hope this helps!

    Regards,

    Prashant

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      you can find the holidays using the FM : HOLIDAY_GET based on the country...

      Once you get the above data...use the FM: CALCULATE_DATE to see if the date does not exist in the above result from holiday_get

      Regards

      SK

  • avatar image
    Former Member
    Sep 01, 2008 at 01:46 PM

    Hi,

    Check this sample code,

    DATA:
    w_date   TYPE dats,
    w_date1  LIKE scal-date,               " dats
    w_date2  LIKE scal-date,
    i_factid LIKE tkevs-fcalid VALUE 'IN', " IN for India
    it_dats  TYPE TABLE OF rke_dat,
    wa_dats  LIKE LINE OF it_dats,
    w_lines  TYPE i.
    
    CALL FUNCTION 'CALCULATE_DATE'
      EXPORTING
        days        = '0'
        months      = '1'
        start_date  = sy-datum
      IMPORTING
        result_date = w_date.
        
    w_date+6(2) = '01'.                               
    w_date1 = w_date.
    w_date2 = w_date + 6.
    
    CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
      EXPORTING
        i_datab  = w_date1
        i_datbi  = w_date2
        i_factid = i_factid
      TABLES
        eth_dats = it_dats.
    
    READ TABLE it_dats INDEX 3 INTO wa_dats.
    WRITE :
      / wa_dats-periodat.             " third working date

    Regards

    Adil

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 01:04 PM

    Hi

    Go through the link given below :

    working-days-malarki

    second-working-day-of-a-month

    With Regards

    Nikunj shah

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 11:08 AM

    Thanks a lot all of , fm BKK_GET_NEXT_WORKDAY solved my purpose

    Add comment
    10|10000 characters needed characters exceeded