Get Previous N Working days

Sample program which will provide you with previous n working days. Any calender id can be specified in the “calid”, you can check the list of configured calendars in the tcode SCAL.

DATA: days TYPE i.
DATA: calid LIKE tfacd-ident value 'Z1'.
DATA: newdate LIKE sy-datum.

days = -5.

CALL FUNCTION 'BKK_ADD_WORKINGDAY'
EXPORTING
i_date = sy-datum
i_days = days
i_calendar1 = calid
IMPORTING
e_date = newdate.

No comments:

Post a Comment