Add n number of working days to dateThe following ABAP code adds/Subtracts n number of months from a particular date. This is a very simple
processusing the 'MONTH_PLUS_DETERMINE' function module. If this function module does not exist please
see the more cumbersome solution using SAP FM CALCULATE_DATE.
*&------------------------------------------------*
*& Form CALCULATE_DATE
*&-------------------------------------------------*
* Add/Subtract n number of months from a date
*--------------------------------------------------*
* --> p_months Number of months to add/subtract
* <-- p_date Start date and result date
*--------------------------------------------------*
FORM calculate_date USING p_months
CHANGING p_date.
DATA: ld_datestor TYPE sy-datum.
ld_datestor = p_date.
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
MONTHS = p_months
OLDDATE = p_date
IMPORTING
NEWDATE = p_date.
ENDFORM. " CALCULATE_DATE
|
||||||||