Hi all,
I am learning HR - ABAP, so can anybody sent me some sample report program, or any document on infotypes.
Also it would be very helpful, if i get some documents on INFOTYPES.
Request clarification before answering.
Hello,
REPORT yh1148_hr_01.
TABLES:
pa0000.
SELECT-OPTIONS:
s_pernr FOR pa0000-pernr.
DATA:
fs_emp TYPE pa0000,
fs_pa0002 TYPE p0002.
DATA:
t_emp LIKE
STANDARD TABLE
OF pa0000.
DATA:
t_pa0002 LIKE
STANDARD TABLE
OF p0002.
START-OF-SELECTION.
PERFORM get_data.
PERFORM hr_read_infotype.
LOOP AT t_pa0002 INTO fs_pa0002.
AT FIRST.
WRITE:/ 'pernr'(001),
20 'name'(003).
ENDAT.
WRITE:/ fs_pa0002-pernr UNDER text-001,
fs_pa0002-vorna UNDER text-003.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form hr_read_infotype
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM hr_read_infotype .
LOOP AT t_emp INTO fs_emp..
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS = 'A'
pernr = fs_emp-pernr
infty = '0002'
* BEGDA = '18000101'
* ENDDA = '99991231'
* BYPASS_BUFFER = ' '
* IMPORTING
* SUBRC =
TABLES
infty_tab = t_pa0002
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
ENDFORM. " hr_read_infotype
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data .
SELECT *
FROM pa0000
INTO TABLE t_emp
WHERE pernr IN s_pernr
AND endda GE sy-datum
AND begda LE sy-datum
AND stat2 EQ '3'.
ENDFORM. " get_data*********Hope this will help u******
******Reward if useful.
Regards,
Bhumika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 12 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.