Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

replied

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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question