Function to return next business
day
A function that will return next business day, based on
the country.
This function will allow users to specify e.g. 10 business
days from now.
Here is the code.
Code:
REPORT ZRM_TEST
.
PARAMETERS: DATE_1 LIKE SY-DATUM DEFAULT SY-DATUM,
BIZ_DAYS TYPE I DEFAULT 2,
FACCALID LIKE SCAL-FCALID DEFAULT 'US'.
DATA: FAC_DATE_1 LIKE
SCAL-FACDATE,
DATE_2 LIKE SY-DATUM,
FAC_DATE_2 LIKE SCAL-FACDATE.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
DATE
= DATE_1
FACTORY_CALENDAR_ID
= FACCALID
IMPORTING
FACTORYDATE
= FAC_DATE_1 .
FAC_DATE_2 = ABS( FAC_DATE_1 + BIZ_DAYS ).
CALL FUNCTION 'FACTORYDATE_CONVERT_TO_DATE'
EXPORTING
factorydate
= FAC_DATE_2
factory_calendar_id
= FACCALID
IMPORTING
DATE
= DATE_2
.
WRITE: / DATE_2.
You can also try the function module DAY_ATTRIBUTES_GET.
You need to provide the calendar and a time interval,
and the fm returns an internal table showing days with flags holiday /
working day.
Questions
Do you have
a ABAP Question?
Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
All product names are trademarks of their respective
companies. The site www.erpgreat.com is in no way affiliated with
SAP AG.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
The content on this site may not be reproduced
or redistributed without the express written permission of
www.erpgreat.com or the content authors.
|