Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[ABAP] Read attendance/absence quotas

When searching for a way to select quotas without doing a manual select, I found the following class is the Fiori odata packages.

DATA pernr TYPE pernr_d VALUE 1.

DATA(time_accounts) = cl_hcmfab_att_abs_bl_apis=>get_instance( )->read_time_accounts( iv_pernr = pernr
                                                                                      iv_begda = sy-datum
                                                                                      iv_endda = sy-datum ). "iv_endda is never used!

cl_demo_output=>display( time_accounts ).

But although there is an obligatory iv_endda parameter, it is never used inside of method read_time_accounts. Instead, there is some logic which checks for a T77S0 Parameter, and it will use either highdate or begda as endda value.

IMO, it would have made sense to mark iv_endda as optional, so it would be downward compatible and the parameter could be omitted on newer releases. Now it is a bit misleading.

However, if you look inside the method read_time_accounts you’ll find another class that is used to read the quotas. The names of the result fields are slightly different, but at least the endda is used in this case.

  cl_pt_arq_timeaccounts=>get_instance( )->get_time_accounts( EXPORTING im_pernr        = pernr
                                                                        im_begda        = sy-datum
                                                                        im_endda        = sy-datum
                                                              IMPORTING ex_timeaccounts = DATA(time_accounts) ).

Leave a Reply

Your email address will not be published. Required fields are marked *