2008년 12월 23일 화요일

Make some fields invisible at qualification in PPOME

If you are going to make some fields invisible at the qualification tab in PPOME, use the 'administrator' button at the table setting of the ALV.
Or you can use the 'P_ORIGN' authority object for the infotype 0024.




http://help.sap.com/erp2005_ehp_04/helpdata/EN/97/27973b3ea3eb0fe10000000a114084/frameset.htm

[Sample code]CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE


REPORT ZTEST_DYNAMIC_ALV.

TYPE-POOLS: SLIS.

FIELD-SYMBOLS: TYPE STANDARD TABLE,
.

DATA: ALV_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FLDCAT TYPE LVC_T_FCAT.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_FLDS(5) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.

START-OF-SELECTION.

* build the dynamic internal table
PERFORM BUILD_DYN_ITAB.

* write 5 records to the alv grid
DO 5 TIMES.
PERFORM BUILD_REPORT.
ENDDO.

* call the alv grid.
PERFORM CALL_ALV.


************************************************************************
* Build_dyn_itab
************************************************************************
FORM BUILD_DYN_ITAB.

DATA: NEW_TABLE TYPE REF TO DATA,
NEW_LINE TYPE REF TO DATA,
WA_IT_FLDCAT TYPE LVC_S_FCAT.

* Create fields .
DO P_FLDS TIMES.
CLEAR WA_IT_FLDCAT.
WA_IT_FLDCAT-FIELDNAME = SY-INDEX.
WA_IT_FLDCAT-DATATYPE = 'CHAR'.
WA_IT_FLDCAT-INTLEN = 5.
APPEND WA_IT_FLDCAT TO IT_FLDCAT .
ENDDO.

* Create dynamic internal table and assign to FS
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_FLDCAT
IMPORTING
EP_TABLE = NEW_TABLE.

ASSIGN NEW_TABLE->* TO .

* Create dynamic work area and assign to FS
CREATE DATA NEW_LINE LIKE LINE OF .
ASSIGN NEW_LINE->* TO .

ENDFORM. "build_dyn_itab

*********************************************************************
* Form build_report
*********************************************************************
FORM BUILD_REPORT.

DATA: FIELDNAME(20) TYPE C.
DATA: FIELDVALUE(5) TYPE C.
DATA: INDEX(3) TYPE C.
FIELD-SYMBOLS: .

DO P_FLDS TIMES.

INDEX = SY-INDEX.

* Set up fieldvalue
CONCATENATE 'FLD' INDEX INTO
FIELDVALUE.
CONDENSE FIELDVALUE NO-GAPS.

ASSIGN COMPONENT INDEX OF STRUCTURE TO .
= FIELDVALUE.

ENDDO.

* Append to the dynamic internal table
APPEND TO .


ENDFORM. "build_report

************************************************************************
* CALL_ALV
************************************************************************
FORM CALL_ALV.

DATA: WA_CAT LIKE LINE OF ALV_FLDCAT.

DO P_FLDS TIMES.
CLEAR WA_CAT.
WA_CAT-FIELDNAME = SY-INDEX.
WA_CAT-SELTEXT_S = SY-INDEX.
WA_CAT-OUTPUTLEN = '5'.
APPEND WA_CAT TO ALV_FLDCAT.
ENDDO.


* Call ABAP List Viewer (ALV)
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = ALV_FLDCAT
TABLES
T_OUTTAB = .

ENDFORM. "call_alv

2008년 12월 21일 일요일

2008년 12월 19일 금요일

BAdI - HRPAD00INFTY

If you are going to add additional logic to PBO and PAI of PA30, use the BAdI 'HRPAD00INFTY'.

Or you can use the user-exit 'PBAS0001'.

2008년 12월 11일 목요일

P_ABAP authorization for report SAPDBPNP with COARS = 2

Note that an ABAP authorization for report SAPDBPNP with COARS = 2 means that all HR reports based on the logical databases PNP or PAP (nearly all reports) cannot perform any more authorization checks.
In general, you will only want to deactivate the authorization checks for a very small number of Reports. In case of doubt, do not assign your users authorizations for the P_ABAP object.

Examples:
If certain HR reports are not critical (telephone lists and so on) and authorization protection is not required, enter the report name and * in the Degree of Simplification field.
The system then checks the specified reports to see whether the user is authorized to start the report (S_PROGRAM (ABAP: Program Run Checks) authorization object), but perform no other authorization checks.

[Tips] Report RPLINFC0 - Infotype overview for employee

Report RPLINFC0 - Infotype overview for employee

The report is most useful when you need a quick summary of an individual employee's master data.



2008년 12월 10일 수요일

[CASE STUDY] Posting payroll exclude the IT0027 data

[Solution1]
Cost Assignment from Different Infotypes



[Question]

The situation is like following.

This PERNR has body cost center A.But his reguler monthly payroll is posted to cost center B since his IT0027 is input the cost center B with 100% charge and end date is 31.12.9999.

Now on middle of the month, this PERNR get Bonus and input via IT0267.

The issue is how we post this Bonus charge back to cost center A (body cost center) without input the cost assignment data on that Bonus wagetype in IT0267 because this treatment would be run for others many employees who has IT0027 also.And also, any statutory wagetype (Employer portion) that is triggered by this Bonus is also charged to cost center A.


I know exactly how the cost assignment in IT2010 will affect to our posting.
That is same with others infotype like IT0014, 0015, 0267.
Let me make the problem more clear.
In our system, there is so many employee with Cost distribution data (IT0027), especially employee who involved to temporary project/maintenance location.

They also has their own cost center in term of structural organization (IT0001).

When payment the bonus via IT0267 (off cycle - one date), management ask to charge the bonus amount to their master cost center including any wagetype triggered of this bonus like Employer statutory portion.

This employer portion is a technical wagetype and not inputable by dialog screen as bonus wagetype.

If you aware, for those particular employee who has valid IT0027 on the off cycle payment date, all the expense (bonus & employer statutory) will charge based on IT0027 cost object.

So, is there any a way to fulfill the management requirement without maintain all the valid IT0027??

If we use cost assignment in IT0267 and put the body cost center.Result : failed since the Employer statutory wagetype will charge to IT0027 cost object.

If we use cost assignment in IT0267 or IT2010 and update IT0027 by splitting the validity date follow the Bonus payment date.Result : failed since Bonus and Employer statutory wagetype will charge also to to IT0027 cost object.

By this approach, that is will triggered a new problem with reguler/monthly payroll posting.

Or is there any idea how to charge the Bonus amount (IT0267 or IT2010 one date payment) based on one SAME date (or via special subtype) in IT0027 to make as the expecting result posting

2008년 12월 9일 화요일

RP_INFOTYP

The HR_MASTERDATA_DIALOG might need some tweaking.
You can also use the function module 'HR_INFOTYPE_OPERATION'.
Use a custom program on the lines of SAP's 'perform rp_infotyp(sapfp50g)' that is more user-friendly.
=============

PSPAR-DMSNR = DT_P9077-SEQNR.
PSPAR-SEQNR = DT_P9077-SEQNR.
PERFORM RP_INFOTYP(SAPFP50G) USING DT_P9077-PERNR
'DEL' '9077' "PSPAR-INFTY
DT_P9077-SUBTY "PSPAR-NSUBT
SPACE "PSPAR-NOBJP
DT_P9077-BEGDA "PSPAR-NBEGD
DT_P9077-ENDDA "PSPAR-NENDD
L_RCODE. "PSPAR-RCODE
PERFORM REFRESH_P0003_FROM_PS(SAPFP50M).
CLEAR PSPAR-ASKEY.

2008년 12월 5일 금요일

[CASE STUDY] Year-end adjustment , reentry employee

[CASE STUDY] Year-end adjustment , reentry employee

The functions that are used in HKRCYEA0.

HKRCYEA0 - The payment receipt of withholding income tax


1. FUNCTION 'HR_ENTRY_DATE' - to determine the entry date of an employee
2. FUNCTION 'HR_LEAVING_DATE' - to determine an employee's leaving date.
3. FUNCTION 'HR_KR_BUSINESSPLACE_GET_DATA' - Read business place's data according to personnel subarea
4. FUNCTION 'HRCA_COMPANYCODE_GETDETAIL'

2008년 12월 4일 목요일

The authorization objects of the HR (Human Resources) object class

The P_ORGIN object (HR: Master Data) used in the standard system consists of the following fields:

INFTY: Infotype Number
SUBTY: Subtype Number
AUTHC: Authorization Level
WERKS: Personnel Area
PERSG: Employee Group
PERSK: Employee Subgroup
VDSK1: Organizational Key


You can therefore assign authorizations for personnel data in Human Resources at infotype/subtype level according to the employee’s personnel area, employee group, employee subgroup, and organizational key.

Authorization objects for the HR object class:
· P_CH_PK (HR-CH: Pension Fund: Account Access)
·
P_DE_BW (HR-DE: Statements SAPScript)
· P_DK_PBS (HR-DK: Authorization Check for Access to PBS Company)
· P_PYEVDOC (HR: Posting Document)
· P_OCWBENCH (HR: Activities in the Off-Cycle Workbench)
· P_BEN (HR: Benefit Area)
· P_CATSXT (HR: Time Sheet for Service Providers Type/ Level Check)
· P_PE01 (HR: Authorization for Personnel Calculation Schemas)
· P_PE02 (HR: Authorization for Personnel Calculation Rule)
· P_HRF_INFO (HR: Authorization Check InfoData Maintenance for HR Forms)
· P_HRF_META (HR: Authorization Check Master Data Maintenance for HR Forms)
· P_CERTIF (HR: Statements)
· P_APPL (HR: Applicants)
· P_PYEVRUN (HR: Posting Run)
· P_PCLX (HR: Clusters)
· P_DBAU_SKV (HR: DBAU: Construction Pay Germany – Social Fund Procedure)
· P_PCR (HR: Payroll Control Record)
· P_ABAP (HR: Reporting)
· P_ORGIN (HR: Master Data)
· P_PERNR (HR: Master Data – Personnel Number Check)
· P_ORGXX (HR: Master Data – Extended Check)
· P_TCODE (HR Transaction Code)
· P_USTR (HR: US Tax Reporter)
· PLOG (Personnel Planning)
· S_MWB_FCOD (BC-BMT-OM: Allowed Function Codes for Manager’s Desktop)
· P_NNNNN (Customer-Specific Authorization Object)
· P_ORGINCON (HR: Master Data with Context)
· P_ORGXXCON (HR: Extended Check with Context)
· P_NNNNNCON (HR Master Data: Customer-Specific Authorization Object with Context)

The following authorization objects are also important for mySAP HR:
· S_TABU_DIS (Table Maintenance (Using Standard Tools such as SM30))
· S_TABU_CLI (Table Maintenance of Cross-Client Tables)
· S_TABU_LIN (Authorization for Organizational Unit)
· S_TMS_ACT (TemSE: Actions on TemSe Objects)

Finding the list of HR module Tables

All personnel administration tables start with PA and the infotype number behind it.
All personnel development/OM tables start with HRP and infotype (e.g. 1000) behind it.
All recruitment tables start with PB and infotype number behind it.

There also are HR tables that start with HRA, HPD, HRT, etc.

The easy way to get a list is to use SAP's 'Application Hierarchy', transaction SE81 (select all HR modes in the tree that you are want a list of tables for, click on the 'Information System' button, under Abap Dictionary --> Basic Objs, double click on 'database tables', increase your 'maximun no. of hits' and execute).

Use transaction se11...type in PA* do dropdown and enter, do the same for HRP* and you will have most of the HR transaparent Tables.

To access them look for RP_read_* and RP_provide* in Table TRMAC to read a infotype or use the 'select' statement to access the Transparent table.

Transaction SE16 (data browser) is also useful.

As mentioned above, the PA infotype tables all begin with PA and are followed by the infotype number e.g. PA0001 for the Org Man infotype.

PA* - PA infotype tables

PCL* - HR clusters
PB* - recruitment tables
PCERT - payroll posting runs

Another useful table is CATSDB for CATS, and PTEX2000 for the CATS transfer table for infotype 2001/2002.

The rest of the HR Tables are as follows:
DD01L Domains
DD02L SAP tables
DD03L Table Fields
DD03T DD: Texts for fields (language dependent)
DD04L Data elements
DD04T R/3 DD: Data element texts
DD05S Foreign key fields
DD06L Pool/cluster structures
DD20L Matchcode Ids
DD24S Fields of a matchcode ID
T000 Clients
T001 Company Codes
T001E Company code-dependent address data
T001P Personnel Areas/Subareas
T012 House banks
T012K House bank accounts
T012T House bank account names
T500L Personnel Country Grouping
T500P Personnel Areas
T500T Personnel Country Groupings
T501 Employee Group
T501T Employee Group Names
T502T Marital Status Designators
T503 Employee Groups / Subgroups
T503K Employee subgroup
T503T Employee Subgroup Names
T504A Benefits - Default Values (NA)
T504B Benefit Option Texts (North America)
T504C Benefit Type (NA)
T504D Benefit Credit Group Amount
T504E Benefit Amount
T504F Benefit Costs
T508A Work Schedule Rules
T508T Texts for Employee Subgroup Groupings for Work Schedules
T510 Pay Scale Groups
T510A Pay Scale Types
T510F Assign Pay Scale > Time Unit, Currency
T510G Pay Scale Areas
T510H Payroll Constants with Regard to Time Unit
T510I Standard Working Hours
T510J Constant Valuations
T510L Levels
T510M Valuation of pay scale groups acc. to hiring date
T510N Pay Scales for Annual Salaries (NA)
T510S Time Wage Type Selection Rule
T510U Pay Scale Groups
T510Y Special Rules for Wage Type Generation
T511 Wage Types
T512R Cumulation Wage Types in Forms
T512S Texts for Cumulation Wage Types in Forms
T512T Wage Type Texts
T512W Wage Type Valuation
T512Z Permissibility of Wage Types per Infotype
T513 Jobs
T514S Table Name Texts
T514T Field Name Texts
T51D2 Wage Type Classes
T51D3 Reduction Rules
T51D4 Cumulation Rules
T527X Organizational Units
T528B Positions - Work Centers
T528C Wage Type Catalog
T528T Position Texts
T529A Personnel Event
T529F Fast Data Entry for Events
T529T Personnel Event Texts
T52BT Texts For HR Objects
T52C0 Payroll Schemas
T52C1 Payroll Schemas
T52C2 Texts for Personnel Calculation Schemas
T52C3 Texts for Personnel Calculation Schemas
T52C5 Personnel Calculation Rules
T52CC Schema Directory
T52CD Schema Directory
T52CE Directory of Personnel Calculation Rules
T52CT Text Elements
T52CX Cross References via Generated Schemas
T52D1 Valid Processing Classes
T52D2 Valid Values for Processing Classes
T52D3 Valid Evaluation Classes
T52D4 Permitted Values for Evaluation Classes
T52D5 Wage Type Groups
T52D6 Wage Type Group Texts
T52D7 Assign Wage Types to Wage Type Groups
T52D8 Valid Processing Classes - Texts
T52D9 Valid Values for Processing Classes - Texts
T530 Reasons for Events
T530E Reasons for Changes
T530F Reasons for Changes
T530L Wage Types for Special Payments
T530T Event Reason Texts
T531 Deadline Types
T531S Deadline Type Texts
T533 Leave Types
T533T Leave Type Texts
T539A Default Wage Types for Basic Pay
T539J Base Wage Type Valuation
T539R Events for Standard Wage Maintenance
T539S Wage Types for Standard Wage Maintenance
T548 Date Types
T548S Date Conversion
T548T Date Types
T548Y Date Types
T549A Payroll Areas
T549B Company Features
T549C Decision Trees for Features (Customers)
T549D Feature Directory
T549L Date modifiers
T549M Monthly Assignment: Payroll Period
T549N Period Modifiers
T549O Text for date modifier
T549P Valid Time Units for Payroll Accounting
T549Q Payroll Periods
T549R Period Parameters
T549S Payroll date types
T549T Payroll Areas
T549M Monthly Assignment: Payroll Period
T549N Period Modifiers
T549O Text for date modifier
T549P Valid Time Units for Payroll Accounting
T549Q Payroll Periods
T549R Period Parameters
T549S Payroll date types
T549T Payroll Areas
T554S Absence and Attendance Types
T554T Absence and Attendance Texts
T554V Defaults for Absence Types
T554Y Time Constraints in HR TIME
T555A Time Types
T555B Time Type Designations
T559A Working Weeks
T559B Name of Working Week
T572F Event Texts
T572G Allowed Values for Events
T572H Event Value Texts
T582A Infotypes
T582B Infotypes Which Are Created Automatically
T582S Infotype Texts
T582V Assignment of Infotypes to Views
T582W Assigns Infotype View to Primary Infotype
T582Z Control Table for PA Time Management
T584A Checking Procedures - Infotype Assignment
T588A Transaction Codes
T588B Infotype Menus
T588C Infotype Menus/Info Groups
T588D Infogroups for Events
T588J Screen Header Definition
T588M Infotype Screen Control
T588N Screen Modification for Account Assignment Block
T588O Screen Modification for Assignment Data
T588Q Screen types for fast entry
T588R Selection Reports for Fast Data Entry
T588S Screen Types for Fast Entry
T588T Menu and Infogroup Designations
T588V Business object type
T588W Event types for infotype operations
T588X Cust. composite definition of event types for IT operations
T588Z Dynamic Events
T591A Subtype Characteristics
T591B Time Constraints for Wage Types
T591S Subtype Texts
T596F HR Subroutines
T596G Cumulation wage types
T596H _Cumulation wage type texts
T596I Calculation rule for cumulation wage types
T596U Conversion Table
T599B Report Classes
T599C Report Classes
T599D Report Categories
T599F Report Classes - Select Options
T777A Building Addresses
T777T Infotypes
T777Z Infotype Time Constraints
T778T Infotypes
T778U Subtypes

Error Messages tables
T100 Messages
T100A Message IDs for T100
T100C Control of messages by the user
T100O Assignment of message to object
T100S Configurable system messages
T100T Table T100A text
T100V Assignment of messages to tables/views
T100W Assign Messages to Workflow
T100X Error Messages: Supplements
======================================
the original writer chakri

2008년 12월 1일 월요일

Reading a Feature(PE03) with Field Return

[Classes]
Name: CL_HRPAY99_POSTING_ENGINE_PP
Example: RPCIPE00( Posting to Accounting: Create Posting Run)
Method: CL_HRPAY99_POSTING_ENGINE_PP =>GET_MOMAG(Determines MOMAG)

[Functions]
Name: HR_FEATURE_BACKFIELD(Reading a Feature with Field Return)
Example1: CL_HRPAY99_POSTING_ENGINE=>GET_MOMAG

Example2

READ TABLE GT_WPBP INTO GS_WPBP INDEX 1.

IF SY-SUBRC = 0.
CALL FUNCTION 'HR_FEATURE_BACKFIELD'
EXPORTING
FEATURE = 'PPMOD'
STRUC_CONTENT = GS_WPBP
IMPORTING
BACK = GS_TAB-MOMAG.
ENDIF.