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

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

REPORT YZTEST .

*---database tables used
tables: hrp1000.

*----types declaration
types: begin of ty_table,
PLVAR type hrp1000-plvar,
OTYPE type hrp1000-OTYPE,
OBJID type hrp1000-OBJID,
ISTAT type hrp1000-ISTAT,
LANGU type hrp1000-LANGU,
SEQNR type hrp1000-SEQNR,
STEXT type hrp1000-STEXT,
end of ty_table.
*---internal table declaration
data: it_table type table of ty_table with header line.

*---selection screen
select-options: s_objid for hrp1000-objid.

parameters:p_otype type hrp1000-otype.

* enter o for org unit
* s for position
* c for job

*--start of selection
start-of-selection.
*--get the data
perform get_data.
*---end of selection
end-of-selection.
*---display data
perform display_data.

*&---------------------------------------------------------------------*
*& Form get_data
*----------------------------------------------------------------------*
form get_data .

SELECT PLVAR
OTYPE
OBJID
ISTAT
LANGU
SEQNR
STEXT
FROM HRP1000
INTO table it_table
WHERE PLVAR = '01'
AND OTYPE = p_otype
AND OBJID in s_objid
AND ISTAT = '1'
AND LANGU = sy-langu
AND SEQNR = '000'.

sort it_table by objid.
delete adjacent duplicates from it_table comparing objid.

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

loop at it_table.
write:/ it_table-PLVAR,
it_table-OTYPE,
it_table-OBJID,
it_table-ISTAT,
it_table-LANGU,
it_table-SEQNR,
it_table-STEXT.
endloop.

endform. " display_data




No comments:

Post a Comment