Skip to Content
0
Feb 05, 2021 at 09:25 AM

Beschäftigungsverbot in HCM infoty 2001 subtyp 0511

79 Views

Hallo ich habe eine frage

Ich möchte für einer Mitarbeiter die beschäftugungsverbot (0511) einer Mitarbeiter nicht mehr als Abwesenheitzeit zählen. Bitte wie kann ich das implemnetieren . Ich habe erstmal versucht zu löschen . aber die Periode wurde nicht geändert.

REPORT zlob_mindestzeit LINE-SIZE 132 LINE-COUNT 65.
*
TABLES: pernr,
pcl1, pcl2,
teven,
t554t,
t001p,
pa2001,
pa0521.
*
INFOTYPES: 0000,
0001,
0002,
0008,
0080,
2001 MODE N,
0521.
*
TYPES: BEGIN OF abart, " Detail-Liste
pernr LIKE pernr-pernr,
ename LIKE p0001-ename,
infty LIKE p2001-infty,
subty LIKE p2001-subty,
atext LIKE t554t-atext,
begda LIKE p2001-begda,
endda LIKE p2001-endda,
tage(5) TYPE p DECIMALS 2,
END OF abart.
*
DATA: abart TYPE TABLE OF abart WITH HEADER LINE.
*
TYPES: BEGIN OF ausgabe,
pernr LIKE pernr-pernr,
ename LIKE p0001-ename,
tage(5) TYPE p DECIMALS 2,
atext(35) TYPE c,
btext LIKE t001p-btext,
kostl LIKE p0001-kostl,
trfgr LIKE p0008-trfgr,
bsgrd LIKE p0008-bsgrd,
period(2) TYPE n,
result(4) TYPE c,
END OF ausgabe.

FORM abwesenheiten.

rp-read-all-time-ity zbegda zendda.


LOOP AT p2001 WHERE awart IN awart_s .






* delete p2001 WHERE not subty = '0600'. " klappt nicht da die periode bleiben unverändert


IF p2001-begda LE zbegda. " Höchstens ab ZBEGDA zählen
p2001-begda = zbegda.
ENDIF.
IF p2001-endda GE zendda. " Höchstens bis ZBEGDA zählen
p2001-endda = zendda.
ENDIF.

IF p2001-endda GE p2001-begda.
tage_abwes = p2001-endda - p2001-begda + 1.
abart-tage = tage_abwes.
tage = tage - tage_abwes.

SELECT SINGLE atext FROM t554t INTO abart-atext
WHERE sprsl = 'D'
AND moabw = '01'
AND awart = p2001-awart.

MOVE pernr-pernr TO abart-pernr.
MOVE p0001-ename TO abart-ename.
MOVE p2001-infty TO abart-infty.
MOVE p2001-subty TO abart-subty.
MOVE p2001-begda TO abart-begda.
MOVE p2001-endda TO abart-endda.
APPEND abart. CLEAR abart.
* zbegda = p0001-begda . "
* zbegda = p2001-endda . "
**



ENDIF.

*
ENDLOOP.

*
ENDFORM. "Abwesenheiten*

FORM perioden.
*
rp-init-buffer.
REFRESH: rgdir, evp, ztab.
CLEAR: zperiod, rgdir, evp, ztab.
jahr = zbegda(4).
jahr = jahr - 1.
CONCATENATE jahr '12' INTO zperiod.
*
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
persnr = pernr-pernr
IMPORTING
molga = country
TABLES
in_rgdir = rgdir
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
*
IF sy-subrc EQ 0.
LOOP AT rgdir WHERE srtza EQ 'A'
AND ( abkrs EQ 'D2' OR abkrs EQ 'DK' )
AND fpper GE zbegda(6)
AND fpper LE zendda(6).
MOVE-CORRESPONDING rgdir TO evp.
UNPACK rgdir-seqnr TO evp-seqnr.
evp-paper = rgdir-fpper.
evp-begda = rgdir-fpbeg.
evp-endda = rgdir-fpend.
evp-iabkr = rgdir-iabkrs.
evp-iaper = rgdir-inper.
evp-iendd = rgdir-ipend.
APPEND evp.
ENDLOOP.
*
DESCRIBE TABLE evp LINES filled_lines.
IF filled_lines GT 0.
LOOP AT evp.
PERFORM rx_import IN PROGRAM rpclgad0
TABLES rt
crt
wpbp
USING versc "XFEALRK048731
pernr-pernr
evp-seqnr
return.

IF return EQ 0.
PERFORM loop_rt.
ENDIF.
ENDLOOP.
*
SORT ztab BY period.
LOOP AT ztab.
IF zperiod LT ztab-period.
ausgabe-period = ausgabe-period + 1.
ENDIF.
zperiod = ztab-period.
ENDLOOP.
ENDIF.
*
ENDIF.
*
ENDFORM. "PERIODEN