Summary: This may be one of the most discussed topics in SDN. Many a times we have to code to get the number of work days using the Variable processing type Customer Exit. But Replacement path processing type is the simplest way to avoid Exit. This document has 2 parts one, get the Number of Workdays value in to the attribute 0NUMWDAY of the Info Object 0CALMONTH. The second part talks about using the Variable with processing type Replacement path to get the values in the Bex. 0NUMWDAY is an attribute of 0CALMONTH, if it’s not, it can be installed from the business content.
Not only 0CALMONTH but other time characteristics 0CALWEEK, 0CALMONTH, 0CALQUARTER, 0CALYEAR, 0FISCPER and 0FISCYEAR contain the new attributes "Number of days" (0NUMDAY) and "Number of workdays" (0NUMWDAY) of the type "Key figure". These need not be loaded with data but obtain value from Master Data access Class - CL_RSMD_RS_0CALMONTH, included in the master data tab of the Info Object maintenance & along with the Work Calendar ID.
The key figure attribute to be populated with value, you will have to maintain the Factory/Work calendar data in transaction RSRHIERARCHYVIRT.
And this setting will be valid across the system & is not available against any variable selection of the factory calendar ID in query.
Also Value for 0NUMWDAY is calculated only for the period in which the default Work calendar is valid. This can be seen in Transaction SCAL.
That’s it the display attribute 0NUMWDAYS should be able to display values in the BEx. Also next it can be used in formula variables for calculations in the BEx Formulas & CKFs.
Once you get the value in the attribute next you can use it in any calculations in formula or the CKFs in the in the BEx. You will have to create formula variable using this. For this you will have to create a formula variable with processing type Replacement path & reference characteristic 0CALMONTH. For the replacement rule -> replace variable with Info Object -> replace with attribute value. Now select the attribute of 0CALMONTH 0NUMWDAYS as attribute value. You select from value for interval & no need of any offset.
This formula variable thus created can be used for any division, multiplication, etc as can be seen as below.