ESS – 2020 W-4 Filing Status Drop-Down FIX
For many SAP customers in the United States, preparing for the 2020 changes to the W-4 (Employee’s Withholding Certificate) has been quite an “undertaking” to say the least. For 2020, the IRS made quite a lot of big changes to how the information is gathered, what is filed and what a company must do (under the threat of big fines if not being in compliance). The IRS had not finalized and made “official” most of the information until nearly the end of 2019 (with some pieces still not “official”). With that, SAP was put in a very unenviable spot….how to provide 2020 changes as “standard” updates and keep their customers happy while at the same time trying to develop notes/patches/updates against requirements that were still a moving, incomplete target from the IRS. I will skip to the end and tell you…..it has not gone well (haha). I will also direct you now to TWO blogs that have been everyone’s “go to” for updated (almost daily!) information on the 2020 W-4. The “comments” section in both have been a wealth of information exchange among customers.
I will not rehash what you can find in those blogs and comments. The purpose of this blog is to address one very special scenario that I had to solve for a client (and have read others going through). Hopefully, it will help others who may need a similar/same “quick” solution.
The 2020 W-4 has new/additional “filing status” options for federal (FED) filing. These are in the table T5UTK (Marital Status).
As seen, the first two options no longer apply to the 2020 (or onward) W-4. My client did not want these “old” options to display to the employee in ESS for a “new” 2020 record because of the likely chance of them picking the option inadvertently. It would be easy enough to simply change their end dates to 12/31/2019 to make them no longer display for any W-4 (infotype 0210) record created after 12/31/2019. The problem though is that the IRS has not yet published finalized information for the W-4 P (Withholding Certificate for Pension or Annuity Payments), so for the time begin, those “old” options are still also valid options. Therefore, we can not make a table “configuration” change as it would impact not only the W-4 but also W-4P records.
Thankfully for ESS for the ABAP Webdynpro , there is a standard ABAP class CL_HRESS_AS_W4_US with a method called FILING_STATUS_VALUES that does all the work of populating the drop-down on the form with the possible filing status options. (not sure if the Java version calls the same class, but I would hope/think so)
The easiest “fix” was to create an “overwrite” enhancement of that method. This would allow us to very easily remove the enhancement once the IRS finalized the W-4P which will hopefully use the same filing status options as the W-4 (but then, this is the IRS we are talking about and that would make too much sense. haha).
I will not step through creating an overwrite enhancement as that is covered well elsewhere and any junior ABAPper or higher should already know how to do this. Here is the code that was put in place:
METHOD IOW_ZENH_W4_2020_FIX~FILING_STATUS_VALUES. *"------------------------------------------------------------------------* *" Declaration of Overwrite-method, do not insert any comments here please! *" *"methods FILING_STATUS_VALUES *" importing *" !IV_TAURT type HCMT_BSP_PA_US_R0210-TAURT *" !IV_DROP type ref to IF_WD_CONTEXT_NODE_INFO *" !IV_BEGDA type BEGDA *" !IV_ENDDA type ENDDA *" changing *" !CT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST . *"------------------------------------------------------------------------* DATA: lt_t5utk TYPE STANDARD TABLE OF t5utk, ls_t5utk LIKE LINE OF lt_t5utk, l_value TYPE wdr_context_attr_value. SELECT * FROM t5utk INTO TABLE lt_t5utk WHERE taxau = iv_taurt AND begda LE iv_begda AND endda GE iv_endda. IF sy-subrc = 0. LOOP AT lt_t5utk INTO ls_t5utk. "ENHANCEMENT - if date is in 2020 or greater for FEDeral withholding, do not show option 01 or 02 for marital status. IF iv_taurt = 'FED' AND iv_begda > '20191231' AND ( ls_t5utk-txsta = '01' OR ls_t5utk-txsta = '02' ). CONTINUE. ENDIF. l_value-value = ls_t5utk-txsta. l_value-text = ls_t5utk-ltext. INSERT l_value into table ct_valueset. ENDLOOP. ENDIF. * Populate result to dropdown. If no result, leave it empty iv_drop->set_attribute_value_set( name = 'TXSTA' value_set = ct_valueset ). ENDMETHOD.
With the enhancement in place and active, the only options shown to the employee when creating a “new” 2020 W-4 record are those allowed for the updated form.
Hope this helps!