Code: Alles auswählen.
DATA: wa_tab TYPE REF TO data.
FIELD-SYMBOLS: <tab_entry> TYPE any.
CREATE wa_tab TYPE (tabelle).
ASSIGN wa_tab->* TO <tab_entry>
Code: Alles auswählen.
ASSIGN COMPONENT 'MANDT' OF STRUCTURE wa_tab TO FIELD-SYMBOL(<client>).
<client> = ...
Code: Alles auswählen.
***********************************************************************
08/2011*
***********************************************************************
*
REPORT zabgrenz NO STANDARD PAGE HEADING LINE-SIZE 80.
*
TABLES: pernr, pspar, pskey, asshr, assob_hr, assob, pdsnr,
t582a, t777d.
*
*TABLES: PA0001, PA0002, PA0004, PA0005, PA0006, PA0007, PA0008,
* PA0009, PA0010, PA0011, PA0012, PA0013, PA0014, PA0015,
* PA0016, PA0017, PA0019, PA0020, PA0021, PA0022, PA0023,
* PA0029, PA0032, PA0041, PA0045, PA0050, PA0051, PA0057,
* PA0078, PA0079, PA0080, PA0081, PA0083, PA0111, PA0112,
* PA0113, PA0114, PA0115, PA0116, PA0117, PA0118, PA0119,
* PA0232, PA0265, PA0271, PA0322, PA0326, PA0341, PA0406,
* PA2001, PA2007, PA2010, PA2012, PA0027.
*
INFOTYPES: 0001, 0002.
*
DATA: BEGIN OF z0118 OCCURS 0.
INCLUDE STRUCTURE pa0118.
DATA: END OF z0118.
*
DATA: anzahl(3) TYPE n,
tabelle(6) TYPE c,
infty LIKE t582a-infty,
aenderer LIKE sy-uname VALUE 'ZABGRENZ',
zpdsnr TYPE pdsnr_d, " Me 08.2010
ende TYPE i VALUE 80,
vorhanden.
DATA: wa_tab TYPE zpers_stamm.
DATA: zdaten(1330).
DATA: p_t777d TYPE t777d.
*
DATA: BEGIN OF itwa,
pernr LIKE pa0001-pernr,
ename LIKE pa0001-ename,
begda LIKE pa0001-begda,
endda LIKE pa0001-endda,
altda LIKE pa0001-endda,
hinweis(10) TYPE c, " Me 08.2010
END OF itwa,
itab LIKE TABLE OF itwa.
*
INCLUDE <list>.
*
INCLUDE mppdat02.
*
PARAMETERS:
infotyp(4) TYPE n OBLIGATORY,
subtyp LIKE pa0001-subty,
grenzdat LIKE pa0001-endda OBLIGATORY.
*
*---------------------------------------------------------------------*
DATA: BEGIN OF COMMON PART sapfp50p. "- Vorsicht nicht ändern !!!!!
*---------------------------------------------------------------------*
* PSINFO: Informationen welche Infotyp im Puffer PS vorhanden *
* sind. *
*---------------------------------------------------------------------*
DATA: BEGIN OF psinfo OCCURS 8,
pernr LIKE pskey-pernr,
infty LIKE pskey-infty,
begda LIKE pskey-begda,
endda LIKE pskey-endda,
dbidn(5),
zeitb(1),
vinft LIKE pskey-infty,
count(3) TYPE p,
END OF psinfo.
*---------------------------------------------------------------------*
* Tabelle PS: Puffer fuer die eingelesenen Infotypen. *
* Zu einem Infotyp werden alle Ereignisse auf einmal gelesen *
* (FILL_PS). Bei der Pflege der Infotypen wird ein Kennzeichen *
* OPERA gesetzt. *
*---------------------------------------------------------------------*
DATA: BEGIN OF ps OCCURS 20.
* INCLUDE STRUCTURE PRELP. "Wu 08/2011
INCLUDE STRUCTURE prelp AS prelp. "Wu 08/2011
DATA: opera, "'U'=Update,'D'=Delete,'I'=Insert
auth.
DATA: END OF ps.
*---------------------------------------------------------------------*
* PSMARK: Tabelle fuer markierte Infotypsaetze. *
*---------------------------------------------------------------------*
DATA: BEGIN OF psmark OCCURS 3.
INCLUDE STRUCTURE pskey.
DATA: END OF psmark.
*
** WT: Tabelle der zulaessigen Saetze org. Zuordnung *
**---------------------------------------------------------------------*
*
DATA: wt TYPE STANDARD TABLE OF p0001.
*
**---------------------------------------------------------------------*
*
DATA: BEGIN OF i582a OCCURS 20.
INCLUDE STRUCTURE t582a.
DATA: END OF i582a.
*
DATA: BEGIN OF preftab OCCURS 5.
* INCLUDE STRUCTURE PREF. "Wu 08/2011
INCLUDE STRUCTURE pref AS pref. "Wu 08/2011
DATA: opera(1).
DATA: END OF preftab.
*
DATA hrmm_objectmanager TYPE REF TO cl_hr_objectmanager.
DATA text_toggle_visibility TYPE gui_text.
DATA om_must_be_created TYPE flag.
DATA: hrac_badi TYPE REF TO if_ex_hrpad00auth_check.
*
*-------------------------------------------------------------------------------------
* Start For TWB CE "Wu 08/2011
*-------------------------------------------------------------------------------------
DATA: BEGIN OF infty_reas OCCURS 10.
INCLUDE STRUCTURE hrcce_pskey_to_peras AS hrcce_pskey_to_peras.
DATA: END OF infty_reas.
DATA: BEGIN OF infty_reas_temp OCCURS 10.
INCLUDE STRUCTURE hrcce_pskey_to_peras AS hrcce_pskey_to_peras.
DATA: END OF infty_reas_temp.
DATA: BEGIN OF reas_infty_subty_tab OCCURS 10.
DATA infty TYPE t588d-infty.
DATA subty TYPE t588d-subty.
DATA reas TYPE boole_d.
DATA chked TYPE boole_d.
DATA: END OF reas_infty_subty_tab.
DATA: BEGIN OF data_reas OCCURS 10.
INCLUDE STRUCTURE prelp AS prelp.
DATA: END OF data_reas.
DATA: ass_sel_termi_tab TYPE padce_pernr_tab.
DATA: ass_sel_termi_tab_wa LIKE LINE OF ass_sel_termi_tab.
DATA call_reas_pop_up TYPE boole_d.
*-------------------------------------------------------------------------------------
* Change of Payroll Area CE -internal table variable
*-------------------------------------------------------------------------------------
DATA : gt_psoper TYPE prelp_tab,
gt_psoper_del TYPE prelp_tab.
*-------------------------------------------------------------------------------------
* Change of Payroll Area CE- single variable
*-------------------------------------------------------------------------------------
DATA : gv_flg_curr_asg TYPE n,
gv_flg_other_asg TYPE n.
*-------------------------------------------------------------------------------------
* End For TWB CE
*-------------------------------------------------------------------------------------
DATA: END OF COMMON PART.
*---------------------------------------------------------------------*
* END OF COMMON PART - Vorsicht nicht ändern !!!!!
*
CONSTANTS: nop(3) VALUE 'NOP',
first VALUE '1',
all VALUE '4'.
*
************************************************************************
* Hauptprogramm *
************************************************************************
*
START-OF-SELECTION.
*
rp-lowdate-highdate.
MOVE infotyp TO infty.
PERFORM re777d(sapfp50m) USING infty
CHANGING t777d.
tabelle = t777d-dbtab.
*
GET pernr.
*
CLEAR itwa. CLEAR wa_tab. REFRESH ps.
*
rp_provide_from_last p0001 space pn-begda pn-endda.
IF pnp-sw-found EQ '1'.
IF p0001-persg EQ '1' OR p0001-persg EQ '4'.
*
* RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.
* MOVE PERNR-PERNR TO ITWA-PERNR.
MOVE-CORRESPONDING p0001 TO itwa. " Me 08.2010
*
PERFORM readit.
*
ENDIF.
ENDIF.
*
***********************************************************************
*
END-OF-SELECTION.
*
CLEAR: itwa.
COMMIT WORK AND WAIT.
*
IF anzahl > 0.
COMMIT WORK AND WAIT.
PERFORM kopf.
PERFORM tabaus.
*
SKIP 1.
ULINE AT (ende).
FORMAT COLOR COL_TOTAL INTENSIFIED OFF.
WRITE: / 'Anzahl bearbeiteter Infotypen: ' UNDER text-001,
anzahl.
SKIP 1.
ULINE AT (ende).
*
ENDIF.
*
***********************************************************************
* FORM READIT *
***********************************************************************
*
FORM readit.
**
IF subtyp GT 0.
PERFORM read_infotype(sapfp50p) USING pernr-pernr
infty subtyp space
all grenzdat high-date
first 'DIS ' pskey.
*
DELETE ps WHERE infty <> infty.
DELETE ps WHERE subty <> subtyp OR endda LE grenzdat.
LOOP AT ps.
CLEAR wa_tab.
wa_tab-mandt = sy-mandt.
MOVE-CORRESPONDING ps TO: wa_tab, itwa.
PERFORM modify.
ENDLOOP.
*
ELSE.
PERFORM read_infotype(sapfp50p) USING pernr-pernr
infty space space
all grenzdat high-date
first 'DIS ' pskey.
*
DELETE ps WHERE infty <> infty.
DELETE ps WHERE endda LE grenzdat.
LOOP AT ps.
CLEAR wa_tab.
wa_tab-mandt = sy-mandt.
MOVE-CORRESPONDING ps TO: wa_tab, itwa. " Me 08.2010
PERFORM modify.
ENDLOOP.
ENDIF.
*
ENDFORM. "READIT
*
*********************************************************************
* FORM MODIFY *
*********************************************************************
*
FORM modify.
*
CLEAR itwa-hinweis.
ADD 1 TO anzahl.
IF infty = '0118'.
SELECT SINGLE * FROM pa0118 INTO CORRESPONDING FIELDS OF z0118
WHERE pernr = ps-pernr
AND begda = ps-begda
AND endda = ps-endda
AND seqnr = ps-seqnr.
DELETE (tabelle) FROM wa_tab.
MOVE wa_tab-endda TO itwa-altda.
IF wa_tab-begda LT grenzdat. " Me 08.2010
z0118-endda = grenzdat.
z0118-uname = aenderer.
z0118-aedtm = sy-datum.
MODIFY (tabelle) FROM z0118.
CLEAR z0118.
ENDIF. " Me 08.2010
ELSE.
DELETE (tabelle) FROM wa_tab.
MOVE wa_tab-endda TO itwa-altda.
IF wa_tab-begda LT grenzdat. " Me 08.2010
MOVE grenzdat TO wa_tab-endda.
wa_tab-uname = aenderer.
wa_tab-aedtm = sy-datum.
MODIFY (tabelle) FROM wa_tab.
* MODIFY (tabelle) FROM <tab_entry>. " test
ENDIF. " Me 08.2010
ENDIF.
MOVE wa_tab-begda TO itwa-begda.
IF wa_tab-begda GE grenzdat. " Me 08.2010
itwa-hinweis = text-010. " Me 08.2010
ELSE. " Me 08.2010
MOVE grenzdat TO itwa-endda.
ENDIF. " Me 08.2010
APPEND itwa TO itab.
IF infty = '0014'.
SELECT * FROM asshr WHERE pernr = pernr-pernr
AND infty = infty
AND subty = subtyp
AND begda = wa_tab-begda
AND endda = itwa-altda.
IF asshr-mandt = sy-mandt.
IF asshr-begda LT grenzdat. " Me 08.2010
MOVE grenzdat TO asshr-endda.
MODIFY asshr.
ELSE. " Me 08.2010
zpdsnr = asshr-pdsnr. " Me 08.2010
DELETE FROM asshr CLIENT SPECIFIED " Me 08.2010
WHERE mandt = sy-mandt AND pdsnr = zpdsnr.
ENDIF. " Me 08.2010
ENDIF.
ENDSELECT.
ENDIF.
*
ENDFORM. "MODIFY
***********************************************************************
*
FORM kopf.
*
FORMAT COLOR COL_HEADING INTENSIFIED ON.
ULINE AT (ende).
WRITE: / sy-vline, 'Auflistung der Mitarbeiter mit geändertem ',
'Infotyp ', infotyp,
AT ende sy-vline.
ULINE AT (ende).
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
WRITE: / sy-vline, 'PersNr'(001),
AT 10 'Name des Mitarbeiters'(002),
AT 37 'Beginn'(003),
AT 48 'Ende neu'(004),
AT 58 'Ende vorher'(005),
AT 70 'Hinweis', " Me 08.2010
AT ende sy-vline.
ULINE AT (ende).
*
ENDFORM. "KOPF
**********************************************************************
FORM tabaus.
*
FORMAT COLOR COL_NORMAL INTENSIFIED OFF HOTSPOT ON.
LOOP AT itab INTO itwa.
WRITE: / itwa-pernr+3(5) UNDER text-001,
AT 10 itwa-ename,
AT 34 itwa-begda,
AT 46 itwa-endda,
AT 58 itwa-altda,
AT 70 itwa-hinweis, " Me 08.2010
AT ende ' '.
*
HIDE itwa-pernr.
CLEAR itwa.
*
ENDLOOP.
*
ENDFORM. "TABAUS
*
**********************************************************************
*
AT LINE-SELECTION.
*
IF sy-lsind = 1.
READ LINE sy-lilli.
IF NOT itwa-pernr IS INITIAL.
SET PARAMETER ID 'PER' FIELD itwa-pernr.
SET PARAMETER ID 'ITP' FIELD infotyp.
CALL TRANSACTION 'PA30'.
ENDIF.
ENDIF.
*