
I wish S/4HANA ABAP CDS views supported date-to-factory-date conversion using an out-of-the-box built-in function, similar to currency or unit conversion. Unfortunately, that’s not the case. But don’t worry—I’ve got you covered with a custom-built S/4HANA ABAP CDS view.
S/4HANA provides DATE_CONVERT_TO_FACTORYDATE standard function module for date-to-factory-date conversion. Base on factory, for example, CA Canada:
The function module converts date to closest next factory date (default "+" conversion option):
or closest prior factory date ("-" conversion option):
The same date-to-factory-date conversion can be achieved using custom-built ABAP CDS view
All it takes a simple custom built ABAP CDS view
Above code does a trick transforming pivoted and nested factory calendar data
into factory calendar on date level
followed by a couple of window functions to find next and previous factory date for first / last week-end or holiday date
and copy it over to other week-end / holiday dates as well fill next factory date / previous factory date for weekdays.
Source code for the CDS view can be downloaded below:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
2 |