on 08-25-2023 9:03 AM
Hi,
I am trying to implement the HR Fiori My Reporting 2.0 tile but I seem to missing something. I implemented BADI HCMFAB_B_MYREPORTING, creating a custom class ZCL_HCMFAB_FB_MYREPORTING used the base class CL_HCMFAB_FB_MYREPORTING for a code reference.
I tried to link a small custom report that I wrote for testing purposes to the tile via ZCL_HCMFAB_FB_MYREPORTING-IF_HCMFAB_MYREPORTING->GET_REPORT_DEFINITION. The link displays correctly on My Reporting:
However, when I click on my new custom link, it just opens a page where you can select the period or selection views, but there is no execute option?
I cannot get it to trigger ZCL_HCMFAB_FB_MYREPORTING-IF_HCMFAB_MYREPORTING->GET_CUSTOM_REPORT_DATA. I tried the out of box examples that comes with SAP_EXAMPLES that should trigger SAP Standard like the Absence Quota's report but it does the same. The report does not seem to be triggered.
What am i missing? Should there be an action configured on the tile? I cannot find any documentation execpt the standard Fiori documentation that just tells you to implement the BADI.
Any help would be appreciated!
Kind Regards
Deon
stupid question but did you define it as a custom report?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andy,
Yes I did :). ZCL_HCMFAB_FB_MYREPORTING-IF_HCMFAB_MYREPORTING->GET_CUSTOM_REPORT_DATA also does not trigger for the SAP Example reports like RPTABS20 which is also defined as a custom report.
When should it execute? Should the not be an execute button or something on the Fiori screen?
Kind Regards
Deon
Hello,
The report is executed automatically. There is no execute button no.
I have something like this:
IF_HCMFAB_MYREPORTING~GET_REPORT_DEFINITION
WHEN 'HIRINGS'.
es_report_definition-type = if_hcmfab_myreporting=>gc_report_type-custom.
es_report_definition-title = TEXT-001.
es_report_definition-description = TEXT-002.
es_report_definition-target_otype = 'P'.
You need to implement IF_HCMFAB_MYREPORTING~GET_CUSTOM_SELECTION_OBJECTS and IF_HCMFAB_MYREPORTING~GET_CUSTOM_REPORT_DATA too.
Hi Andy,
Thanks for your comment. Ok, it is good to know that it executes automatically! At least I am not missing a configuration on the app itself then. My code are as follow:
IF_HCMFAB_MYREPORTING~GET_REPORT_DEFINITION
WHEN 'ZDVZ03'.
es_report_definition-type = if_hcmfab_myreporting=>gc_report_type-custom.
es_report_definition-title = 'Deon Custom'(013).
es_report_definition-description = TEXT-T01.
es_report_definition-target_otype = 'P'.
es_report_definition-param1 = 'ZDVZ03'.
IF_HCMFAB_MYREPORTING~GET_CUSTOM_SELECTION_OBJECTS. I don't have anything here? The sample class it looks like they handle only OM objects? How would I handle a PNP Logical Database selection screen?
IF_HCMFAB_MYREPORTING~GET_CUSTOM_REPORT_DATA (I cannot get this to trigger)
WHEN 'ZDVZ03'.
CALL METHOD me->get_custom_report_data
EXPORTING
iv_employee_assignment = iv_employee_assignment
iv_report_id = iv_report_id
iv_begda = iv_begda
iv_endda = iv_endda
it_selection_objects = it_selection_objects
IMPORTING
et_column_definition = et_column_definition
et_field_data = et_field_data
ev_number_of_records = ev_number_of_records
et_messages = et_messages.
I have this, I would implement it and see if it's called.
METHOD if_hcmfab_myreporting~get_custom_selection_objects.
* This method can be used to provide selection objects (list or hierarchy)
* for view ids of type IF_HCMFAB_CONSTANTS=>GC_VIEWTYPE-CUSTOM
* In case of hierarchies attribute PUP (ET_OBJECTS) containes the object key (OBJECT_KEY)
* of the parent node whereas attribute DFLAG indicates that an object has subordinates
* which are not supplied with the current list of objects, i.e. the system renders an
* expand icon in front of the node and method EXPAND_CUSTOM_SEL_OBEJCT will be called on click.
DATA:
lt_result_objects TYPE STANDARD TABLE OF objec,
ls_result_object TYPE objec,
ls_selection_object TYPE hcmfab_s_rep_selection_object,
lo_person_info_reader TYPE REF TO if_hrcce_person_info_reader,
lt_pernrs TYPE pccet_pernr,
lv_pernr LIKE LINE OF lt_pernrs.
CASE iv_view_id.
WHEN 'MYSELF'.
CALL METHOD cl_hrcce_person_info_reader=>get_instance
IMPORTING
person_info_reader = lo_person_info_reader.
* Get all personnel numbers assigned to you
lt_pernrs = go_employee_api->get_assignments( iv_employee_assignment ).
LOOP AT lt_pernrs INTO lv_pernr.
ls_selection_object-view_type = iv_view_type.
ls_selection_object-view_id = iv_view_id.
ls_selection_object-employee_assignment = iv_employee_assignment.
ls_selection_object-otype = 'P'.
ls_selection_object-sobid = lv_pernr.
ls_selection_object-stext = lo_person_info_reader->read_pernr_text(
pernr = lv_pernr
begda = sy-datlo ).
ls_selection_object-short = ls_selection_object-stext.
ls_selection_object-object_key = lv_pernr.
APPEND ls_selection_object TO et_objects.
ENDLOOP.
WHEN 'MY_ORGUNIT'.
* Read the directly subordinated orgunits
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'P'
act_objid = iv_employee_assignment
act_plvar = '01'
act_wegid = 'SAP_MANG'
act_begda = sy-datlo
act_endda = sy-datlo
act_tdepth = 0
TABLES
result_objec = lt_result_objects
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
RETURN.
ENDIF.
LOOP AT lt_result_objects INTO ls_result_object WHERE otype = 'O'.
ls_selection_object-view_type = iv_view_type.
ls_selection_object-view_id = iv_view_id.
ls_selection_object-employee_assignment = iv_employee_assignment.
ls_selection_object-otype = ls_result_object-otype.
ls_selection_object-sobid = ls_result_object-objid.
ls_selection_object-stext = ls_result_object-stext.
ls_selection_object-short = ls_result_object-short.
ls_selection_object-object_key = ls_result_object-objid.
APPEND ls_selection_object TO et_objects.
ENDLOOP.
ENDCASE.
ENDMETHOD.
A Stupid question from my side then 😄 what is the direct reports view? How do I see if its in the system?
I added the following but cannot get any breakpoint to trigger here either?
"/--- Internal Tables ---/"
DATA: lt_result_objects TYPE STANDARD TABLE OF objec,
lt_pernrs TYPE pccet_pernr.
"/--- Structures ---/"
DATA: ls_result_object TYPE objec,
ls_selection_object TYPE hcmfab_s_rep_selection_object.
"/--- Object References ---/"
DATA: lo_person_info_reader TYPE REF TO if_hrcce_person_info_reader.
CASE iv_view_id.
WHEN 'ZDVZ03'.
CALL METHOD cl_hrcce_person_info_reader=>get_instance
IMPORTING
person_info_reader = lo_person_info_reader.
* Get all personnel numbers assigned to you
lt_pernrs = go_employee_api->get_assignments( iv_employee_assignment ).
LOOP AT lt_pernrs ASSIGNING FIELD-SYMBOL(<ls_pernrs>).
ls_selection_object-view_type = iv_view_type.
ls_selection_object-view_id = iv_view_id.
ls_selection_object-employee_assignment = iv_employee_assignment.
ls_selection_object-otype = 'P'.
ls_selection_object-sobid = <ls_pernrs>.
ls_selection_object-stext = lo_person_info_reader->read_pernr_text(
pernr = <ls_pernrs>
begda = sy-datlo ).
ls_selection_object-short = ls_selection_object-stext.
ls_selection_object-object_key = <ls_pernrs>.
APPEND ls_selection_object TO et_objects.
ENDLOOP.
WHEN 'MY_ORGUNIT'.
* read the directly subordinated orgunits
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'P'
act_objid = iv_employee_assignment
act_plvar = '01'
act_wegid = 'SAP_MANG'
act_begda = sy-datlo
act_endda = sy-datlo
act_tdepth = 0
TABLES
result_objec = lt_result_objects
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
RETURN.
ENDIF.
LOOP AT lt_result_objects INTO ls_result_object WHERE otype = 'O'.
ls_selection_object-view_type = iv_view_type.
ls_selection_object-view_id = iv_view_id.
ls_selection_object-employee_assignment = iv_employee_assignment.
ls_selection_object-otype = ls_result_object-otype.
ls_selection_object-sobid = ls_result_object-objid.
ls_selection_object-stext = ls_result_object-stext.
ls_selection_object-short = ls_result_object-short.
ls_selection_object-object_key = ls_result_object-objid.
APPEND ls_selection_object TO et_objects.
ENDLOOP.
ENDCASE.
I am not certain of that. I would try with a manager (or make your linked employee manager with N - 1's below him
Hi Andy,
Interesting. That seems to have worked! I linked my user to an Employee that has N - 1 with a B012 relationship, and now the code triggers and the report executes 🙂 Thanks! So somewhere it does a check if there is subordinates and only then executes the rest of the code.
Thanks for the help!
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.