Get Previous N Working days

0
ABAP Structure

Sample program which will provide you with previous n working days. Any calendar id can be specified in the “called”, 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: