tables:t591a,pa0021,pa0002.
DATA:BEGIN OF IT_PA0002 OCCURS 0,
PERNR LIKE PA0002-PERNR,
BEGDA LIKE PA0002-BEGDA,
ENDDA LIKE PA0002-ENDDA,
END OF IT_PA0002.
DATA:BEGIN OF IT_PA0021 OCCURS 0,
PERNR LIKE PA0021-PERNR,
subty like pa0021-subty,
BEGDA LIKE PA0021-BEGDA,
ENDDA LIKE PA0021-ENDDA,
FAMSA LIKE PA0021-FAMSA,
OBJPS LIKE PA0021-OBJPS,
FAVOR LIKE PA0021-FAVOR,
FANAM LIKE PA0021-FANAM,
KDSVH LIKE PA0021-KDSVH,
KDART LIKE PA0021-KDART,
END OF IT_PA0021.
data:it_t591a type t591a occurs 0 with header line.
data:it_t591s type t591s occurs 0 with header line.
PARAMETERS:P_PERNR LIKE PA0021-PERNR.
START-OF-SELECTION.
SELECT PERNR
BEGDA
ENDDA
FROM PA0021
INTO TABLE IT_PA0002
WHERE PERNR = P_PERNR.
IF SY-SUBRC = 0.
SELECT PERNR
subty
BEGDA
ENDDA
FAMSA
FAVOR
OBJPS
FANAM
KDSVH
KDART
FROM PA0021
INTO CORRESPONDING FIELDS OF TABLE IT_PA0021
FOR ALL ENTRIES IN IT_PA0002
WHERE PERNR = IT_PA0002-PERNR.
if sy-subrc = 0.
SELECT * FROM T591A
INTO table it_t591a
for all entries in it_pa0021
where infty = '0021'
and subty = it_pa0021-subty.
if sy-subrc = 0.
select * from t591s into table it_t591s where sprsl = 'EN'
and infty = '0021'
and subty = it_t591a-subty.
IF SY-SUBRC = 0.
LOOP AT IT_PA0021.
WRITE:/ IT_PA0021-PERNR,
IT_PA0021-BEGDA,
IT_PA0021-ENDDA,
IT_PA0021-FAMSA,
IT_PA0021-OBJPS,
it_t591s-stext,
IT_PA0021-FAVOR,
IT_PA0021-FANAM,
IT_PA0021-KDSVH,
IT_PA0021-KDART.
ENDLOOP.
ENDIF.
endif.
ENDIF.
endif.
ALSO READ:
- Net Salary Report In HR ABAP.
- Cumulative Amount Report in HR ABAP.
- Use Of Time Macro rp-read-all-time-ity in HR ABAP.
- Cumulative List Of Absences For Company Code, Personnel Area & Personnel Subarea.
- Employee Data Using Function Module In HR ABAP.
- BDC For The Action Transfer Of Location In HR ABAP.
.....Back To Index On HR ABAP.
.....Back To MAIN INDEX.
No comments:
Post a Comment