Abaphr Tcodes
Abaphr Tcodes
The SAP standard class CL_PT_EMPLOYEE provides us with two methods for reading either a default set
of infotypes or any other required infotype(s).
The infotypes are returned either in transparent form (default infotypes) or in semi-transparent form
(structure PRELP "HR Master Data Buffer") which can be easily converted into their corresponding
transparent form (table PAnnnn).
*&---------------------------------------------------------------------*
*& Report Z_SDN_CL_PT_EMPLOYEE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT z_sdn_cl_pt_employee.
TABLES: pa0000.
DATA:
go_employee TYPE REF TO cl_pt_employee,
* generic variables for retrieving infotype data
gd_infty TYPE infty,
gt_infty TYPE tim_tmw_itlist_tab,
gt_result TYPE tim_blp_request_tab,
gd_result LIKE LINE OF gt_result,
go_data TYPE REF TO cl_pt_td_itnnnn,
* specific infotype variables
gs_prelp TYPE prelp, " HR Master Data Buffer
gs_p0009 TYPE pa0009. " HR Master Record: Infotype 0009 (Bank
" Details)
FIELD-SYMBOLS:
TYPE ANY.
PARAMETERS:
p_pernr TYPE pa0000-pernr DEFAULT '00900222',
p_begda TYPE begda DEFAULT syst-datum,
p_endda TYPE endda DEFAULT syst-datum.
START-OF-SELECTION.
* Create an instance of the employee
go_employee ?= cl_pt_employee=>get_employee( p_pernr ).
* The class has a method GET_MASTER_DATA which returns several
* basic infotypes of the employee in a transparent form.
CALL METHOD go_employee->get_master_data
EXPORTING
im_begda = p_begda
im_endda = p_endda
* IMPORTING
* EX_I0000 = " infotype 0000 = Actions
* EX_I0001 = " infotype 0001 = Organizational Assignment
* EX_I0002 = " infotype 0002 = Personal Data
* EX_I0007 = " infotype 0007 = Planned Working Time
* EX_I0008 = " infotype 0008 = Basic Pay
.
Other HR Links :
Processing 'Time Data'.
HR ABAP Logical Database
Processing Payroll infotypes/Cluster
Download HR Infotypes tutorial
Be the first to rate this
Add to Technorati Favorites Subscribe to SAP ABAP by Email Subscribe in a reader
Posted by Amit Khari 0 comments
Labels: ABAP HR Development
Wednesday, June 13, 2007
Process Infotypes
Process Infotypes
RMAC Modules - RMAC module as referred to Macro, is a special construct of ABAP/4 codes. Normally, the
program code of these modules is stored in table 'TRMAC'. The table key combines the program code under
a given name. It can also be defined in programs.The RMAC defined in the TRMAC can be used in all
Reports. When an RMAC is changed, the report has to be regenerated manually to reflect the change.
Reading Infotypes - by using RMAC (macro) RP-READ-INFOTYPE
REPORT ZHR00001.
INFOTYPE: 0002.
PARAMETERS: PERNR LIKE P0002-PERNR.
RP-READ-INFOTYPE PERNR 0002 P0002 .
PROVIDE * FROM P0002
if ... then ...endif.
ENDPROVIDE.
Changing Infotypes - by using RMAC (macro) RP-READ-INFOTYPE.
Three steps are involved in changing infotypes:
1. Select the infotype records to be changed;
2. Make the required changes and store the records in an alternative table;
3. Save this table to the database;
The RP-UPDATE macro updates the database. The parameters of this macro are the OLD internal table
containing the unchanged records and the NEW internal table containing the changed records. You cannot
create or delete data. Only modification is possible.
INFOTYPES: Pnnnn NAME OLD,
Pnnnn NAME NEW.
GET PERNR.
PROVIDE * FROM OLD
WHERE .... = ... "Change old record
*Save old record in alternate table
NEW = OLD.
ENDPROVIDE.
RP-UPDATE OLD NEW. "Update changed record
Infotype with repeat structures
How to identify repeat structures.
a. On infotype entry screen, data is entered in table form.
IT0005, IT0008, IT0041, etc.
b. In the infotype structure, fields are grouped by the same name followed by sequence number.
P0005-UARnn P0005-UANnn P0005-UBEnn
P0005-UENnn P0005-UABnn
Repeat Structures
Data is entered on the infotype screen in table format but stored on the database in a linear
structure.
Each row of the table is stored in the same record on the database.
When evaluating a repeat structure, you must define the starting point, the increment and the
work area which contains the complete field group definition.
Repeat Structures Evaluation (I)
To evaluate the repeat structures
a. Define work area.
The work area is a field string. Its structure is identical to that of the field group.
b. Use a DO LOOP to divide the repeat structure into segments and make it available for
processing in the work area, one field group (block) at a time.
Repeat Structures Evaluation(II)
SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001.
Report Class
You can suppress input fields which are not used on the selection screen by assigning a report class to
your program.
If SAP standard delivered report classes do not satisfy your requirements, you can create your own report
class through the IMG.
Data Retrieval from LDB
1. Create data structures for infotypes.
INFOTYPES: 0001, "ORG ASSIGNMENT
0002, "PERSONAL DATA
0008. "BASIC PAY
2. Fill data structures with the infotype records.
Start-of-selection.
GET PERNR.
End-0f-selection.
Read Master Data
Infotype structures (after GET PERNR) are internal tables loaded with data.
The infotype records (selected within the period) are processed sequentially by the PROVIDE ENDPROVIDE loop.
GET PERNR.
PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA
If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. endif.
ENDPROVIDE.
Period-Related Data
All infotype records are time stamped.
IT0006 (Address infotype)
01/01/1990 12/31/9999 present
Which record to be read depends on the date selection period specified on the
selection screen. PN/BEGDA PN/ENDDA.
Current Data
IT0006 Address - 01/01/1990 12/31/9999 present
RP-PROVIDE-FROM-LAST retrieves the record which is valid in the data selection period.
For example, pn/begda = '19990931' pn/endda = '99991231'
IT0006 subtype 1 is resident address
RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.
Other HR Links :
Process Infotypes
Processing 'Time Data'.
Processing Payroll infotypes/Cluster
Download HR Infotypes tutorial
Be the first to rate this
Add to Technorati Favorites Subscribe to SAP ABAP by Email Subscribe in a reader
Posted by Amit Khari 0 comments
REPORT RPIMPORT.
TABLES: PCLn.
INCLUDE RPCnxxy0. "Cluster definition
* Fill cluster Key
* Import record
IMPORT TABLE1 FROM DATABASE PCLn(xy) ID xy-KEY.
IF SY-SUBRC EQ 0.
* Display data object
ENDIF.
Importing data (II)
Import data using macro RP-IMP-Cn-xy.
Check return code SY-SUBRC. If 0, it is successful. If 4, error.
Need include buffer management routines RPPPXM00
REPORT RPIMPORT.
*Buffer definition
INCLUDE RPPPXD00.
DATA: BEGIN OF COMMON PART 'BUFFER'.
INCLUDE RPPPXD10.
DATA: END OF COMMON PART 'BUFFER'.
*import data to buffer
RP-IMP-Cn-xy.
....
*Buffer management routines
INCLUDE RPPPXM00.
Cluster Authorization
Simple EXPORT/IMPORT statement does not check for cluster authorization.
Use EXPORT/IMPORT via buffer, the buffer management routines check for cluster
authorization.
Payroll Results (I)
Payroll results are stored in cluster Rn of PCL2 as field string and internal tables.
n - country identifier.
Standard reports read the results from cluster Rn. Report RPCLSTRn lists all payroll results;
report RPCEDTn0 lists the results on a payroll form.
Payroll Results (II)
The cluster definition of payroll results is stored in two INLCUDE reports:
include: rpc2rx09. "Definition Cluster Ru (I)
include: rpc2ruu0. "Definition Cluster Ru (II)
The first INCLUDE defines the country-independent part; The second INCLUDE defines the country-specific
part (US).
The cluster key is stored in the field string RX-KEY.
Payroll Results (III)
All the field string and internal tables stored in PCL2 are defined in the ABAP/4 dictionary. This
allows you to use the same structures in different definitions and nonetheless maintain data
consistency.
The structures for cluster definition comply with the name convention PCnnn. Unfortunately,
'nnn' can be any set of alphanumeric characters.
*Key definition
DATA: BEGIN OF RX-KEY.
INCLUDE STRUCTURE PC200.
DATA: END OF RX-KEY.
*Payroll directory
DATA: BEGIN OF RGDIR OCCURS 100.
INCLUDE STRUCTURE PC261.
DATA: END OF RGDIR.
Payroll Cluster Directory
To read payroll results, you need two keys: pernr and seqno
. You can get SEQNO by importing the cluster directory (CD) first.
REPORT ZHRIMPRT.
TABLES: PERNR, PCL1, PCL2.
INLCUDE: rpc2cd09. "definition cluster CD
PARAMETERS: PERSON LIKE PERNR-PERNR.
...
RP-INIT-BUFFER.
*Import cluster Directory
CD-KEY-PERNR = PERNR-PERNR.
RP-IMP-C2-CU.
CHECK SY-SUBRC = 0.
LOOP AT RGDIR.
RX-KEY-PERNR = PERSON.
UNPACK RGDIR-SEQNR TO RX-KEY-SEQNO.
*Import data from PCL2
RP-IMP-C2-RU.
INLCUDE: RPPPXM00. "PCL1/PCL2 BUFFER HANDLING
Function Module (I)
CD_EVALUATION_PERIODS
After importing the payroll directory, which record to read is up to the programmer.
Each payroll result has a status.
'P' - previous result
'A' - current (actual) result
'O' - old result
Function module CD_EVALUATION_PERIODS will restore the payroll result status for a period
when that payroll is initially run. It also will select all the relevant periods to be evaluated.
Function Module (II)
CD_EVALUATION_PERIODS
call function 'CD_EVALUATION_PERIODS'
exporting
bonus_date = ref_periods-bondt
inper_modif = pn-permo
inper = ref_periods-inper
pay_type = ref_periods-payty
pay_ident = ref_periods-payid
tables
rgdir = rgdir
evpdir = evp
iabkrs = pnpabkrs
exceptions
no_record_found = 1.
Authorization Check
Authorization for Persons
In the authorization check for persons, the system determines whether the user has the
authorizations required for the organizational features of the employees selected with
GET PERNR.
Employees for which the user has no authorization are skipped and appear in a list at the end
of the report.
Authorization object: 'HR: Master data'
Authorization for Data
In the authorization check for data, the system determines whether the user is authorized to
read the infotypes specified in the report.
If the authorization for a particular infotype is missing, the evaluation is terminated and an error
message is displayed.
Deactivating the Authorization Check
In certain reports, it may be useful to deactivate the authorization check in order to improve
performance. (e.g. when running payroll)
You can store this information in the object 'HR: Reporting'.
Other HR Links :
Process Infotypes
Processing 'Time Data'.
HR ABAP Logical Database
Download HR Infotypes tutorial
END OF t_emptexts.
DATA: it_emptexts TYPE STANDARD TABLE OF t_emptexts INITIAL SIZE 0,
wa_emptexts TYPE t_emptexts.
TYPES: BEGIN OF t_contract,
* INCLUDE STRUCTURE pa0615.
pernr TYPE p0615-pernr,
begda TYPE p0615-begda,
endda TYPE p0615-endda,
aedtm TYPE p0615-aedtm,
ctype TYPE p0615-ctype,
cbeg TYPE p0615-cbeg,
cend TYPE p0615-cend,
END OF t_contract.
DATA: it_contract TYPE STANDARD TABLE OF t_contract INITIAL SIZE 0,
wa_contract TYPE t_contract.
DATA: it_tabemp TYPE filetable,
gd_subrcemp TYPE i,
it_tabempt TYPE filetable,
gd_subrcempt TYPE i,
it_tabcont TYPE filetable,
gd_subrccont TYPE i.
DATA: gd_downfile TYPE string.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
PARAMETERS: p_emp LIKE rlgrap-filename,
p_empt LIKE rlgrap-filename,
p_cont LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK block1.
***********************************************************************
*at selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_emp.
REFRESH: it_tabemp.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select File'
default_filename = '*.xls'
initial_directory = 'C:\'
multiselection = ' ' "No multiple selection
CHANGING
file_table = it_tabemp
rc = gd_subrcemp.
LOOP AT it_tabemp INTO p_emp.
ENDLOOP.
***********************************************************************
*at selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_empt.
REFRESH: it_tabemp.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select File'
default_filename = '*.xls'
initial_directory = 'C:\'
multiselection = ' ' "No multiple selection
CHANGING
file_table = it_tabempt
rc = gd_subrcempt.
LOOP AT it_tabempt INTO p_empt.
ENDLOOP.
***********************************************************************
*at selection-screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cont.
REFRESH: it_tabcont.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select File'
default_filename = '*.xls'
initial_directory = 'C:\'
multiselection = ' ' "No multiple selection
CHANGING
file_table = it_tabcont
rc = gd_subrccont.
LOOP AT it_tabcont INTO p_cont.
ENDLOOP.
************************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.
GET pernr.
* Selecting the latest infotype record
rp_provide_from_last p0000 space pn-begda pn-endda.
rp_provide_from_last p0001 space pn-begda pn-endda.
rp_provide_from_last p0007 space pn-begda pn-endda.
rp_provide_from_last p0008 space pn-begda pn-endda.
rp_provide_from_last p0121 space pn-begda pn-endda.
rp_provide_from_last p0615 space pn-begda pn-endda.
MOVE-CORRESPONDING p0001 TO wa_employee.
wa_employee-rfpnr = p0121-rfp01. "?????
MOVE-CORRESPONDING p0007 TO wa_employee.
MOVE-CORRESPONDING p0008 TO wa_employee.
MOVE-CORRESPONDING p0000 TO wa_employee.
SELECT SINGLE molga
FROM t001p
INTO wa_employee-molga
WHERE werks EQ p0001-werks AND
btrtl EQ p0001-btrtl.
SELECT SINGLE trfkz
FROM t503
INTO wa_employee-trfkz
WHERE persg EQ p0001-persg AND
persk EQ p0001-persk.
CALL FUNCTION 'HR_ENTRY_DATE'
EXPORTING
persnr = pernr-pernr
* RCLAS =
* BEGDA = '18000101'
* ENDDA = '99991231'
* VARKY =
IMPORTING
entrydate = wa_employee-ncsdate
* TABLES
* ENTRY_DATES =
EXCEPTIONS
ENTRY_DATE_NOT_FOUND = 1
PERNR_NOT_ASSIGNED = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* append employee data
APPEND wa_employee TO it_employee.
CLEAR: wa_employee.
wa_emptexts-datefrom = p0001-begda.
wa_emptexts-dateto = p0001-endda.
wa_emptexts-pernr = p0001-pernr.
wa_emptexts-txtmd = p0001-ename.
* append employee texts data
APPEND wa_emptexts TO it_emptexts.
CLEAR: wa_emptexts.
MOVE-CORRESPONDING p0615 TO wa_contract.
* append employee contract data
APPEND wa_contract TO it_contract.
CLEAR: wa_contract.
************************************************************************
*END-OF-SELECTION.
END-OF-SELECTION.
* download employee data
IF NOT p_emp IS INITIAL.
gd_downfile = p_emp.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = gd_downfile
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = it_employee.
IF sy-subrc EQ 0.
WRITE:/ 'Employee file downloaded to',
gd_downfile.
ELSE.
WRITE:/ 'There was an error downloading Employee file to',
gd_downfile.
ENDIF.
ENDIF.
* download employee texts data
IF NOT p_empt IS INITIAL.
gd_downfile = p_empt.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = gd_downfile
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = it_emptexts.
IF sy-subrc EQ 0.
WRITE:/ 'Employee text file downloaded to',
gd_downfile.
ELSE.
WRITE:/ 'There was an error downloading Employee text file to',
gd_downfile.
ENDIF.
ENDIF.
* download contract data
IF NOT p_cont IS INITIAL.
gd_downfile = p_cont.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = gd_downfile
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = it_contract.
IF sy-subrc EQ 0.
WRITE:/ 'Employee contract file downloaded to',
gd_downfile.
ELSE.
WRITE:/ 'There was an error downloading Employee contract file to',
gd_downfile.
ENDIF.
ENDIF.
Other Useful Link:
ZP_POSTCODE Staff by Post code report
ZP_GET_SXP_ABSENCE_DATA Retrieve actual sickpay values (ABAP)
ZDOWNEMPDATA Download various employee data to excel/tab flat files
Download Human Resources (HR) tutorial1Human Resources (HR) tutorial2
Download HR Form Editor (PY-XX-TL) tutorial
Download HR Forms Workplace (PY-XX-FO) tutorial
Download HR Funds and Position Management (PA-PM) Tutorial
Download HR - Human Resource Management Tutorial
Download HR Tools (PY-XX-TL) Tutorial
Download HR Infotypes tutorial
Be the first to rate this
Add to Technorati Favorites Subscribe to SAP ABAP by Email Subscribe in a reader
Posted by Amit Khari 0 comments
Labels: ABAP HR Development
Report: ZSXP_ABSENCE_DATA
************************************************************************
* Report: ZSXP_ABSENCE_DATA *
**
* Author: abap code *
**
* Date : 25.05.2007 *
**
* Description: Retrieve maternaty/Sickness Absence data
**
************************************************************************
REPORT ZSXP_ABSENCE_DATA
LINE-SIZE 100 NO STANDARD PAGE HEADING
MESSAGE-ID 5g.
TABLES: t554s, pernr, pcl1, pcl2.
INCLUDE rpclst00.
INCLUDE rpc2rx09. "Payroll results datadefns-Intl.
INCLUDE rpc2rxx0. "Payroll results datadefns-Intl.
INCLUDE rpc2rgg0. "Payroll results datadefns-GB
INCLUDE rpcfdcg0. "Payroll results datadefns-GB
INCLUDE rpcdatg0.
INCLUDE rpc2cd00. "Cluster Directory defns.
INCLUDE rpc2ps00. "Cluster: Generierte Schematas
INCLUDE rpc2pt00.
INCLUDE rpcfdc10.
INCLUDE rpcfdc00.
INCLUDE rpppxd00.
INCLUDE rpppxd10.
INCLUDE rpcfvp09.
INCLUDE rpcfvpg0.
INCLUDE rpppxm00.
INFOTYPES: 0001, "Organisational assignment
0002, "Personal Data
0003, "Payroll Status
0088, "SMP
2001, "Absences
0086. "SSP/SMP Exlclusions
DATA: ssp_weeks TYPE p DECIMALS 2 VALUE 0.
DATA: ssp_total TYPE p DECIMALS 2 VALUE 0,
total_val TYPE p DECIMALS 2 VALUE 0,
smp_weeks TYPE p DECIMALS 2 VALUE 0,
smp_value TYPE p DECIMALS 2 VALUE 0,
gross LIKE pc207-betrg,
dis_gross TYPE p DECIMALS 2 VALUE 0.
DATA: gd_begda(10) TYPE c,
gd_endda(10) TYPE c.
DATA: ld_orgtxt LIKE t527x-orgtx.
DATA: name(30).
DATA: BEGIN OF itab OCCURS 0,
pernr LIKE p0002-pernr,
perid LIKE p0002-perid,
name LIKE name,
END OF itab.
TYPES: BEGIN OF t_report,
pernr TYPE pernr-pernr, "8
name TYPE name, "30
awart TYPE p2001-awart, "4
begda TYPE p2001-begda, "10
endda TYPE p2001-endda, "10
wkspaid TYPE p DECIMALS 2, "10
amtpaid TYPE p DECIMALS 2, "10
END OF t_report.
DATA: it_report TYPE STANDARD TABLE OF t_report INITIAL SIZE 0,
wa_report TYPE t_report.
DATA: moabw LIKE t001p-moabw.
DATA: printheader TYPE i VALUE 1,
gd_success TYPE i.
* NCALE declarations
TYPES : BEGIN OF pfra0_pcale,
annee(4) TYPE c.
INCLUDE STRUCTURE pcint.
TYPES : END OF pfra0_pcale.
TYPES : pfra0_tab_pcale TYPE pfra0_pcale OCCURS 0.
DATA: it_ncale TYPE STANDARD TABLE OF pcnat INITIAL SIZE 0,
wa_ncale TYPE pcnat,
it_pcale TYPE pfra0_tab_pcale,
pcale TYPE pfra0_tab_pcale.
* SMP/SSP absence data
data begin of it_msa occurs 0.
include structure pc27j.
data end of it_msa.
parameters: p_memid type char30.
************************************************************************
*STAR-OF-SELECTION
START-OF-SELECTION.
gd_begda = pn-begda.
gd_endda = pn-endda.
gd_begda+6(2) = '01'.
gd_endda+6(2) = '01'.
refresh: it_msa.
clear: it_msa.
GET pernr.
** PERFORM IMPORT_PC USING GD_SUCCESs.
PERFORM get_rgdir.
while gd_begda le gd_endda.
PERFORM get_new_rg USING gd_begda.
* First name
wa_output-fname = p0002-vorna.
* Last name
wa_output-lname = p0002-nachn.
* Organizational Unit text (dept)
SELECT SINGLE orgtx
FROM t527x
INTO wa_output-orgtx
WHERE sprsl EQ sy-langu AND
orgeh EQ p0001-orgeh AND
endda GE sy-datum.
* FTE
wa_output-fte = p0008-bsgrd.
* Parking / travel deducted?
CASE p0014-lgart.
WHEN '7180' OR '7181' OR '7182'.
wa_output-parking = text-002.
WHEN '7183'.
wa_output-parking = text-001.
WHEN '7171' OR '7172' or '7173' or '7174' or
'7175' or '7176' or '7177' or '7178'.
wa_output-parking = text-003.
ENDCASE.
* Payslip Address
SELECT SINGLE sachn
FROM t526
INTO wa_output-payslip
WHERE werks EQ p0001-werks AND
sachx EQ p0001-sacha.
PROVIDE * from p0105 between pn-begda and pn-endda.
* Telephone numbers
if p0105-usrty = '0020'.
wa_output-telno = p0105-usrid_long.
endif.
* Email address
if p0105-usrty = 'MAIL'.
wa_output-email = p0105-usrid_long.
endif.
ENDPROVIDE.
append wa_output to it_output.
clear: wa_output.
************************************************************************
*END-OF-SELECTION.
END-OF-SELECTION.
describe table it_output lines gd_lines.
if gd_lines gt 0.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
else.
message i003(zp) with 'No records found'.
endif.
*&---------------------------------------------------------------------*
*& Form PROGRESS_INDICATOR
*&---------------------------------------------------------------------*
* Displays progress indicator on SAP screen
*----------------------------------------------------------------------*
form progress_indicator using p_text.
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
* PERCENTAGE = 0
text = p_text.
fieldcatalog-fieldname = 'POSTCODE'.
fieldcatalog-seltext_m = 'Post code'.
fieldcatalog-col_pos = 10.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*&---------------------------------------------------------------------*
*& Form BUILD_LAYOUT
*&---------------------------------------------------------------------*
* Build layout for ALV grid report
*----------------------------------------------------------------------*
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-zebra = 'X'.
endform. " BUILD_LAYOUT
*&---------------------------------------------------------------------*
*& Form DISPLAY_ALV_REPORT
*&---------------------------------------------------------------------*
* Display report using ALV grid
*----------------------------------------------------------------------*
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_output
exceptions
program_error = 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.
endform. " DISPLAY_ALV_REPORT
Other Useful Link:
ZP_POSTCODE Staff by Post code report
ZP_GET_SXP_ABSENCE_DATA Retrieve actual sickpay values (ABAP)
ZDOWNEMPDATA Download various employee data to excel/tab flat files
Download Human Resources (HR) tutorial1Human Resources (HR) tutorial2
Download HR Form Editor (PY-XX-TL) tutorial
Download HR Forms Workplace (PY-XX-FO) tutorial
Download HR Funds and Position Management (PA-PM) Tutorial
Download HR - Human Resource Management Tutorial
Download HR Tools (PY-XX-TL) Tutorial
Download HR Infotypes tutorial
Be the first to rate this
Add to Technorati Favorites Subscribe to SAP ABAP by Email Subscribe in a reader
Posted by Amit Khari 0 comments
http://www.sapdev.co.uk/
http://abapcode.blogspot.com/