Google Search - Blog...........

Showing posts with label tables: hrp1000. Show all posts
Showing posts with label tables: hrp1000. Show all posts

HR ABAP - Finding Job Code For Position.

REPORT YZTEST.

*---data base tables used
tables: hrp1000.

*---types declaration
types: begin of ty_job,
plvar type hrp1000-plvar,
otype type hrp1000-otype,
objid type hrp1000-objid,
istat type hrp1000-istat,
langu type hrp1000-langu,
seqnr type hrp1000-seqnr,
short type hrp1000-short,
end of ty_job .

*---internal table declaration
data: it_job type standard table of ty_job with header line.

*---selection screen details
select-options:s_stell for hrp1000-objid.

*--start of selection
start-of-selection.

perform get_data.

*--- end of selection
end-of-selection.

perform display_result.
*&---------------------------------------------------------------------*
*& Form get_data
*----------------------------------------------------------------------*
form get_data .

SELECT plvar otype objid istat
langu seqnr short
FROM hrp1000
INTO table it_job
WHERE plvar = '01'
AND otype = 'C'
AND objid in s_stell
AND istat = '1'
and BEGDA <= sy-datum and ENDDA >= sy-datum
AND langu = sy-langu
AND seqnr = '000' .

endform. " get_data
*&---------------------------------------------------------------------*
*& Form display_result
*----------------------------------------------------------------------*
form display_result .

loop at it_job.
write:/1 it_job-plvar,
20 it_job-otype ,
35 it_job-objid ,
40 it_job-istat ,
55 it_job-langu ,
70 it_job-seqnr ,
105 it_job-short .
endloop.

endform. " display_result


ALSO READ:

- Finding Job Code For Position.

- Ordering (Descending ) Org. Unit For An Organization.

- Display Details about Organization unit, Position or Job In HR ABAP.

- First & Last Working Date Of An Employee.

- Get All The Existing Organization Units.

.....Back To Sub-Index On HR ABAP.

.....Back To MAIN INDEX.


ABAP - F4 (Value On Request) For Organization Unit In HR Report Program.

tables: hrp1000.

select-options: s_objid for hrp1000-objid.

data: it_objec like objec occurs 0 with header line.

at selection-screen on value-request for s_objid-low.

call function 'RH_OBJID_REQUEST'
exporting
plvar = '01'
* otype can be 'O' 'S' 'T' 'C' and so on
otype = 'S'
dynpro_repid = sy-repid
dynpro_dynnr = sy-dynnr
tables
sel_objects = it_objec
exceptions
cancelled = 1
wrong_condition = 2
nothing_found = 3
internal_error = 4
illegal_mode = 5
others = 6 .

if sy-subrc = 0.
read table it_objec index 1.
if sy-subrc = 0.
s_objid-low = it_objec-objid.
endif.
endif.


ALSO READ:

- Employee Pay Scale Report Program.

- Finding Job Code For Position.

- Ordering (Descending ) Org. Unit For An Organization.

- Display Details about Organization unit, Position or Job In HR ABAP.

- First & Last Working Date Of An Employee.

.....Back To Sub-Index On HR ABAP.

.....Back To MAIN INDEX.


HR ABAP - Employee Pay Scale Report Program.

REPORT ztest .

TABLES: hrp1000.

SELECT-OPTIONS:s_objid FOR hrp1000-objid,
s_date FOR sy-datum .

DATA: roots TYPE hrrootob OCCURS 0 WITH HEADER LINE.

TYPES: BEGIN OF ty_orgunit,
objid TYPE objid,
begda TYPE begda,
endda TYPE endda,
sobid TYPE sobid,
END OF ty_orgunit.

TYPES: BEGIN OF ty_0001,
pernr LIKE pa0001-pernr,
endda LIKE pa0001-endda,
begda LIKE pa0001-begda,
orgeh LIKE pa0001-orgeh,
ename LIKE pa0001-ename,
END OF ty_0001.
TYPES: BEGIN OF ty_pa0008,
pernr LIKE pa0008-pernr,
begda LIKE pa0008-begda,
endda LIKE pa0008-endda,
trfar LIKE pa0008-trfar,
trfgb LIKE pa0008-trfgb,
trfgr LIKE pa0008-trfgr,
END OF ty_pa0008.
TYPES: BEGIN OF ty_t510a,
trfar LIKE t510a-trfar,
tartx LIKE t510a-tartx,
END OF ty_t510a.

DATA:it_orgunit TYPE STANDARD TABLE OF ty_orgunit WITH HEADER LINE,
it_0001 TYPE STANDARD TABLE OF ty_0001 WITH HEADER LINE,
it_pa0001 TYPE STANDARD TABLE OF ty_0001 WITH HEADER LINE,
it_pa0008 TYPE STANDARD TABLE OF ty_pa0008 WITH HEADER LINE,
it_t510a TYPE STANDARD TABLE OF ty_t510a WITH HEADER LINE.


START-OF-SELECTION.

SELECT objid
begda
endda
sobid
INTO TABLE it_orgunit
FROM hrp1001
WHERE otype = 'O'
AND objid IN s_objid
AND plvar = '01'.

IF NOT it_orgunit[] IS INITIAL.

LOOP AT it_orgunit .
DATA: v_orgeh TYPE objid.

v_orgeh = it_orgunit-sobid.

SELECT SINGLE pernr
endda
begda
orgeh
ename
FROM pa0001
INTO it_0001
WHERE orgeh = v_orgeh
AND endda >= s_date-low
AND begda <= s_date-high. MOVE it_0001 TO it_pa0001. APPEND it_pa0001. CLEAR it_pa0001.
ENDLOOP.
ENDIF.

DELETE ADJACENT DUPLICATES FROM it_pa0001 COMPARING pernr.

IF NOT it_pa0001[] IS INITIAL.
SELECT pernr
endda
begda
trfar
trfgb
trfgr
FROM pa0008
INTO TABLE it_pa0008
FOR ALL ENTRIES IN it_pa0001
WHERE pernr = it_pa0001-pernr
AND endda GE s_date-low
AND begda LE s_date-high.
*---this is for the text of pay scale area
* IF NOT it_pa0008[] IS INITIAL.
* select TRFAR
* TARTX
* from T510A
* into table it_T510A
* for all entries in it_pa0008
* where trfar = it_pa0008-trfar.
*
* ENDIF.
ENDIF.

WRITE:/1 'Personnel NO',
18 'Start Date',
30 'End Date',
44 'Org Unit',
56 'Emp Name',
80 'Pay scale type',
95 'Pay Scale Area',
115 'Pay Scale Group'.

LOOP AT it_pa0001.
WRITE:/1 it_pa0001-pernr,
18 it_pa0001-begda,
30 it_pa0001-endda,
44 it_pa0001-orgeh,
56 it_pa0001-ename.
READ TABLE it_pa0008 WITH KEY pernr = it_pa0001-pernr.
WRITE: 85 it_pa0008-trfar,
100 it_pa0008-trfgb,
120 it_pa0008-trfgr.
ENDLOOP.



ALSO READ:

- Employee Pay Scale Report Program.

- Finding Job Code For Position.

- Ordering (Descending ) Org. Unit For An Organization.

- Display Details about Organization unit, Position or Job In HR ABAP.

- First & Last Working Date Of An Employee.

.....Back To Sub-Index On HR ABAP.

.....Back To MAIN INDEX.