lunes, 25 de febrero de 2013

NIF empleado

=Right([L01 Empregado (s) Nº ID (Chave)];Length([L01 Empregado (s) Nº ID (Chave)])-Pos([L01 Empregado (s) Nº ID (Chave)];"/"))

Problemas con decimales en el extractor 0HR_PT_2

Nota 1617680

martes, 5 de febrero de 2013

2 last characters of a string

DATA: int TYPE I, PEP TYPE C,
AUX_PEP TYPE /BI0/OIWBS_ELEMT.



CLEAR: INT, AUX_PEP.
PEP = COMM_STRUCTURE-WBS_ELEMT.
DESCRIBE FIELD PEp LENGTH INT IN CHARACTER MODE.
INT = INT - 2.
* result value of the routine
AUX_PEP = COMM_STRUCTURE-WBS_ELEMT+INT(2).
IF AUX_PEP ca SY-ABCDE.
RESULT = AUX_PEP.
ELSE.
RESULT = 99.
ENDIF.

lunes, 4 de febrero de 2013

Reset a selector like combo box or radio button

1. Bind labels of the selector (eg. B2:B5)
2. Set Insertion type and destination (eg. C2)
3. Set the selected item type on Dynamic on the behaviour tab of the selector
4. Bind the item to a cell (eg F2)
5. Bind source cell of Push button (eg. E2)
6. Bind destination cell of Push button (eg. F2, same as selected item of combo!)
7. Add formula in source cell push =if(F2=”x”,B2,”x”)
8. Add “x” value in destion cell F2

Comes in handy when you want to reset only certain parts of the dashboard and not resetting it to its initial state (as you do with the reset button).

Multiple Select List Box




http://dl.dropbox.com/u/40240633/4.-%20Indicadores%20de%20Gest%C3%A3o%20v_4.xlf

ABAP HR


Edad


PERFORM CALCULATE_ULTIMO " last day of month

using SOURCE_FIELDS-CALMONTH

RECORD_NO

RECORD_ALL

SOURCE_SYSTEM

CHANGING ULTIMO

RETURNCODE.



CLEAR: EMPLOYEE_MD, PERSON_MD.

CLEAR: EMPLOYEE_WA, PERSON_WA.



PERFORM READ_MD_PERSON

using SOURCE_FIELDS-employee

SOURCE_FIELDS-calmonth

RECORD_NO

RECORD_ALL

SOURCE_SYSTEM

CHANGING EMPLOYEE_WA

PERSON_WA

RETURNCODE.

EMPLOYEE_MD = EMPLOYEE_WA.

PERSON_MD = PERSON_WA.



IF NOT PERSON_MD-DATEBIRTH IS INITIAL.

RESULT = ULTIMO+0(4) - PERSON_MD-DATEBIRTH+0(4).

IF ULTIMO+4(4) LT PERSON_MD-DATEBIRTH+4(4).

RESULT = RESULT - 1.

ENDIF.

ENDIF.







%% Ocupação

if g_RECORD_NO <> RECORD_NO.

g_RECORD_NO = RECORD_NO.

clear: employee_md, person_md.

clear: employee_wa, person_wa.

endif.



perform read_md_employee

using SOURCE_FIELDS-employee

SOURCE_FIELDS-calmonth

RECORD_NO

RECORD_ALL

SOURCE_SYSTEM

changing employee_wa

RETURNCODE.

employee_md = employee_wa.

RESULT = EMPLOYEE_MD-PAYPCT.







if g_RECORD_NO <> RECORD_NO.

g_RECORD_NO = RECORD_NO.

clear: employee_md, person_md.

clear: employee_wa, person_wa.

endif.



perform read_md_employee

using SOURCE_FIELDS-employee

SOURCE_FIELDS-calmonth

RECORD_NO

RECORD_ALL

SOURCE_SYSTEM

changing employee_wa

RETURNCODE.

employee_md = employee_wa.

* fill the internal table "MONITOR", to make monitor entries



* result value of the routine

RESULT = EMPLOYEE_MD-PAYPCT / 100.







data: ultimo like sy-datum.



if g_RECORD_NO <> RECORD_NO.

g_RECORD_NO = RECORD_NO.

clear: employee_md, person_md.

clear: employee_wa, person_wa.

endif.



perform read_md_employee

using SOURCE_FIELDS-employee

SOURCE_FIELDS-calmonth

RECORD_NO

RECORD_ALL

SOURCE_SYSTEM

changing employee_wa

RETURNCODE.

employee_md = employee_wa.



perform calculate_ultimo

using SOURCE_FIELDS-calmonth

RECORD_NO

RECORD_ALL

SOURCE_SYSTEM

changing ultimo

RETURNCODE.



IF NOT EMPLOYEE_WA-ENTRYDATE IS INITIAL.

RESULT = ULTIMO+0(4) - EMPLOYEE_WA-ENTRYDATE+0(4).

IF ULTIMO+4(4) LT EMPLOYEE_WA-ENTRYDATE+4(4).

RESULT = RESULT - 1.

endif.

ENDIF.







DATA: TMP_PAYPCT TYPE I.

if g_RECORD_NO <> RECORD_NO.

g_RECORD_NO = RECORD_NO.

clear: employee_md, person_md.

clear: employee_wa, person_wa.

endif.



perform read_md_employee

using SOURCE_FIELDS-employee

SOURCE_FIELDS-calmonth

RECORD_NO

RECORD_ALL

SOURCE_SYSTEM

changing employee_wa

RETURNCODE.

employee_md = employee_wa.

* fill the internal table "MONITOR", to make monitor entries



* result value of the routine

* rounded

TMP_PAYPCT = EMPLOYEE_MD-PAYPCT.

RESULT = TMP_PAYPCT.