Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
7 views2 pages

Code With Function

The document outlines an ABAP report for processing employee time session data. It includes data structure definitions, file upload functionality, and operations for inserting employee time records into an HR infotype. The report utilizes BAPI functions for enqueueing and dequeueing employee records during the operation.

Uploaded by

tlninfo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Code With Function

The document outlines an ABAP report for processing employee time session data. It includes data structure definitions, file upload functionality, and operations for inserting employee time records into an HR infotype. The report utilizes BAPI functions for enqueueing and dequeueing employee records during the operation.

Uploaded by

tlninfo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

report ZTRK_TIME_SESSION

no standard page heading line-size 255.

types : begin of lty_data,


pernr type persno,
ldate type ldate,
ltime type ltime,
satza type retyp,
END OF lty_data.

data : lt_data type table of lty_data.


data : lwa_data type lty_data.
data : lwa_p2011 type p2011.
data : lwa_return type BAPIRETURN1.
data : lv_file type STRING.

" INCLUDE bdcrecx1.


PARAMETERS p_file TYPE localfile.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.


CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
IMPORTING
file_name = p_file.

lv_file = p_file.

START-OF-SELECTION.

CALL FUNCTION 'GUI_UPLOAD'


EXPORTING
filename = lv_file
* FILETYPE = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = lt_data.

clear: lwa_data.

loop at lt_data into lwa_data.


CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = lwa_data-pernr
IMPORTING
RETURN = lwa_return
.
lwa_p2011-pernr = lwa_data-pernr.
lwa_p2011-ldate = lwa_data-ldate.
lwa_p2011-ltime = lwa_data-ltime.
lwa_p2011-satza = lwa_data-satza.
lwa_p2011-terid = ''.
lwa_p2011-origf = 'M'.
* lwa_p2011-terminalid = 'Terminal01'.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'


EXPORTING
infty = '2011'
number = lwa_data-pernr
SUBTYPE = '01'
* OBJECTID =
* LOCKINDICATOR =
VALIDITYEND = lwa_p2011-ldate
VALIDITYBEGIN = lwa_p2011-ldate
* RECORDNUMBER =
record = lwa_p2011
operation = 'INS'
TCLAS = 'A'
DIALOG_MODE = '0'
* NOCOMMIT =
* VIEW_IDENTIFIER =
* SECONDARY_RECORD =
IMPORTING
RETURN = lwa_return
* KEY =
.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'


EXPORTING
number = lwa_data-pernr
IMPORTING
RETURN = lwa_return
.

clear: lwa_data, lwa_p2011.


endloop.
write: / '1'.

You might also like