HR Tables
T527O - Organizational Key Validation
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org_f4 WHERE orgky IN so_org AND hirar = '1'.
T500P - Personnel Areas
T001P - Personnel Area/Subarea
T529U - Staus of employee master
SELECT text1 FROM t529u INTO TABLE it_stat1_f4 WHERE sprsl = 'EN'
AND statn = '2' AND text1 IN so_stat1.
T528T - Position Texts
SELECT SINGLE plstx FROM t528t INTO gs_final1-g15 WHERE sprsl = 'EN' AND otype = 'S' AND plans = lv_p0001-plans.
T530T- Reason for Action Texts
SELECT SINGLE stat1 stat2 massn massg FROM pa0000 INTO ( lv_stat1,lv_stat2,lv_massn,lv_massg ) WHERE pernr = gs_pa0000-pernr "gs_hrp1001-objid
AND begda <= so_date-low AND endda >= so_date-high.
SELECT SINGLE mgtxt FROM t530t INTO gs_final1-g38 WHERE sprsl = 'EN' AND massn = 'Z3' AND massg = lv_massg.
T503T - Employee Subgroup or employee type Table text
SELECT SINGLE ptext FROM t503t INTO gs_final1-g36 WHERE sprsl = 'EN' AND persk = wa_p0001-persk.
********************************************************************************
PS TABLES:
Project Allocation Table
SELECT
otype
objid
rsign
relat
varyf
begda
endda
sobid
prozt
FROM hrp1001
INTO CORRESPONDING FIELDS OF TABLE gt_hrp1001
FOR ALL ENTRIES IN gt_pa0000
WHERE objid = gt_pa0000-pernr
AND begda <= so_date-low AND ENDDA >= so_date-high
AND otype = 'P'
AND sclas = 'PJ' .
CONCATENATE 'PR' gs_hrp1001-sobid INTO gs_hrp1001-sobid.
CONDENSE gs_hrp1001-sobid.
SELECT SINGLE pspnr post1 FROM prps INTO ( lv_ps_posnr,gs_final1-g19 ) WHERE objnr = gs_hrp1001-sobid.
CALL FUNCTION 'CJDW_PRPS_SELECT_SINGLE'
EXPORTING
posnr = lv_ps_posnr
IMPORTING
e_prps = gv_prps
EXCEPTIONS
missing_parameter = 1
not_found = 2
OTHERS = 3.
*****************************************************************************
1.SELECT-OPTIONS: so_emp FOR pa9011-pernr OBLIGATORY ,
* so_date FOR sy-datum NO INTERVALS NO-EXTENSION OBLIGATORY DEFAULT sy-datum,
so_date for sy-datum OBLIGATORY ,
so_org FOR p0001-vdsk1 ,
so_area FOR t500p-name1,
so_sarea FOR p0001-btrtl," MATCHCODE OBJECT hrpad_btrtl,
so_wbs FOR prps-pspnr MATCHCODE OBJECT ash_prpm, " Wbs element
so_cust FOR kna1-kunnr MATCHCODE OBJECT debi, " Customer
so_stat FOR prps-astnr MATCHCODE OBJECT h_tcj05, " billing status
so_stat1 FOR t529u-text1." t529t-mntxt." MATCHCODE OBJECT h_t529a. " employee atatus
SELECTION-SCREEN: END OF BLOCK b1.
2.Initialization
INITIALIZATION.
* Description for the parameter
SO_DATE-LOW = SY-DATUM.
SO_DATE-OPTION = 'BT'.
SO_DATE-SIGN = 'I'.
SO_DATE-HIGH = SY-DATUM.
APPEND SO_DATE.
3.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_org-low.
CLEAR : it_org[].
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org WHERE hirar = '1'.
* SELECT
* persa
* name1
* FROM t500p
* INTO TABLE it_org.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORGKY' "'PERSA'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'SO_ORG-LOW'
value_org = 'S'
TABLES
value_tab = it_org.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_org-high.
CLEAR : it_org[].
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org WHERE hirar = '1'.
* SELECT
* persa
* name1
* FROM t500p
* INTO TABLE it_org.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORGKY' "'PERSA'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'SO_ORG-HIGH'
value_org = 'S'
TABLES
value_tab = it_org.
4. To check Authorization for Organization Key : p0001-vdsk1
AT SELECTION-SCREEN.
LOOP AT so_org.
TRANSLATE : so_org-low TO UPPER CASE,
so_org-high TO UPPER CASE.
MODIFY so_org.
ENDLOOP.
CLEAR : g_message_v1,g_message_v2,g_message_v3,g_message_v4.
IF so_org-low IS NOT INITIAL.
AUTHORITY-CHECK OBJECT 'P_ORGIN' ID 'VDSK1' FIELD so_org-low.
IF sy-subrc <> 0.
CLEAR : g_message_v1,g_message_v2,g_message_v3,g_message_v4.
g_message_v1 = 'No authorization for'.
g_message_v2 = 'Organizational Key - '.
g_message_v3 = so_org-low.
CONDENSE : g_message_v1,g_message_v2,g_message_v3.
MESSAGE e000(zps_msg) WITH g_message_v1 g_message_v2 g_message_v3.
ENDIF.
ENDIF.
DATA : it_usvalues TYPE TABLE OF usvalues,
wa_usvalues TYPE usvalues.
IF so_org IS INITIAL.
lv_org = 'X'.
CLEAR : it_usvalues[].
CALL FUNCTION 'EFG_USER_AUTH_FOR_OBJ_GET'
EXPORTING
x_uname = sy-uname
x_object = 'P_ORGIN'
TABLES
yt_usvalues = it_usvalues.
ENDIF.
IF it_usvalues[] IS NOT INITIAL.
LOOP AT it_usvalues INTO wa_usvalues.
IF wa_usvalues-field <> 'VDSK1'.
wa_usvalues-field = 'X'.
ENDIF.
MODIFY it_usvalues FROM wa_usvalues INDEX sy-tabix TRANSPORTING field.
CLEAR : wa_usvalues.
ENDLOOP.
DELETE it_usvalues WHERE field = 'X'.
LOOP AT it_usvalues INTO wa_usvalues.
so_org-sign = 'I'.
so_org-option = 'EQ'.
so_org-low = wa_usvalues-von.
APPEND so_org.
CLEAR : wa_usvalues.
ENDLOOP.
ENDIF.
IF so_org IS NOT INITIAL.
IF so_org-low = '*' OR so_org-high = '*'.
REFRESH : so_org.
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org_f4 WHERE orgky IN so_org AND hirar = '1'.
ELSE.
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org_f4 WHERE orgky IN so_org AND hirar = '1'.
ENDIF.
IF it_org_f4[] IS INITIAL.
CLEAR : g_message_v1,g_message_v2.
g_message_v1 = 'Organizational Key'.
g_message_v2 = 'Wrong'.
CONDENSE : g_message_v1,g_message_v2.
MESSAGE e000(zps_msg) WITH g_message_v1 g_message_v2.
ENDIF.
ENDIF.
T527O - Organizational Key Validation
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org_f4 WHERE orgky IN so_org AND hirar = '1'.
T500P - Personnel Areas
T001P - Personnel Area/Subarea
T529U - Staus of employee master
SELECT text1 FROM t529u INTO TABLE it_stat1_f4 WHERE sprsl = 'EN'
AND statn = '2' AND text1 IN so_stat1.
T528T - Position Texts
SELECT SINGLE plstx FROM t528t INTO gs_final1-g15 WHERE sprsl = 'EN' AND otype = 'S' AND plans = lv_p0001-plans.
T530T- Reason for Action Texts
SELECT SINGLE stat1 stat2 massn massg FROM pa0000 INTO ( lv_stat1,lv_stat2,lv_massn,lv_massg ) WHERE pernr = gs_pa0000-pernr "gs_hrp1001-objid
AND begda <= so_date-low AND endda >= so_date-high.
SELECT SINGLE mgtxt FROM t530t INTO gs_final1-g38 WHERE sprsl = 'EN' AND massn = 'Z3' AND massg = lv_massg.
T503T - Employee Subgroup or employee type Table text
SELECT SINGLE ptext FROM t503t INTO gs_final1-g36 WHERE sprsl = 'EN' AND persk = wa_p0001-persk.
********************************************************************************
PS TABLES:
Project Allocation Table
SELECT
otype
objid
rsign
relat
varyf
begda
endda
sobid
prozt
FROM hrp1001
INTO CORRESPONDING FIELDS OF TABLE gt_hrp1001
FOR ALL ENTRIES IN gt_pa0000
WHERE objid = gt_pa0000-pernr
AND begda <= so_date-low AND ENDDA >= so_date-high
AND otype = 'P'
AND sclas = 'PJ' .
CONCATENATE 'PR' gs_hrp1001-sobid INTO gs_hrp1001-sobid.
CONDENSE gs_hrp1001-sobid.
SELECT SINGLE pspnr post1 FROM prps INTO ( lv_ps_posnr,gs_final1-g19 ) WHERE objnr = gs_hrp1001-sobid.
CALL FUNCTION 'CJDW_PRPS_SELECT_SINGLE'
EXPORTING
posnr = lv_ps_posnr
IMPORTING
e_prps = gv_prps
EXCEPTIONS
missing_parameter = 1
not_found = 2
OTHERS = 3.
*****************************************************************************
1.SELECT-OPTIONS: so_emp FOR pa9011-pernr OBLIGATORY ,
* so_date FOR sy-datum NO INTERVALS NO-EXTENSION OBLIGATORY DEFAULT sy-datum,
so_date for sy-datum OBLIGATORY ,
so_org FOR p0001-vdsk1 ,
so_area FOR t500p-name1,
so_sarea FOR p0001-btrtl," MATCHCODE OBJECT hrpad_btrtl,
so_wbs FOR prps-pspnr MATCHCODE OBJECT ash_prpm, " Wbs element
so_cust FOR kna1-kunnr MATCHCODE OBJECT debi, " Customer
so_stat FOR prps-astnr MATCHCODE OBJECT h_tcj05, " billing status
so_stat1 FOR t529u-text1." t529t-mntxt." MATCHCODE OBJECT h_t529a. " employee atatus
SELECTION-SCREEN: END OF BLOCK b1.
2.Initialization
INITIALIZATION.
* Description for the parameter
SO_DATE-LOW = SY-DATUM.
SO_DATE-OPTION = 'BT'.
SO_DATE-SIGN = 'I'.
SO_DATE-HIGH = SY-DATUM.
APPEND SO_DATE.
3.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_org-low.
CLEAR : it_org[].
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org WHERE hirar = '1'.
* SELECT
* persa
* name1
* FROM t500p
* INTO TABLE it_org.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORGKY' "'PERSA'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'SO_ORG-LOW'
value_org = 'S'
TABLES
value_tab = it_org.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_org-high.
CLEAR : it_org[].
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org WHERE hirar = '1'.
* SELECT
* persa
* name1
* FROM t500p
* INTO TABLE it_org.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ORGKY' "'PERSA'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'SO_ORG-HIGH'
value_org = 'S'
TABLES
value_tab = it_org.
4. To check Authorization for Organization Key : p0001-vdsk1
AT SELECTION-SCREEN.
LOOP AT so_org.
TRANSLATE : so_org-low TO UPPER CASE,
so_org-high TO UPPER CASE.
MODIFY so_org.
ENDLOOP.
CLEAR : g_message_v1,g_message_v2,g_message_v3,g_message_v4.
IF so_org-low IS NOT INITIAL.
AUTHORITY-CHECK OBJECT 'P_ORGIN' ID 'VDSK1' FIELD so_org-low.
IF sy-subrc <> 0.
CLEAR : g_message_v1,g_message_v2,g_message_v3,g_message_v4.
g_message_v1 = 'No authorization for'.
g_message_v2 = 'Organizational Key - '.
g_message_v3 = so_org-low.
CONDENSE : g_message_v1,g_message_v2,g_message_v3.
MESSAGE e000(zps_msg) WITH g_message_v1 g_message_v2 g_message_v3.
ENDIF.
ENDIF.
DATA : it_usvalues TYPE TABLE OF usvalues,
wa_usvalues TYPE usvalues.
IF so_org IS INITIAL.
lv_org = 'X'.
CLEAR : it_usvalues[].
CALL FUNCTION 'EFG_USER_AUTH_FOR_OBJ_GET'
EXPORTING
x_uname = sy-uname
x_object = 'P_ORGIN'
TABLES
yt_usvalues = it_usvalues.
ENDIF.
IF it_usvalues[] IS NOT INITIAL.
LOOP AT it_usvalues INTO wa_usvalues.
IF wa_usvalues-field <> 'VDSK1'.
wa_usvalues-field = 'X'.
ENDIF.
MODIFY it_usvalues FROM wa_usvalues INDEX sy-tabix TRANSPORTING field.
CLEAR : wa_usvalues.
ENDLOOP.
DELETE it_usvalues WHERE field = 'X'.
LOOP AT it_usvalues INTO wa_usvalues.
so_org-sign = 'I'.
so_org-option = 'EQ'.
so_org-low = wa_usvalues-von.
APPEND so_org.
CLEAR : wa_usvalues.
ENDLOOP.
ENDIF.
IF so_org IS NOT INITIAL.
IF so_org-low = '*' OR so_org-high = '*'.
REFRESH : so_org.
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org_f4 WHERE orgky IN so_org AND hirar = '1'.
ELSE.
SELECT
orgky
nodty
text1
text2
FROM t527o INTO TABLE it_org_f4 WHERE orgky IN so_org AND hirar = '1'.
ENDIF.
IF it_org_f4[] IS INITIAL.
CLEAR : g_message_v1,g_message_v2.
g_message_v1 = 'Organizational Key'.
g_message_v2 = 'Wrong'.
CONDENSE : g_message_v1,g_message_v2.
MESSAGE e000(zps_msg) WITH g_message_v1 g_message_v2.
ENDIF.
ENDIF.
No comments:
Post a Comment