Da ich nur selten mit dem OM arbeite, vergessen ich immer wieder, wie man das OM “umdreht”, wenn man eine Person ausgewählt hat. Also die Anzeige von P – S – O umkehrt auf O – S – P.
Dabei ist es total einfach! Die Org. Einheit markieren und links oben in der Toolbar auf den Dropdown Button (Springen) gehen und Besetzungsplan (Struktur) auswählen und man erhält die gewünschte Ansicht.
Category: HR
[HR] A1-Meldeverfahren
Übersicht
Gute Zusammenfassung: https://www.iprocon.de/abbildung-des-a1-meldeverfahrens-in-sap-hcm/
2682093 – Informationen zur Umsetzung des A1-Meldeverfahrens im SAP-System (siehe auch das PDF im Hinweis)
2730927 – A1-Verfahren: Hilfestellung zum Customizing
2841779 – A1-Verfahren: ESS-Szenario (Web-Dynpro ABAP) (Paket PAOC_ESS_A1_DE)
Die Datenerfassung der Antragsdaten erfolgt im Infotyp: 0700 (Elektronischer Datenaustausch)
Subtypen:
- DXA1 (A1: Antrag Entsendebescheinigung)
- DXAV (A1: Antrag Ausnahmevereinbarung)
Reports zur Erstellung der Meldungen und der Meldedateien:
- Personal → Personalabrechnung → Europa → Deutschland → Folgeaktivitäten → Periodenunabhängig → Abrechnungszusatz → A1-Meldeverfahren → Ausgangsmeldungen
Reports zur Verarbeitung der Eingangsmeldungen:
- Personal → Personalabrechnung → Europa → Deutschland → Folgeaktivitäten → Periodenunabhängig → Abrechnungszusatz → A1-Meldeverfahren → Eingangsmeldungen
Behördenkommunikation (B2A): Transaktion PB2A
- Personal → Personalabrechnung → Europa → Deutschland → Folgeaktivitäten → Periodenunabhängig → Behördenkommunikation (B2A) → B2A-Manager
Hilfreiche Entwicklungsobjekte
Paket: P01S
Reports:
Klassen:
Für mich hilfreich waren folgenden Klassen:
- CL_HRPAYDE_A1_NOTIF (Klasse für A1-Meldungen)
- CL_HRPAYDE_A1_NOTIF_DISPLAYER (ALV-Ausgabe für A1-Meldungen)
- CL_HRPAYDE_A1_ALV_EVNT_HANDLER (Ereignisbehandler für A1-spezifische Ereignisse)
PDFs der A1-Meldungen von Datenbank lesen
*&---------------------------------------------------------------------*
*& Tabellen A1-Meldeverfahren:
*& P01A1_STAT - A1-Verfahren: Verwaltungstabelle
*& P01A1_RAWDATA - A1-Verfahren: Rohdaten einer Meldung
*&---------------------------------------------------------------------*
GET peras.
SELECT * INTO TABLE @DATA(lt_p01a1_stat) FROM p01a1_stat
WHERE pernr = @pernr-pernr
AND mdtyp = '2'
AND status = '23'
AND mzbeg <= @pn-endda
AND mzbeg >= @pn-begda.
LOOP AT lt_p01a1_stat INTO DATA(ls_p01a1_stat).
SELECT SINGLE * INTO @DATA(ls_p01a1_rawdata) FROM p01a1_rawdata
WHERE guid = @ls_p01a1_stat-guid
AND lfdnr = ( SELECT MAX( lfdnr ) FROM p01a1_rawdata WHERE guid = @ls_p01a1_stat-guid ). "höchste lfdnr nehmen
DATA(pdf_xstring) = ls_p01a1_rawdata-rawdata.
ENDLOOP.
[ABAP] Read attendance/absence quotas
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 ).
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.
[HR] My Overtime Requests
Here are the notes I took while investigating SAP’s relatively ‘new’ overtime apps.
SAP Fiori for SAP Business Suite
– My Overtime Requests (Fiori 2.0)
– Approve Overtime Requests (Fiori 2.0)
SAP S/4HANA
– My Overtime Requests (Fiori 2.0)
– Approve Overtime Requests (Fiori 2.0)
SAP Fiori Apps Reference Library
– F4939
– F4937
Component:
– PA_FIO_OVT
Packages:
– PAOC_TIM_OVERTIMEQTA_REQ_CORE (Mein Mehrarbeitskontingent: Core-Funktionen)
– PAOC_TIM_OVERTIMEQTA_REQ_UIA (UIA = User Interface Adapter)
– PAOC_TM_TIMEDATE_REQ_CORE (Zeitdatenanforderung: Core-Funktionen)
– ODATA_HCMFAB_MYOVERTIMEQUOTA
– HCM_FAB_MYOVERTIMEQUOTA (contains BSP HCMFAB_OT_MAN)
– HCM_FAB_APPROVE_OVERTIME (contains BSP HCMFAB_OTQ_APR)
Reports
It is recommended to run the reports RPT_OVT_POST and RPT_OVT_EMAIL as a job.
Using RPT_OVT_UIA_TEST, you can simply simulate Overtime Requests in the backend to test your customizing.
OData
– HCMFAB_MYOVERTIMEQUOTA_SRV (service name)
– HCMFAB_MYOVERTIMEQUOTA (SEGW Project)
Workflow
– WS02400057 (PT_OVTREQ)
Cluster Tables
– PTREQ_HEADER
– PTREQ_ITEMS
– PTREQ_ACTOR
– PTREQ_NOTICE
“On Behalf of” is supported
– 2806560
Customizing
SPRO → Personnel Management → Employee Self-Service (Web Dynpro ABAP) → Service-Specific Settings → Working Time → My Overtime Requests.
Adjusting the Fiori UI
If you want to hide fields in the Fiori frontend, or you want to adjust some labels, you can simply do this via Customizing:
My Overtime Requests → Layout of the Web Application → Define Field Selection
Multi-Level Approval for Time Data Requests (HRPT_B_TMD_MULTI_APPROVERS)
The BAdI is called when opening the My Overtime Request App and a second time when clicking on the New
Button to create a new OVT request. It’s not triggered when sending the request, what I initially expected.
To reuse the code from the sample class,
* "Determine approver level
* DATA(cust_key_request_fields) = VALUE cl_hrpt_ovt_const=>ovt_cust_key_request_fields( pernr = iv_pernr
* ktart = iv_subtype
* date = is_request_period-start_date ).
* TRY.
* DATA(approval_settings) = cl_hrpt_ovt_cust_factory=>get_customizing_reader( )->get_approval_settings( REF #( cust_key_request_fields ) ).
* CATCH cx_hrpt_tmd.
* RETURN.
* ENDTRY.
* IF approval_settings-use_multiple_approver = abap_false.
* RETURN.
* ENDIF.
....
* "If no last approvers exist, use line manager, HR BP and HR Admin by default
* CALL FUNCTION 'BAPI_GET_LINE_MANAGER'
* EXPORTING
* im_objid = iv_pernr
* IMPORTING
* es_approver = line_manager
* ev_has_manager = approver_exists.
* IF approver_exists = abap_true.
* last_seqnr = last_seqnr + 1.
* line_manager-seqnr = last_seqnr.
* APPEND line_manager TO rt_approver_tab.
* IF lines( rt_approver_tab ) >= approval_settings-approver_level.
* RETURN.
* ENDIF.
* ENDIF.
you have to set the amount of approval steps in the customizing.
Custom Workflow
If you want to replace the default Workflow WS02400057 (PT_OVTREQ) with a custom one, you must adjust the customizing (as described here for the standard WF), and you’ll need to create a new BAdI Implementation for HCMFAB_MYOTQ_APPROVAL_INBOX
analog HCMFAB_MYOTQ_APPROVAL_INBOX
to get the Approve and Rejects Buttons working by providing the Workflow-ID and decision Step-ID.
Extensibility
Although it should be possible to extend both Fiori Apps via Adaptation Projects, I was unable to do so. Either it’s a problem with the new adaption editor, which got new released while writing the blog, or it is a problem with the apps itself. Whatever I tried, I was always running in issues.
Therefore, I did it the “classic” way and created an Extension Project and used the provided Extension Points. For the Approval App, I was unable to preview the application directly in BAS, perhaps because it is only an Inbox integration and does not run standalone. I therefore always had to deploy, to test my changes.
[HR] Anzeige Zeitauswertungsergebnisse (Cluster B2) – Zeitsalden kumuliert (SALDO)
PT_CLSTB2 → SALDO
DATA pernr TYPE pernr_d.
DATA saldo TYPE TABLE OF pc2b5.
CALL FUNCTION 'HR_TIME_RESULTS_GET'
EXPORTING
get_pernr = pernr
get_pabrj = CONV pabrj( sy-datum(4) )
get_pabrp = CONV pabrp( sy-datum(6) )
TABLES
get_saldo = saldo
EXCEPTIONS
no_period_specified = 1
wrong_cluster_version = 2
no_read_authority = 3
cluster_archived = 4
technical_error = 5
OTHERS = 6.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
[ABAP] Read work schedule
DATA(work_schedule) = cl_hcmfab_employee_api=>get_instance( )->get_work_schedule( iv_pernr = 1
iv_begda = sy-datum
iv_endda = sy-datum ).
cl_demo_output=>display_data( work_schedule ).
[ABAP] Read personnel area with text
DATA p0001 TYPE p0001.
cl_hcmfab_utilities=>read_infotype_record( EXPORTING iv_pernr = pernr
iv_infty = '0001'
IMPORTING es_pnnnn = p0001 ).
DATA(personnel_area_id) = p0001-werks.
DATA(personnel_area_text) = cl_hr_t500p=>read( p0001-werks )-name1.
Or using the class CL_HCMFAB_EMPLOYEE_API.
DATA(lv_employee_details) = cl_hcmfab_employee_api=>get_instance( )->get_employee_details( iv_pernr = pernr
iv_application_id = if_hcmfab_constants=>gc_application_id-mypersonaldata ).
DATA(personnel_area_id) = lv_employee_details-personnel_area_id.
DATA(personnel_area_text) = lv_employee_details-personnel_area_text.
[HR] TMW – Time-Manager-Workplace BAdI
Transaktion: PTMW
BAdI: PT_BLP_USER
Badi Implementierung anlegen und Filter-Ausprägungen hinzufügen. Es muss für jede benötigte Filter-Ausprägung eine eigene BAdI Implementierung und Klasse angelegt werden.
Klasse anlegen und in der Interface Methode die Kundenlogik, wie in der Dokumentation empfohlen, in eine private Methode kapseln.
Bsp.:
METHOD if_ex_pt_blp_user~process_data.
CHECK i_record IS BOUND.
IF i_record->data->category = cl_pt_tmw_tdm_const=>cat_infty
AND i_record->data->type = '2001'.
"hier die erforderliche Logik rein, z.B. weitere Prüfungen
process_it2001( EXPORTING i_record = i_record " Aktueller Satz
i_time_data = i_time_data " Aktuelle Zeitdaten
IMPORTING e_messages = e_messages " Ausgabemeldungen für die Transaktion
e_time_data = e_time_data ). " Neue und geänderte Daten
"An den konkreten Infotypsatz kommt man z.B. folgendermaßen:
DATA(record_data) = CAST cl_pt_td_it2001( i_record->data ).
DATA(p2001) = record_data->if_pt_td_it2001~p2001.
ENDIF.
ENDMETHOD.
[ABAP] Fulltime employee?
DATA(l_full_time) = NEW cl_im_hrpbsusad01( )->if_ex_hrpbsusad01~check_employee_full_time( pernr = l_pernr
begda = l_begda
endda = l_endda ).
[ABAP] OM – Lese Personen auf und unterhalb einer OE
Auswertungsweg O-O-S-P liefert unter einer gegebenen Org. Einheit alle Personen, auch aus tieferen OE.
T-Code: OOAW
DATA(lt_actor) = VALUE tswhactor( ).
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = 'O'
act_objid = lv_oe " die Org. Einheit, von der gestartet werden soll
act_wegid = 'O-O-S-P'
act_plvar = '01'
act_begda = sy-datum
act_endda = sy-datum
act_tflag = space
act_vflag = space
authority_check = space
TABLES
result_tab = lt_actor
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
" do error handling
ENDIF.
" Nur Pernr's relevant
DELETE lt_actor WHERE otype <> 'P'.
" Doppelte Pernr's entfernen
DELETE ADJACENT DUPLICATES FROM lt_actor.
Zum Testen des Auswertungsweges kann man den Report RHSTRU00 verwenden. Einfach Planvariante, Objekttyp und eine ObjektId einer Org. Einheit eingeben, sowie den Auswertungsweg und Statusvektor 1 (aktiv).