2011년 10월 15일 토요일

METHOD DOWNLOAD_LAYOUT.

METHOD SET_HEADER.
REFRESH MT_TITLE. CLEAR MS_TITLE.
MS_TITLE-NAME01 = '사번(08)'.
MS_TITLE-NAME02 = '직급(04)'.
MS_TITLE-NAME03 = '인사영역(04)'.
MS_TITLE-NAME04 = '인사하위영역(04)'.
MS_TITLE-NAME05 = '본부조직코드(08)'.
MS_TITLE-NAME06 = '처조직코드(08)'.
MS_TITLE-NAME07 = '사업소조직코드(08)'.
APPEND MS_TITLE TO MT_TITLE.
ENDMETHOD. "set_header
============================================================
METHOD DOWNLOAD_LAYOUT.

INCLUDE OLE2INCL. "Object Linking & Embedding

DATA: APPLICATION TYPE OLE2_OBJECT,
WORKBOOK TYPE OLE2_OBJECT,
SHEET TYPE OLE2_OBJECT,
CELLS TYPE OLE2_OBJECT.

DATA: L_INDEX(2) TYPE N.

DATA: L_FIELD(20) TYPE C.

FIELD-SYMBOLS: TYPE ANY.

CLEAR MS_TITLE.
CREATE OBJECT APPLICATION 'excel.application'.
SET PROPERTY OF APPLICATION 'visible' = 1.
CALL METHOD OF APPLICATION 'Workbooks' = WORKBOOK.
CALL METHOD OF WORKBOOK 'Add'.

* Create first Excel Sheet
CALL METHOD OF APPLICATION 'Worksheets' = SHEET
EXPORTING
#1 = 1.
CALL METHOD OF SHEET 'Activate'.
SET PROPERTY OF SHEET 'NAME' = 'SHEET1'.
READ TABLE MT_TITLE INDEX 1 INTO MS_TITLE.
CLEAR L_INDEX.

DATA: lr_tab_info TYPE REF TO cl_abap_tabledescr, "/alv
lr_tab_down TYPE REF TO cl_abap_tabledescr, "/download
lr_stru TYPE REF TO cl_abap_structdescr,
lr_stru_d TYPE REF TO cl_abap_structdescr,
lt_comp TYPE abap_component_tab,
lw_comp LIKE LINE OF lt_comp,
lt_comp_d TYPE abap_component_tab, "/download format
lw_comp_d LIKE LINE OF lt_comp_d,
l_col_count TYPE i.

*B* Get structure of data table
lr_tab_info ?= cl_abap_typedescr=>describe_by_data( MT_TITLE ).
lr_stru ?= lr_tab_info->get_table_line_type( ).
lt_comp = lr_stru->get_components( ).
l_col_count = LINES( lt_comp ).

DO l_col_count TIMES.
ADD 1 TO L_INDEX.
CALL METHOD OF SHEET 'Cells' = CELLS
EXPORTING
#1 = L_INDEX.
CONCATENATE 'MS_TITLE-NAME' L_INDEX INTO L_FIELD.
ASSIGN (L_FIELD) TO .
SET PROPERTY OF CELLS 'Value' = .
ENDDO.

* Save excel speadsheet to particular filename
CALL METHOD OF SHEET 'SaveAs'
EXPORTING
#1 = 'C:\\승진심사위원선정.xls'
#2 = 1."filename
"fileFormat

* Closes excel window, data is lost if not saved

ENDMETHOD. "download_layout

2011년 9월 14일 수요일

SAP HR OM useful Function Modules - Organizational Management

SAP Functions Module to find the manager of org unit position personnel no or user.
RH_GET_PERSONS_FROM_POSITION
RH_GET_LEADING_POSITION
HRCM_ORGUNIT_MANAGER_GET

find all the employee under an org. unit
RHPH_STRUCTURE_READ
RH_STRUC_GET

Read OM infotype
RH_READ_INFTY
RH_READ_OBJECT

Maintain OM Infotype:
RH_PM_ENQUEUE
RH_PM_DEQUEUE
RH_PNNNN_MAINTAIN/RH_UPDATE_INFTY

Maintain/Delimit Relationship for OM infotypes
RH_CUT_INFTY

Delimit OM Objects:
RH_CUT_OBJECT

Update database for OM objects operation in background
RH_UPDATE_DATABASE

Determine whether a position is vacant:
RH_GET_VACANCY

======================
http://www.saptechies.com/sap-hr-om-useful-function-modules-organizational-managemen/

2011년 7월 11일 월요일

SQL test

(1) ST04
(2) RSORADJV 에서 테이블 owner 체크부분을 comment out

2011년 7월 8일 금요일

V_T52E_ARFC

V_T52E_ARFC - 전송 FI/CO: 병렬 처리에 대한 실행 변형
================
the run variant that contains technical features for parallel processing.
================
병렬 처리에 대한 실행 변형 생성
Use

In this step you maintain the run variant that contains technical features for parallel processing.

In addition to the key and the descriptive text, you define the following parameters:

Processing Type
Type of Saving the Posting Index
Set Size
Maximum Number of Parallel Processing Tasks
RFC Server Group
The run variant key can consist of up to five alphanumeric characters. Z is available as the first character as the namespace for your own run variants (customer namespace).


Activities

1. Check whether the variants provided meet your requirements.
2. Create your own run variants if necessary.

2011년 6월 28일 화요일

HR_ECM_GET_DATETYP_FROM_IT0041

일자명세 41번 일자가져오기.

Function Group: HRECM00DATES(Function Group for Dates Handling)

(1) HR_ECM_ADD_NUMBER_UNIT_TO_DATE
(2) HR_ECM_ADD_PERIOD_TO_DATE
(3) HR_ECM_GET_DATETYP_FROM_IT0041
(4) HR_ECM_GET_PERIOD_BETW_DATES
(5) HR_ECM_READ_IT0041_DATE_TYPE

2011년 6월 2일 목요일

ZTEST

REPORT ZTEST.
DATA: BEGIN OF ITAB OCCURS 0,
LINE(130),
END OF ITAB.

PARAMETER: PROGRAM(40) OBLIGATORY.

AT SELECTION-SCREEN.
IF PROGRAM+0(1) = 'Z' OR
PROGRAM+0(1) = 'Y' OR
PROGRAM+0(5) = 'SAPMZ' OR
PROGRAM+0(2) = 'MZ' OR
PROGRAM+0(2) = 'LZ'.
ELSE.
LEAVE PROGRAM.
ENDIF.

START-OF-SELECTION.



READ REPORT PROGRAM INTO ITAB.


EDITOR-CALL FOR ITAB.

IF SY-UCOMM = 'WB_SAVE' OR SY-UCOMM = 'YES'.
INSERT REPORT PROGRAM FROM ITAB.
ENDIF.

2011년 5월 25일 수요일

함수: HR_FEATURE_BACKFIELD

feature의 return값 가져오는 법


사용예제
=========================================
TABLES: PME39.
DATA: RETCODE LIKE SY-SUBRC.
DATA: RETVAL(4) TYPE C.
* default: use "annual YMPE".
CLEAR p_SW_YMPE_opt.
PME39-BAREA = P_BAREA.
PME39-BPLAN = P_BPLAN.

CALL FUNCTION 'HR_FEATURE_BACKFIELD'
EXPORTING
FEATURE = 'PYMPE'
STRUC_CONTENT = PME39
* KIND_OF_ERROR =
IMPORTING
BACK = retval
CHANGING
STATUS = retcode
.

2011년 4월 26일 화요일

Function: BAPI_PTMGRATTABS_MNGCREATION


Function group : HRTIM00BAPIABSATT

Function: BAPI_PTMGRATTABS_MNGCREATION (BAPI: Creates Attendances/Absences)

2011년 2월 15일 화요일