representation in the Workplace SBWP maintain
The table HRUS_D2 be Representations of User stored - unfortunately there is no care to view, and therefore an administrator can only detect that the user of the information provisioning on vacation and his representation has deposited active!
With this simple report you can define the representative as an administrator - in some cases this is very very helpful (especially when illness of a user, etc.)
*&-------------- -------------------------------------------------- -----*
* & Report Z_ACTIVATE_SUBSTITUTE
* &
*&------------------------------------ ---------------------------------*
* & * & Workflow Verterter active driver
* & - -------------------------------------------------- ------------------*
REPORT Z_ACTIVATE_SUBSTITUTE.
PARAMETERS:
P_usern1 TYPE usr02-bname obligatory,
P_vertr Type usr02-bname obligatory,
P_begdt type BEGDA obligatory default sy-datum,
P_enddt TYPE EVEN obligatory,
P_prof TYPE T77RP-REPPR DEFAULT 'ALL' obligatory,
p_active like hrus_d2-active.
PARAMETERS:
p_insert radiobutton group g1,
p_delete radiobutton group g1.
constants: c_true value 'X',
c_false value space.
data: gs_hrus_d2 like hrus_d2,
gflg_error.
START-OF-SELECTION.
perform check_data changing gflg_error.
if gflg_error = c_false.
clear gs_hrus_d2.
gs_hrus_d2-us_name = p_usern1.
gs_hrus_d2-rep_name = p_vertr.
gs_hrus_d2-begda = P_begdt.
gs_hrus_d2-endda = P_enddt.
gs_hrus_d2-active = p_active.
gs_hrus_d2-REPPR = p_prof.
case c_true.
when p_insert.
insert into hrus_d2 values gs_hrus_d2.
if sy-subrc = 0
write: 'representatives successfully created.' (S01).
else.
write: 'Error on insert!' (E01).
endif.
p_delete when.
delete from where hrus_d2 us_name = p_usern1
and rep_name = p_vertr.
if sy-subrc = 0
write: / 'representation deleted successfully.' (S02).
else.
write: / 'Error in the Representation delete!' (E02).
endif.
endcase.
endif.
FORM check_data changing oflg_error.
data: ld_uname like sy-uname,
ld_datdiff type i. clear
oflg_error.
format color col_negative.
if p_enddt < p_begdt.
write: / 'End date must be greater start date'.
oflg_error = c_true.
endif.
single select bname from USR02 into ld_uname
where bname = p_usern1.
if sy-subrc ne 0
write: / 'user', p_usern1, 'No'.
oflg_error = c_true.
endif.
single select bname from USR02 into ld_Uname
where bname = p_vertr.
if sy-subrc ne 0
write: / 'user', p_vertr, 'No'.
oflg_error = c_true.
endif.
format color col_normal.
ENDFORM.
"WRITE: P_usern2, 'has been as a substitute for', P_usern1, 'of', P_begdt, 'to', P_enddt, 'running'. ULINE.
"WRITE: 'profile'., P_prof
" ULINE.
0 comments:
Post a Comment