Skip to Content

Get workday

Hello there,

I'm trying to find out a function that returns the first workday of a month. Does anyone know how to do it?

I've found function 'BKK_GET_NEXT_WORKDAY' but I don't know were to find the information to fill field I_CALENDAR1.

I would apreciate any information!

Regards,

Flavia

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Apr 13, 2006 at 06:41 PM

    You can do something like this.

    
    report zrich_0001.
    
    data: wdind(1) type c.
    parameters: p_datum type sy-datum default '20060401'.
    
    start-of-selection.
    
      do.
    
        call function 'DATE_CONVERT_TO_FACTORYDATE'
             exporting
                  date                 = p_datum
                  factory_calendar_id  = 'P6'  " use a valid fact cal
             importing
                  workingday_indicator = wdind
             exceptions
                  others               = 7.
    
        if wdind = space.
          write:/ 'First Working Day of Month is:',  p_datum.
          exit.
        endif.
    
        p_datum = p_datum + 1.
    
      enddo.
    
    

    Regards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 13, 2006 at 06:56 PM

    Rich,

    Thanks for your help!

    I think that your example is not working, the condition "if wdind = space" seems always to be true, even to dates like 20061225.

    Regards,

    Flavia

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17, 2006 at 11:28 AM

    You were all right. I was using a wrong Calendar code.

    Regards,

    Flavia

    Add comment
    10|10000 characters needed characters exceeded