cancel
Showing results for 
Search instead for 
Did you mean: 

std program for uploading for Punch-in/outs for infotype 2011 (Time Events)

Former Member
0 Kudos

Dear SAP-HR Experts .

May u plz tell me any std program for uploading for Punch-in/outs for infotype 2011 (Time Events).

regards : rajneesh

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Yes Answered.

Former Member
0 Kudos

&----


*& Report Z_HR_TEVEN_UPLD *

*& *

&----


*& *

*& *

&----


REPORT Z_HR_TEVEN_UPLD .

INFOTYPES: 2011,0050.

TABLES: TEVEN.

DATA: TIMEEVENTS LIKE BAPICC1UPTEVEN OCCURS 0 WITH HEADER LINE,

RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.

DATA: FNAME(128) TYPE C, FTYPE(3), FSIZE TYPE I,CANCEL(1),POSTR(8) TYPE

C, Z-SUBRC LIKE SY-SUBRC,POPUP_RET(1).

DATA: BEGIN OF TEVEN_SRC OCCURS 0,

  • PERNR LIKE P2011-PERNR, "personal number

  • ZAUSW LIKE P0050-ZAUSW, "Terminal Number

  • TERID LIKE P2011-TERID, "Terminal ID

  • SATZA LIKE P2011-SATZA, "Time Event Type

  • LDATE LIKE P2011-LDATE, "Start Time

  • LTIME LIKE P2011-LTIME, "End Time

PERNR(8),

ZAUSW(8),

TERID(4),

SATZA(3),

LDATE(8),

LTIME(6),

END OF TEVEN_SRC.

PARAMETERS: SRC_FILE LIKE RLGRAP-FILENAME LOWER CASE DEFAULT

'F:\root\TEVEN_SCR.txt'.

PARAMETERS: LOG_SYS LIKE BAPICC1UPTEVEN-SOURCE_SYS DEFAULT 'S3DCLNT106'.

START-OF-SELECTION.

CALL FUNCTION 'UPLOAD'

EXPORTING

FILENAME = SRC_FILE

FILETYPE = 'DAT'

ITEM = 'load'

IMPORTING

FILESIZE = FSIZE

ACT_FILENAME = FNAME

ACT_FILETYPE = FTYPE

CANCEL = CANCEL

TABLES

DATA_TAB = TEVEN_SRC

EXCEPTIONS

CONVERSION_ERROR = 1

INVALID_TABLE_WIDTH = 2

INVALID_TYPE = 3

NO_BATCH = 4

UNKNOWN_ERROR = 5

GUI_REFUSE_FILETRANSFER = 6

OTHERS = 7.

LOOP AT TEVEN_SRC.

******Record Uniqueness Checking************

  • SELECT SINGLE * FROM TEVEN WHERE LDATE = TEVEN_SRC-LDATE AND

  • LTIME = TEVEN_SRC-LTIME AND

  • SATZA = TEVEN_SRC-SATZA AND

  • PERNR = TEVEN_SRC-PERNR AND

  • STOKZ <> 'X'.

**********************************************

  • IF SY-SUBRC = 4.

TIMEEVENTS-SOURCE_SYS = LOG_SYS.

TIMEEVENTS-PERNO = TEVEN_SRC-PERNR.

TIMEEVENTS-TIMEID_NO = TEVEN_SRC-ZAUSW.

TIMEEVENTS-TERMINALID = TEVEN_SRC-TERID.

TIMEEVENTS-TEVENTTYPE = TEVEN_SRC-SATZA.

TIMEEVENTS-LOGDATE = TEVEN_SRC-LDATE.

TIMEEVENTS-LOGTIME = TEVEN_SRC-LTIME.

APPEND TIMEEVENTS.

  • ENDIF.

ENDLOOP.

END-OF-SELECTION.

CALL FUNCTION 'BAPI_CC1_UPLOAD_TIMEEVENT'

TABLES

TIMEEVENTS = TIMEEVENTS

RETURN = RETURN

EXCEPTIONS

OTHERS = 01.

CASE SY-SUBRC.

WHEN 0. " OK

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TEXT_QUESTION = 'No error occured,posting time events now?'

DEFAULT_BUTTON = '1'

DISPLAY_CANCEL_BUTTON = SPACE

IMPORTING

ANSWER = POPUP_RET.

IF POPUP_RET = '1'.

CALL TRANSACTION 'PT45'.

ENDIF.

WHEN OTHERS. " to be implemented

LOOP AT RETURN .

WRITE: / RETURN-NUMBER,'---',RETURN-MESSAGE.

ENDLOOP.

ENDCASE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR SRC_FILE.

PERFORM SELECT_FILE CHANGING SRC_FILE.

&----


*& Form select_file

&----


  • text

----


  • -->SRC_FILE text

----


FORM SELECT_FILE CHANGING SRC_FILE.

DATA: L_RC TYPE I,

L_FILETABLE TYPE FILETABLE.

  • Open The txt File

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG

EXPORTING

WINDOW_TITLE = '请选择导入文件'

FILE_FILTER = '全部文件 (.)|.|'

MULTISELECTION = SPACE

CHANGING

FILE_TABLE = L_FILETABLE

RC = L_RC

EXCEPTIONS

FILE_OPEN_DIALOG_FAILED = 1

CNTL_ERROR = 2

ERROR_NO_GUI = 3

NOT_SUPPORTED_BY_GUI = 4

OTHERS = 5.

IF SY-SUBRC = 0 AND L_RC = 1.

READ TABLE L_FILETABLE INTO SRC_FILE INDEX 1.

ENDIF.

ENDFORM. "SELECT_FILE

Try this report.If you want to take XLS files as input source, let your ABAPer do some mod. And you should also get know to PT45 t-code, CC1TEV,CC1ERP table.

As comparsion to RPTCC106 std program, this program is eaier to use. Because you will have to finish ALE(IDOC) configuration when using RPTCC106. But this report need no further configuration.

Former Member
0 Kudos

Run Report RPTCC106.

Use

Uploading personnel time events enables all of the time events entered in the time recording system to be uploaded to R/3 Time Management (PT).

The personnel time events uploaded to the R/3 System are stored in the table CC1TEV. These time events can be processed using the report SAPCDT45. The time events can then be displayed and changed manually in the Time Events infotype (2011).

Procedure

Uploading personnel time events occurs in two steps:

Downloading the upload request from R/3 Time Management to the time recording system.

Run report RPTCC106 (HR-PDC: Download Upload Request for Time Events) by choosing Human resources ® Time management ® Administration ® Environment ® Subsystem connection ® Time events ® Upload request for time events.

Uploading the time events entered from the time recording system in R/3 Time Management.

The upload is started from each time recording system.

Downloading the upload requests can also be scheduled periodically as batch jobs. To do so, perform the Set Up Background Jobs ® Download step in the Personnel Time Events section of the IMG for Personnel Time Management.

Interfaces

Export via this BAPI is asynchronous.

Interface Type

RCVPEVTREC to download the upload request

Business Object

BUS7014 Manager for External Personnel Time Event for the Upload

Methods

requestPEvent (Download the Upload Request)

PTManagerExtPEvent.Insert (Upload)

Message Type

RCVPEVTREC to Download the Upload Request

HRCC1UPTEVEN for the Upload

Former Member
0 Kudos

Hi Rajesh,

Please check the module pool standard programs for uploading the infotype datas from excel sheet. The program name starts with ,

HRBP*

Thanks,

Ganesh R K