Price in Reservation

Hi all,
There's a price field in the reservation table (RESB). This field is just filled when I enter Goods Issue with reference to reservation?
When i enter goods issue with reference to reservation with 1 quantity the price is come from moving average price but when i enter 2 quantities the price is Total value/ Total stock in material master.  Why this happens? Problems of rounding?
Thanks,
CM

Hi,
Moving Average Price will keep on change for every goods receipt. While you do goods issue, the material will take this moving average price as the material cost. The calculation of MAP is
Moving Average Price = Total value of the stocks / Total number of stocks (in storage location)
The price difference during MAP will go to stock account if sufficient amount of stock is there in storage location or it will go to price difference account.
Standard Price can be changed during purchase orders and the price difference will go to price difference account (PRD).
Regards,
Rahul.

Similar Messages

  • Sales order price with normal stock as well as Reserve stock

    Dear all
    i have different situation in stock reserving plz let me know
    i am explaining whole scenario plz tell me how to proceed
    ex: customer agreed To buy the stock around 500 qnt so i have kept stock reserve on  jan 15th 500 qnty ( by using 412 e )
    At theat time price is 10 rs per one so totally 500*10=5000
    Now after 3 days i mean 18th price increased 15 rs per one
    now total price is 500*15=7500
    in copy control price type is maintained carry out new pricing
    user created one sales order with 1000 qnty
    now what he wants system should bring old price for 500 qnty (500*10=5000) And remaining 500 qnty with new price (500*15=7500)
    I told as per my knowledge System will bring old price only for reserved stock if you want to apply new price for reserved stock just 411 e return the stock from reservation and now create sales order
    i hope this right
    But here imp thing is how price is calculated if different type of price is there for same material
    i have created one sales order with 1000 qnty ( 500 reserv stock +500 Normal stock ) here how price is calculated i mean schedule lines will be different
    bz for 500 one price and remaining 500 another price but in one line
    Is it possible to calculate price like this 500*10=5000+(500*15=7500) =12500 rs
    is this possible ?
    plz let me know this process how to proceed and tell me You have any doubts
    thanks a lot

    Maintain a condition record for Rs.10/- with a validity date (only as an example) as 1st March'14 to 15th March'14.  Another condition record for Rs.15/- with validity date as 16th March'14 to 31st March'14.
    Now create a sale order for 500 nos. with one line item and change the pricing date as 15th March'14.  Similarly, create another line item for the same material with 500 nos. and here, change the pricing date as 16th March'14 at line item level.  By doing so, system would fetch the pricing in billing accordingly.
    I told as per my knowledge System will bring old price only for reserved stock if you want to apply new price for reserved stock just 411 e return the stock from reservation and now create sales order
    i hope this right
    Your understanding is incorrect.  System will never validate pricing based on age of the stocked material but based on validity period what you maintain in condition record.
    G. Lakshmipathi

  • Read Sales Order Price with Pricing Date (PRSDT)

    Hello ABAP Gurus,
    I have once requirements and is, I need to extract sales order prices with a given Pricing Date (PRSDT).
    Could you please tell me if these is Function Module or BAPI that I can use?
    Regards,
    Murali

    Maintain a condition record for Rs.10/- with a validity date (only as an example) as 1st March'14 to 15th March'14.  Another condition record for Rs.15/- with validity date as 16th March'14 to 31st March'14.
    Now create a sale order for 500 nos. with one line item and change the pricing date as 15th March'14.  Similarly, create another line item for the same material with 500 nos. and here, change the pricing date as 16th March'14 at line item level.  By doing so, system would fetch the pricing in billing accordingly.
    I told as per my knowledge System will bring old price only for reserved stock if you want to apply new price for reserved stock just 411 e return the stock from reservation and now create sales order
    i hope this right
    Your understanding is incorrect.  System will never validate pricing based on age of the stocked material but based on validity period what you maintain in condition record.
    G. Lakshmipathi

  • HR-ABAP Material

    Dear all,
    Kindly Provide me HR-ABAP Material.
    Points will be Awarded for sure...!!!

    Hi
    HR:
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    For Personal Admn the Infotypes start with PA0000 to PA1999
    Time Related Infotypes start with PA2000 to PA2999.
    Orgn related Infotypes start with HRP1000 to HRP1999.
    All custom developed infotypes stsrat with PA9000 onwards.
    In payroll processing we use Clusters like PCL1,2,3 and 4.
    Instead of Select query we use PROVIDE and ENDPROVIDE..
    You have to assign a Logical Database in the attributes PNP.
    Go through the SAp doc for HR programming and start doing.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    Also,
    Few notes are below:
    InfoSets in the HR Application
    You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
    InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
    If you want to create InfoSets for HR, you can use logical databases PNP, PNPCE, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    The reports you can execute using InfoSets based on logical databases PNP (or PNPCE) or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
    Logical database PNP/PNPCE* PCH PAP
    Selection of Persons Objects from Personnel Planning Applicants
    Infotypes that can be included in the InfoSet Infotypes for· Personnel Administration (0000-0999) · Time Management (2000-2999) · Payroll infotypes · Infotypes for Personnel Planning objects that can be related to persons If the object type is specified:· Infotypes for the object type · Infotypes for objects that can be related to the specified object typeIf the object type is not specified:· All infotypes · Infotypes for Recruitment (4000-4999)· Some infotypes for Personnel Administration (such as 0001 and 0002)
    · Customer infotypes
    Reporting examples · Selection of all persons who participated in a specific business event, output of prices for reserved business events · Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons · Selection of all business events held in London in March, output of all persons who participated in these business events · Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions · Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
    Logical database PNPCE (PNP Concurrent Employment) functions just like logical database PNP. The procedure for creating InfoSets is also the same. It only becomes significant if you work with Concurrent Employment.
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
    1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
    2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
    3. Choose .
    This takes you to the Infotype Selection for InfoSet  screen. You now have the option of creating field groups and assigning fields as required for non-HR InfoSets. Field groups that correspond to infotypes and already contain fields, however, are always created for HR InfoSets. The field groups are displayed in an overview tree in the top right section of the screen.
    The infotypes that you included in the InfoSet are displayed in an overview tree on the left of the screen. The infotype fields that are already included in field groups are displayed in a different color, and the corresponding field group ID is displayed.
    In the standard system, a field group is created automatically for each infotype that you included in the InfoSet (a field group corresponds to an infotype).
    In the standard system, each field group contains the infotype-specific fields. To ensure that working with the InfoSet is as easy as possible, you are advised to restrict your use of fields in each field group to those you really require. This means you should remove fields that are not required.
    An infotype's fields must only be assigned to the pertinent field group. Make sure this assignment is correct. If the assignment is incorrect, the InfoSet could be rendered unusable.
    When an InfoSet is created, the following fields are transferred automatically to the first field group:
    § Logical database PNPCE or PNP Personnel number
    § Logical database PAP Applicant number
    § Logical database PCH Object ID, plan version, and object type
    6. Determine the fields that must be included in the field groups of your InfoSet. If you require further information, see Assigning Fields to a Field Group.
    If you want, you can change the default sequence of field groups and fields as required using Drag&Drop.
    7. To save the InfoSet, choose .
    8. To generate the InfoSet, choose .
    On the Change InfoSet (InfoSet name) screen, you can choose Edit ® Change infotype selection to add more infotypes to the InfoSet, or to remove infotypes from the InfoSet. Remember to regenerate the InfoSet afterwards.
    This screen also enables you to update InfoSets if, for example, the system contains new additional fields for specific key values. To do so, choose InfoSet ® Additional functions ® Update additional HR fields.
    9. Go back to the initial screen for InfoSet maintenance.
    10. Choose User group assignment.
    11. Select a user group, and save your entry.
    sample code
    START-OF-SELECTION.
    GET pernr.
    rp_provide_from_frst p0000 space pn-begda pn-endda.
    if pnp-sw-found EQ '1'.
    READ TABLE p0001 WITH KEY pernr = p0000-pernr.
    if sy-subrc = 0.
    write : p0001-plans. " earliest.
    endif.
    endif.
    rp_provide_from_last p0014 space pn-begda pn-endda.
    if pnp-sw-found EQ '1'.
    READ TABLE p0014 WITH KEY pernr = p0000-pernr.
    if sy-subrc = 0.
    write : p0014-LGART. .
    endif.
    endif.
    Also this is HR_data structure.
    Enterprise Structure
    Definition
    Structure of company according to personnel administrative, time management and payroll perspectives from the point of view of your own company
    The company structure describes elements of the company and there dependencies.
    Structure
    The enterprise structure in Personnel Administration consists of the following:
    Client
    The client is, in accordance with commercial law, an organizational and data technical isolated unit within the R/3 System, with separate master records and its own separate record of tables. A client’s area of jurisdiction can correspond to a unit as small as a company, or as large as an entire enterprise.
    Company code
    The company code is the smallest organizational unit of external accounting in which a complete and isolated financial accounting can be created. All events that affect the company code and the creation of all statements for a legal financial statement, for example balances, profit and loss calculation are contained within the company code organizational units.
    Personnel area
    The personnel area is an organizational unit; according to a personnel administrative, time management and payroll organizational point of view, a personnel area represents a delimited enterprise area. The personnel area is only used in Personnel Administration and is unique within a client.
    Personnel areas are sub-divided into personnel subareas. Organizational data and guidelines as how to assign it, are stored on a personnel area and personnel subarea level. The rules and guidelines could be of a legal, pay scale and collective agreement, or internal nature. A personnel area is assigned to a company code which has the financial accounting values that are relevant for the personnel area. A pay scale area, a pay scale type and a public holiday calendar are precisely defined for a personnel subarea.
    Example
    The personnel area in a software company can be subdivided into development, training and administration personnel subareas.
    Personnel subarea
    The personnel subarea is only used in Personnel Administration. The groupings linked to the personnel subarea determine which entries from the subsequent screen are allowed for an employee of a particular company code/personnel area.
    Groupings are used for validation of master and time data. Groupings are also used to check the plausibility of data that you enter.
    Organizational key
    The organizational key enables you to define the organizational assignment more exactly. The organizational key can consist of elements from the enterprise structure and personnel structure.
    If you require further information on the corporate structure, please see the Elements of the Enterprise Structure section.
    Integration
    The Hiring personnel action enables you to assign employees to the enterprise structure. The data is stored in the Organizational Assignment (0001) infotype. This infotype is essential for authorization checks.
    http://help.sap.com/saphelp_47x200/helpdata/en/48/35c3ea4abf11d18a0f0000e816ae6e/frameset.htm
    Personnel Structure
    Definition
    Describes an employee’s position in a company from the individual employee’s view.
    Structure
    The personnel structure can be considered from two perspectives:
    administrative perspective
    organizational perspective
    The Structure link administrative personnel structure consists of the following elements:
    Employee group
    Employee subgroup
    Payroll area
    Organizational key
    The extent of the distinction that you make between employee groups and employee subgroups depends on your evaluation and access protection requirements.
    The organizational key consists of a part of both the enterprise structure and the personnel structure. The elements employee group and employee subgroup could also be relevant in forming the organizational key.
    The Structure link organizational personnel structure consists of the following elements:
    Position
    Job
    Organizational unit
    Integration
    To assign an employee to the personnel structure, use the Hiring personnel action. The data is stored in the Structure link Organizational Assignment (0001) infotype. This infotype is essential for authorization checks.
    http://help.sap.com/saphelp_47x200/helpdata/en/48/35c3ea4abf11d18a0f0000e816ae6e/frameset.htm
    kindly reward if found helpful.
    kushagra

  • ABAP HR MATERIAL REQUIRED

    HI FRIENDS,
    CAN ANYONE SEND ME THE ABAP-HR MATERIAL .
    THAXS AND REGARDS.
    HITESH

    Maybe this link can be helpfull
    http://www.sapdevelopment.co.uk/hr/hr_infotypes2.htm
    Have a look at http://www.sap-img.com/human/how-to-create-a-hr-infotype.htm, but have also a look at this thread
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FthreadID%3D9945%26messageID%3D63016
    found this link probably can be helpful to someone
    http://help.sap.com/saphelp_46b/helpdata/en/f7/2fe034ee251f34e10000009b38f83b/frameset.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-hr/how-to-create-z-infotype-in-organizational-management-745603
    How to create a HR infotype?
    1) Go to Transaction PM01. 
    2) Enter the custom Infotype number which you want to create (Should be a 4 digit number, start with 9). 
    3) Select the ‘Employee Infotype’ radio button. 
    4) Select the ‘PS Structure Infotype’. 
    5) Click on Create… A separate table maintenance window appears… 
    6) Create a PS structure with all the fields you want on the Infotype 
    7) Save and Activate the PS structure 
    8) Go back to the initial screen of PM01. 
    9) Click on ‘All’ push button. It takes a few moments. 
    10) Click on ‘Technical Characteristics’. Infotype list screen appears 
    11) Click on ‘Change’(pencil) button 
    12) Select your Infotype and click on ‘Detail’ (magnifying glass) button 
    13) Give ‘T591A’ as subtype table 
    14) Give ‘T591S’ as subtype txt tab 
    15) Give your subtype field as subtype field 
    16) Save and come back to PM01 initial screen 
    17) Click on ‘Infotype Characteristics’ … Infotype list screen appears 
    18) Click on ‘Change’ (pencil) button 
    19) Click on ‘New Entries’ 
    20) Enter your Infotype number and short text 
    21) Here we have to set different Infotype Characteristics as per the requirement. (Better open another session with some standard Infotype’s infotype characteristics screen and use as the reference to fill yours) 
    22) Save your entries. 
    23) Now the Infotype is created and ready to use. 
    24) If you want to change the layout of the Infotype as per your requirement… 
    25) In the PM01 initial screen…Select ‘Screen’ radio button and give 2000 as the screen name, then click on edit. 
    26) In the next screen.. Select ‘Layout Editor’ and click ‘Change’. 
    27) Screen default layout appears…here you can design/modify the screen..change the attributes of the fields..etc. 
    28) Save and activate. (Don’t forget to ‘Activate at every level) 
    InfoSets in the HR Application 
    You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
    InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
    If you want to create InfoSets for HR, you can use logical databases PNP, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    The reports you can execute using InfoSets based on logical databases PNP or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
    Logical database     PNP     PCH     PAP
    Selection of     Persons     Objects from Personnel Planning     Applicants
    Infotypes that can be included in the InfoSet     Infotypes for
    •     Personnel Administration (0000-0999)
    •     Time Management (2000-2999)
    •     Payroll infotypes
    •     Infotypes for Personnel Planning objects that can be related to persons     If the object type is specified:
    •     Infotypes for the object type
    •     Infotypes for objects that can be related to the specified object type
    If the object type is not specified:
    •     All infotypes     •     Infotypes for Recruitment (4000-4999)
    •     Some infotypes for Personnel Administration (such as 0001 and 0002)
         •     Customer infotypes
    Reporting examples     •     Selection of all persons who participated in a specific business event, output of prices for reserved business events
    •     Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons     •     Selection of all business events held in London in March, output of all persons who participated in these business events
    •     Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions     •     Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
    1.     On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose  Create.
    2.     On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
    3.     Choose  .
    This takes you to the Infotype Selection for InfoSet .
    The logical HR database uses the table APPLICANT. You must declare it in the TABLES statement.
    At the GET APPLICANT event, the APPLICANT structure contains the data for an applicant number chosen on the basis of selection screen entries.
    The APPLICANT-APLNO field contains the applicant number which is selected for processing.
    Only the APPLICANT-APLNO field should be read from the work area of the APPLICANT table. The other fields are intended for internal use only.
    2.7     Authorization Checks in Reporting (PA-APP)
    Generally, authorization checks in reporting do not differ from those in the transactions. Since data access in reporting is always of the read type, the system checks for a read authorization; the authorization group must be R or *.
    In some situations, you may want to use a simplified authorization check when running reports. The object RPABAP is required for the check as well as the object RPORGIN; if these authorizations are available, a simpler and faster check is performed.
    If the report cannot read certain applicant data due to lack of authorization, data for these persons is not processed at the GET APPLICANT time point. A note appears at the end of the list stating the number of applicants who were skipped due to lack of authorization.
    2.8     Views
    Introduction
    When evaluating data, we distinguish between the logical and the physical view.
    The physical view corresponds to the form in which the infotype data is stored in the HR tables. This data is stored in infotype records with a validity period.
    In the logical view, the validity periods of individual fields are determined for several infotype records. For example, for an evaluation, the time period during which an employee worked at a particular job may be important, irrespective of whether a company code, personnel area or cost center change occurred during this time.
    Data from several infotypes can also be provided for a specific partial period. When calculating partial payroll periods, it is especially important that data on basic pay, work schedule and cost distribution are provided for the relevant partial period.
    These two types of logical views are implemented in the projection and join.
         Join
         Projection
         Join and Projection
         Time-Dependent Control Tables
         Generalization of the View
    Join
    A join processes records from two or more infotypes. The data from these infotypes is provided for a specific partial period.
         We would like to know in which time period an employee worked at which job and at which address he or she resided during this time.
    The following address data is available:
    January – June     Hamburg
    June – December     Munich
    The following work center data is available:
    January – April     Programmer
    May – December     Course instructor
    If the address and work center data are provided for specific partial periods, the following cases result:
    January – April     Hamburg / programmer
    May – June     Hamburg / course instructor
    July – December     Munich / Course instructor
    The ABAP syntax of this join is as follows:
    PROVIDE * FROM Pomp
    FROM Pnnnn
            BETWEEN PN-BEGDA AND PN-ENDDA.
    The partial periods for infotypes Pomp and Pnnnn as well as for all other infotypes of the join are defined in the fields BEGDA and ENDDA.
    The data of each infotype in the join must be available during the entire validity period of the infotype. The time periods of infotype records may not overlap; therefore, the join may not contain infotypes with time constraint "three".
    The time periods of records overlap if an infotype is read without any subtype restrictions. For example, the Address infotype has the subtypes Permanent residence, Temporary residence and Home address.
    Time periods will ultimately overlap if all addresses are read. Therefore, you must always select a subtype for a join, and this subtype may not have the time constraint "three".
    The program code for the above join for work center and address data is as follows:
    REPORT RPABAP03.
    TABLES: PERNR.
    INFOTYPES: 0001, 0006.
    GET PERNR.
      PROVIDE * FROM P0001
    FROM P0006 BETWEEN PN-BEGDA AND PN-ENDDA
              WHERE P0006-SUBTY eq '1'.
        WRITE: / PERNR-PERNR, P0001-STELL,
                 P0006-STRAS, P0006-BEGDA, P0006-ENDDA.
      ENDPROVIDE.
    Sometimes no data is available for a particular infotype in the selected partial period. Infotype validity periods may not overlap but gaps are permitted.
    For example, gaps can occur when personal data is joined with address data:
    Personal data
    January 1960 - May 1998     Miller
    May 1998 - December 1998     Smith
    Address data:
    January 1998 - December 1998     Hamburg
    A join for personal and address data is presented as follows:
    January 1960 - December 1997     Miller
    January 1998 - April 1998     Miller / Hamburg
    May 1998 - December 1998     Smith / Hamburg
    Only personal data is available in the first partial period. Since the record does not provide the required information, the join's function of providing data from all associated infotypes has not been fulfilled.
    The variables Pnnnn_VALID recognize that only incomplete data is available for a particular partial period.
    This variable is formed when the report is run for each Pnnnn infotype included in a join.
    If data exists in the partial period for the Pnnnn infotype, the variable Pnnnn_VALID is filled with X.
    These variables are evaluated as follows:
    REPORT RPDEMO03.
    TABLES: PERNR.
    INFOTYPES:  0002,
                0006.
    GET PERNR.
      PROVIDE * FROM P0002
    FROM P0006 BETWEEN PN-BEGDA AND PN-ENDDA
              WHERE P0006-SUBTY = '1'.
        IF P0006_VALID EQ 'X'.
          WRITE:  /  PERNR-PERNR,
                     P0002-BEGDA DD/MM/YYYY,
                     P0002-ENDDA DD/MM/YYYY,
                     P0002-NACHN,
                     P0006-ORT01.
        ENDIF.
      ENDPROVIDE.
    A list is generated only if address data is available. The first partial period, for which only personal data is available, is suppressed.
    Projection
    All data of an infotype is stored on the database with its period of validity.
    When you change one or more fields of an infotype record, the system creates a new record with a new validity period. The date on which you changed the record is the start date of this new record.
    Therefore, the data fields that are not affected by the changes contain the same data over several infotype records and validity periods.
    From a logical perspective, these fields are valid in all infotype records until they are changed. 
    When seen from this logical perspective, each field of an infotype has its own validity period.
    This is illustrated in the following case:
    An employee has worked as a programmer for three years in three different personnel areas.
    The following organizational assignment data is available:
    January 1992 - December 1992: Programmer /personnel area 1
    January 1993 - December 1993: Programmer /personnel area 2
    January 1994 - December 1994: Programmer /personnel area 3
    If you only require the time period during which an employee performs a specific job and not his or her personnel area for an evaluation, the following applies:
    January 1996 - December 1998: Programmer
    The physical view has three infotype records, the logical view one.
    To create meaningful evaluations and avoid redundancies, create logical views for infotype records.
    Select the infotype fields that are important for the evaluation and disregard the others.
    In the above example, the data in the other fields is invalid for the evaluation since it is unknown which personnel area the employee belonged to from 1996 - 1998.
    This view of the validity period of a group of infotype fields is known as projection.
    The program code for the projection is:
    PROVIDE  FROM Pnnnn
      BETWEEN PN-BEGDA AND PN-ENDDA .
    The infotype data for a projection must be available throughout the entire validity period. If the time periods of certain infotype records overlap, the data cannot be clearly assigned to one period.
    Therefore, you should not use projections for infotype records with time constraint ‘three’. The report for the above projection is:
    REPORT RPABAP04.
    TABLES: PERNR.
    INFOTYPES: 0001.
    GET PERNR.
       PROVIDE STELL FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.
         WRITE: / PERNR-PERNR, P0001-STELL, P0001-BEGDA,
                 P0001-ENDDA.
       ENDPROVIDE .
    The logical validity for the activity period is included in the infotype BEGDA and ENDDA fields.
    Join and Projection
    You can combine the two logical views of infotype data, the join and the projection.
    We read the data from several infotypes and create new partial periods. We select the infotype fields that are important for the evaluation and combine these partial periods again.
    The following example illustrates this.
    An employee works as a programmer in the current year and marries in May. Her name does not change.
    Organizational assignment:
    January - December     Programmer
    Personal data:
    January - April     Donna Debug - single
    May - December     Donna Debug - married
    When the data from both infotypes is read concurrently, the result is:
    January - April     Donna Debug - single /
    programmer
    May - December     Donna Debug - married /
    programmer
    Since we can disregard her marital status in the evaluation, we project on her first and last names:
    January - December     Donna Debug / programmer
    The following report exemplifies the above case:
    REPORT RPDEMO04.
    TABLES: PERNR.
    INFOTYPES:  0001,
                0002.
    GET PERNR.
      PROVIDE STELL FROM P0001
        NACHN VORNA FROM P0002
        BETWEEN PN-BEGDA AND PN-ENDDA
        IF P0001_VALID = 'X'.
          WRITE:  / P0002-NACHN, P0002-VORNA,
                    P0001-BEGDA DD/MM/YYYY,
                    P0001-ENDDA DD/MM/YYYY,
                    P0001-STELL.
        ENDIF.
      ENDPROVIDE.
    This report combines the associated validity periods and provides the data of relevant infotype fields for a specific period.
         Fields which are not accessed have their initial value in the projection.
    Provision of data for a specific partial period is especially important for partial period factoring in payroll.
    If an employee's basic pay or the cost distribution changes during the payroll period, you must calculate the salary proportionately for the resulting partial periods.
    However, if the payroll administrator of the organizational unit changes, this has no effect on payroll.
    By linking a join and a projection, you can read the master data for a specific partial period.
    Time-Dependent Control Tables
    Infotype data is generally coded as a key (for example, infotype P0006, address type 1 = permanent residence) to allow fast data entry and space-saving storage. When you process infotypes, the texts or attributes of the keys are read from the relevant control tables.
    In many control tables, storage of data is time-dependent and therefore assigned a validity period.
    In HR, this applies to the following areas:
    •     Work schedules
    •     Pay scale structures
    •     Wage types
    •     Wage type valuation
    •     Bank data
    •     Positions
    •     Payee codes
    When you read the data for an infotype key from time-dependent control tables, you must determine which record is valid in the specified validity period.
    If you use a transaction to process an infotype, the system reads the table record which is valid on the start date.
    Generalization of the View
    You can use the logical view to edit and output data according to user specifications.
    The special feature of HR views is the time dependency of the data. Personnel data is almost always related to specific validity periods. A HR view provides data for specific time intervals.
    In general terms, a HR view is a logical perspective of interval-dependent internal tables.
    See also:
    Processing All Infotype Records (PA-PAD)
    Processing All Infotype Records (PA-APP)
    Processing a Specific Infotype Record (PA-PAD)
    Processing a Specific Infotype Record (PA-APP)
    3     Import/Export Files in HR
    The following sections describe the purpose of files PCL1 and PCL2 and explains how to access them.
    Files PCL1, PCL2, PCL3 and PCL4
    Storing Data in PCLn Files
    PCLn Buffer
    Cluster Directory Manager
    3.1     Files PCL1, PCL2, PCL3 and PCL4
    Which information is stored in the files?
    File PCL1 is the basis for the HR work area data. It contains information from the time data recording, for example, incentive wage time tickets or infotype supplement texts.
    File PCL2 contains derived information, for example, payroll results. It also contains all generated payroll schemas.
    File PCL3 contains applicant data.
    File PCL4 contains the change documents for HR master data and recruitment.
    The structure of PCLn files corresponds to that of the INDX file which you may be familiar with from other applications. The structure of all PCLn files (n = 1, 2, 3, and 4) is identical.
    Structure of Files
    Like in almost all SAP files, the key element with the highest priority is the client; data within a client is grouped according to basic relations (field PCLn-RELID).
    The type of basic relation is known as a cluster and characterizes the stored data according to the type, for example, cluster RX contains the payroll result for country X (from table T500L) and cluster TE contains the trip costs data.
    Depending on the cluster, the structure of PCLn-SRTFD is defined in a field string xx-KEY, which is defined in an include RPCnxxy0.
    Naming conventions
    n = 1, 2, 3, or 4 (for PCL1, PCL2, PCL3, or PCL4)
    xx = for the cluster
    y = 0 for international clusters
    y = country grouping according to T500L for national clusters
    The personnel number is usually the first component of xx-KEY.
    Importing and Exporting Data
    The import/export files PCLn are managed with the ABAP/4® commands IMPORT and EXPORT . These commands store objects such as fields, field strings, or internal tables on the database, or read these from the database. Data is read from and written to the database using a unique key( xx-Key).
    Please note that the RMAC macros RP-IMP-Cn-xx and RP-EXP-Cn-xx are provided for importing and exporting data. Only these macros should be used.
    See also Macro Modules
    3.2     Storing Data in PCLn Files
    Data from the different HR application areas is stored in data clusters in PCLn files (n = 1, 2, 3, or 4).
    This collection of data objects can consist of:
    •     Fields used within reports
    •     Field strings
    •     Internal tables
    The structure of the PCLn files provides a framework for the individual application areas.
    Each application area must have a two-character cluster name (relation ID). It must also have a key structure; 40 bytes of the SRTFD field are available for this structure.
    When a record is exported to the PCLn file, the cluster ID is written to the RELID field and the key value to the SRTFD field.
    Naming convention for includes when defining clusters:
    RPCnxxy0 n = 1, 2, 3 or 4 (for PCL1, PCL2, PCL3, PCL4)
    xx = cluster ID
    y = country indicator
    Description of Cluster Data using Cluster RX as an Example
    The data definition is stored in the include RPC2RX00 in accordance with the above naming conventions.
    Structure of cluster key:
      Data:  BEGIN OF RX-KEY.
               INCLUDE STRUCTURE PC200.
             DATA: END OF RX-KEY.
    The DDIC structure PC200 contains the fields PERNR (personnel number) and SEQNO (sequential number).
    The data definition of the cluster also contains other internal tables.
    For a list of available data clusters, refer to the domain description in the Data Dictionary.
    xx Key
    The xx key name is dependent on the cluster.
    The RX KEY is used for all Rx and Xx clusters. In all other cases, the name of the xx key corresponds to that of the cluster.
    Cluster     xx Key
    RA     RX-KEY
    B1     B1-KEY
    G3     G3-KEY
    XA     RX-KEY
    3.3     PCLn Buffer
    To keep the number of database accesses to a minimum, import and export data is stored in the main memory buffer. Buffer management routines ensure that exported data can be stored in the PCLn files.
    The following two examples illustrate which problems can occur without a buffer.
    Retroactive accounting of payroll results
    Starting payroll in the test mode
    Retroactive Accounting of Payroll Results
    In February 1998, a retroactive accounting run is executed for January.
    FOR PERIOD 199801 IN PERIOD 199802
    The payroll results for January are recalculated and then written directly to the database.
    Result:
    The database now contains the results of the following payroll periods.
    FOR-PERIOD 199801 IN-PERIOD 199802
    FOR-PERIOD 199801 IN-PERIOD 199801
    Payroll is then run for February.
    FOR-PERIOD 199802 IN-PERIOD 199802
    If problems should arise during the payroll run for this period, the February record is not stored on the database.
    Result:
    The current January record on the database is:
    FOR-PERIOD 199801 IN-PERIOD 199802
    This problem does not arise if you use the buffer since all data of a transaction is always updated collectively. In the above example, the recalculated January result would be stored in the buffer and, if the payroll run for February were terminated prematurely, the database would not be updated.
    The current January record on the database would thus be:
    FOR-PERIOD 199801 IN-PERIOD 199802
    Starting Payroll in the Test Mode
    In a test run, the database is not updated. Since the payroll results from the previous period are used as the basis for calculating the results of the following period, the results of the actual payroll run would differ from those of the test run, if this test run were executed over several periods.
    The use of the buffer enables trouble-free access to the required results for the previous period.
    What is required for exporting/importing data to/from the PCLn files using the buffer?
         The following includes contain the data definition for the buffer. They must be included in the report that writes the data to or reads the data from the database.
    RPPPXD00
    RPPPXD10
         Include RPPPXD10 must be in the common part ‘BUFFER’ .
    Include RPPPXM00, which contains the buffer management routines, is also required.
    The macros for importing and exporting data must comply with the following naming convention:
    Naming Convention for EXPORT/ IMPORT Macros:
    RP-aaa-Cn-xy
    where aaa = IMP / EXP, n=1 for PCL1, 2 for PCL2, 3 for PCL3, 4 or PCL4
    and xy = cluster name.
    This guarantees consistency between the export and import of data and also ensures that all exported objects are imported again.
    Export Using the Data Buffer
    When macros are used for exporting, records are written to a main memory buffer and not directly to the database. When the program run has been completed, the records in the buffer are stored in the appropriate PCLn database.
    Import Using the Data Buffer
    When the macros are used to import data, the data records are not read directly from file PCLn. Instead, the system checks the buffer directory to see whether the main memory already contains a record with the same key. If this is not the case, the record is read from PCLn to the buffer and then retrieved from the buffer for the report.
    If the import is successful, the return code RP-IMP-xy-SUBRC = 0 is set. When data is read from the buffer, the system carries out a check for cluster authorization. Standard import programs follow the naming convention RPCLSTxy (xy = cluster name).
         report rpttcdmg.
    tables:
         pernr,
         pcl1,
         pcl2.
    include rpppxd00.    "buffer definitions
         data: begin of common part 'BUFFER'.
         include rpppxd10. "PCLx buffer
         data: end of common part.
         data: begin of common part 'CLUSTER_DIRECTORY'.
         include rpc2cd00. " "cluster directory definitions
         data: end of common part.
    include rpc2rdd0.
    get pernr.
       rp-init-buffer. "reset buffer
       cd-key-pernr = pernr-pernr.
       rp-imp-c2-cd. "read cluster CD from
      buffer/DB
       perform cd_manager using ... .
    alternative: call function rp_evaluation_periods...
       rx-key-pernr = pernr-pernr.
       rx-key-seqno = rgdir-seqnr.
       rp-imp-c2-rd. "read cluster RD from
      buffer/DB
       rp-exp-c2-rd. "update cluster RD in buffer
       perform prepare_update using 'V'. "update database (DB)
    Subroutines CD manager and Cluster buffer
    include rpcmgr00. "Cluster Directory Manager
    include rpppxm00. "module pcl1(2)-buffer
    3.4     Cluster Directory
    Finding Payroll Results for a Specific Query
    Payroll results are stored in cluster Rx of the PCL2.
    The cluster key is non-mnemonic. It contains the PERNR (personnel number) and SEQNO (sequential number) fields.
    The internal table RGDIR contains a directory entry for each payroll result. This entry is a sequential number (RGDIR-SEQNR) which uniquely identifies the payroll result.
    Payroll results can only be imported if the payroll cluster key contains the personnel number and sequential number.
    Before you can import a payroll record, you must select the entry in the RGDIR on the basis of existing data such as for-period, for-payroll area, for-payroll category, in-period, in-payroll area, in-payroll category, and so on, in order to determine the sequential number.
    You will probably always have the same queries when importing payroll records. For example, "Which payroll results (original and retroactively accounted records) were written for a specific payroll run (defined by IN payroll category, IN payroll area, IN period)"?
    There are standard modules that can be used. It is advantageous to use the standard modules rather than self-programmed solutions because no program modifications will be required if the payroll directory changes. The modules are described in the following section:
    Function Modules for Selecting Payroll Results
    3.5     Function Modules for Selecting Payroll Results
    The employee’s payroll directory is always transferred to the function modules using the table RGDIR.
    The modules then transfer the payroll records which satisfy the specified selection criteria using a table whose type corresponds to that of the RGDIR but which has a different name. The selection parameters differ according to the function of the module. For more information, read the module documentation.
    All module names begin with ‘CD_’.
    Function Module: CD_EVALUATION_PERIODS
    Function Module: CD_READ_PREVIOUS
    Function Module: CD_READ_PREVIOUS_ORIGINAL
    Other Modules for the Payroll Cluster
    Sample Report
    Function Module: CD_EVALUATION_PERIODS
    This module transfers the payroll results to a payroll run as ‘A’ records (current). It also transfers the accompanying ‘P’ records (previous).
    This is the module most frequently used in evaluation programs.
    Table contents before the function module is accessed:
    SEQNR     FPPER     FPBEG     FPEND     INPER     IPBEG     IPEND     BONDT     PAYTY     PAYID     INPTY     INPID
    00001     01.1996     01.01.96     01.15.96     01.1996     01.01.96     01.15.96                             
    00002     01.1996     01.01.96     01.15.96           01.16.96     01.16.96                       B     0
    00003           01.16.96     01.16.96           01.16.96     01.16.96     01.16.96     B     0     B     0
    00004           01.17.96     01.17.96           01.17.96     01.17.96     01.17.96     A     0     A     0
    00005           01.17.96     01.17.96           01.17.96     01.17.96     01.17.96     A     1     A     1
    00006     02.1996     01.16.96     01.31.96     02.1996     01.16.96     01.31.96                             
    00007     02.1996     01.16.96     01.31.96     03.1996     02.01.96     01.15.96                             
    00008     03.1996     01.16.96     01.31.96     03.1996     01.01.96     02.15.96                             
    The following parameters are transferred:
    - BONUS_DATE = '00000000'
    - INPER_MODIF = '02'
    - INPER = '199803'
    - PAYTY = ' '
    - PAYID = ' '
    Result:
    SEQNR     FPPER     FPBEG     FPEND     INPER     IPBEG     IPEND     BONDT     PAYTY     INPTY     INPID     SRTZA
    00006     02.1996     01.16.96     01.31.96     02.1996     01.16.96     01.31.96                             P
    00007     02.1996     01.16.96     01.31.96     03.1996     02.01.96     02.15.96                             A
    00008     03.1996     01.16.96     01.31.96     03.1996     02.01.96     02.15.96                             A
    Explanation of individual fields
    Function Module: CD_READ_PREVIOUS
    This module transfers a previous payroll record for a payroll record; this is the newest record for the payroll period (or daily payroll run) which was written before the transferred payroll record and contains the same FOR data as the transferring record.
    Table contents before the function module is accessed:
    SEQNR     FPPER     FPBEG     FPEND     INPER     IPBEG     IPEND     BONDT     PAYTY     PAYID
    00001     01.1996     01.01.96     01.15.96     01.1996     01.01.96     01.15.96                 
    00002     01.1996     01.01.96     01.15.96           01.16.96     01.16.96                 
    00003           01.16.96     01.16.96           01.16.96     01.16.96     01.16.96     B     0
    00004           01.17.96     01.17.96           01.17.96     01.17.96     01.17.96     A     0
    00005           01.17.96     01.17.96           01.17.96     01.17.96     01.17.96     A     1
    00006     02.1996     01.16.96     01.31.96     02.1996     01.16.96     01.31.96                 
    00007     02.1996     01.16.96     01.31.96     03.1996     02.01.96     02.15.96                 
    00008     03.1996     01.16.96     01.31.96     03.1996     02.01.96     02.15.96                 
    The following parameters are transferred:
    - Record with SEQNR '00007'
    Result:
    SEQNR     FPPER     FPBEG     FPEND     INPER     IPBEG     IPEND     BONDT     PAYTY     SRTZA
    00006     02.1996     01.16.96     01.31.96     02.1996     01.16.96     01.31.96                 P
    Explanation of individual fields
    Function Module: CD_READ_PREVIOUS_ORIGINAL
    This module reads the previous original payroll result.
    Table contents before the function module is accessed:
    SEQNR     FPPER     FPBEG     FPEND     INPER     IPBEG     IIPEND     BONDT     PAYTY     PAYID
    00001     01.1996     01.01.96     01.15.96     01.1996     01.01.96     01.15.96                 
    00002     01.1996     01.01.96     01.15.96           01.16.96     01.16.96                 
    00003           01.16.96     01.16.96           01.16.96     01.16.96     01.16.96     B     0
    00004           01.17.96     01.17.96           01.17.96     01.17.96     01.17.96     A     0
    00005           01.17.96     01.17.96           01.17.96     01.17.96     01.17.96     A     1
    00006     02.1996     01.16.96     01.31.96     02.1996     01.16.96     01.31.96                 
    00007     02.1996     01.16.96     01.31.96     03.1996     02.01.96     02.15.96                 
    00008     03.1996     01.16.96     01.31.96     03.1996     02.01.96     02.15.96                 
    The following parameters are transferred:
    - Record with SEQNR '00008'
    Result:
    SEQNR     FPPER     FPBEG     FPEND     INPER     IPBEG     IPEND     BONDT     PAYTY     SRTZA
    00006     02.1996     01.16.96     01.31.96     02.1996     01.16.96     01.3196                 P
    Explanation of individual fields
    3.6     Other Modules for the Payroll Cluster
    Modules which derive information from the payroll cluster are available in addition to the modules for payroll result selection.
    1.     CD_RETROCALC_PERIOD
    This module differentiates between original payroll records and retroactive accounting records.
    Table contents before the function module is accessed:
    SEQNR     FPPER     FPBEG     FPEND     INPER     IPBEG     IPEND     BONDT     PAYTY     PAYID
    00001     01.1996     01.01.96     01.15.96     01.1996     01.01.96     01.15.96                 
    00002     01.1996     01.01.96     01.15.96           01.16.96     01.16.96                 
    00003           01.16.96     01.16.96           01.16.96     01.16.96     01.16.96     B     0
    00004           01.17.96     01.17.96           01.17.96     01.17.96     01.17.96     A     0
    00005           01.17.96     01.17.96           01.17.96     01.17.96     01.17.96     A     1
    00006     02.1996     01.16.96     01.31.96     02.1996     01.16.96     01.31.96                 
    00007     02.1996     01.16.96     01.31.96     03.1996     02.01.96     02.15.96                 
    00008     03.1996     01.16.96     01.31.96     03.1996     02.01.96     02.15.96                 
    The following parameters are transferred:
    - Record with SEQNR '00008'
    Result:
    - CALCD = ' '
    Explanation of individual fields 
    2.     CD_PAYROLL_UNTIL
    This module reads the RGDIR for the date up to which the regular payroll run was executed for an employee.
    3.     CD_HIGHEST_PAYDT
    This module reads the most recent check date for an employee from the RGDIR.
    4.     CD_GET_INFO
    This module provides information (most recent check date, accounted to date) for a particular personnel number.
    3.7     Explanation of Individual Fields
    For-Information
    The FPPER, FPBEG, FPEND, BONDT, PAYTY, PAYID, ABKRS, PERMO, PAYDT, JUPER fields contain information on the period for which payroll is run.
    In-Information
    The INPER, IPEND, INPTY, INPID, IABKRS, IPERM fields contain information on the period in which payroll is run.
    SEQNR
    The field is used as a key to uniquely identify the payroll record.
    This field also defines the sequence of payroll results (history).
    Control Indicator (SRTZA)
    Control indicator     Meaning
    a     Current
    p     Previous
    o     Old
         For more information, see the online documentation for the individual function modules.
    3.8     Sample Report
    REPORT RPTTMWBS.
    DATA: RGDIR LIKE PC261 OCCURS 0 WITH HEADER LINE.
    DATA: EVPDIR LIKE RGDIR OCCURS 0 WITH HEADER LINE.
    DATA: PREVIOUS_RESULTS LIKE RGDIR OCCURS 0 WITH HEADER LINE.
    DATA: CALCD TYPE C.
    DATA: IN_ENTRY LIKE PC261.
    DATA: OUT_ENTRY LIKE PC261.
    INCLUDE RPCCCD09.
        CALL FUNCTION 'CU_READ_RGDIR'
          EXPORTING
             PERSNR = '00021218'
             TABLES IN_RGDIR = RGDIR
          EXCEPTIONS
             NO_RECORD_FOUND = 1
             OTHERS = 2.
    Read RGDIR
      CALL FUNCTION 'CD_EVALUATION_PERIODS'
         EXPORTING
             BONUS_DATE = '00000000'
             INPER_MODIF = '02'
             INPER = '199603'
             PAY_TYPE = CD_C-REGULAR
             PAY_IDENT = ' '
         TABLES
             RGDIR = RGDIR
             EVPDIR = EVPDIR
           IABKRS =
         EXCEPTIONS
             NO_RECORD_FOUND = 1
             OTHERS = 2.
    output:
    00006
    00007
    00008
    Read regular payroll results for January
    A results (original result plus retroactive calculations)
    and P results
      LOOP AT EVPDIR WHERE SRTZA = CD_C-ACTUAL.
    Only current results (00007 and 00008)
      CALL FUNCTION 'CD_RETROCALC_PERIOD'
         EXPORTING
            ENTRY = EVPDIR
         IMPORTING
            CALCD = CALCD
         EXCEPTIONS
            OTHERS = 1.
    Determine, whether original result
            CHECK CALCD = ' '.
    Special processing: Only the original period
    March is processed (seqnr 00008).
            IN_ENTRY = EVPDIR.
    CALL FUNCTION 'CD_READ_PREVIOUS_ORIGINAL'
         EXPORTING
            IN_RECORD = IN_ENTRY
         IMPORTING
            OUT_RECORD = OUT_ENTRY
         TABLES
            RGDIR = RGDIR
         EXCEPTIONS
            OTHERS = 1.
    out_entry now contains the previous results
    Input 00008 ----> Output 00006
      ENDLOOP.
      LOOP AT EVPDIR WHERE SRTZA = CD_C-ACTUAL.
         IN_ENTRY = EVPDIR.
      CALL FUNCTION 'CD_READ_PREVIOUS'
         EXPORTING
            IN_RECORD = IN_ENTRY
         TABLES
            RGDIR = RGDIR
            OUT_RGDIR = PREVIOUS_RESULTS
         EXCEPTIONS
            NO_RECORD_FOUND = 1
            OTHERS = 2.
    Input 00007 ---> 00006
    Input 00008 ---> no record found
    Output structure is a table, since there can be
    several previous results: for example, if legal person
    changes, and is retroactively deleted
    ENDLOOP
    4     Specific Commands
    The following sections describe the different specific commands in HR.
    Function modules in HR
    Macro modules
    4.1     Function Modules in HR
    Function modules are program modules which have a defined interface and allow type testing of parameters.
    They are managed with transaction SE37 and combined to function groups according to relevant criteria. You can access this transaction under Tools  ABAP Workbench  Function Builder.
    The HR function groups use the naming convention RPxx or HRxx where xx is an identifier of your choice.
    You can use the SHOW FUNCTION * editor command to branch from report processing to function module display.
    4.2     Macro Modules
    Definition
    An module that can be called within an ABAP program.
    Use
    Like subprograms and function modules, macro modules are a means of presenting programs in modular form. Macro modules (macros) are used often in the Human Resources application component (HR).
    Defining and Calling Modules
    Two options are provided:
    •     Macros can be defined in reports or includes using the ABAP command DEFINE. A macro can be used within a report or within an include. If a macro is used in a report, and the macro is defined in an include with the DEFINE command, the include must be integrated.
         Macros have the following advantages:
    If a macro is changed, each report using this macro is automatically regenerated when it is executed.
    •     Macros can also be defined as RMAC macros. The source code of these modules is stored in the function section of the control table TRMAC (Macros in ABAP Programs). The coding is grouped under a specific name in the table key.
    According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable.
         Customer-specific RMAC modules should begin with a special character.
    The macros defined in the control table TRMAC can be used by all reports.
         When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.
    The following section includes a list of  programming utilities for the logical databases PNP and PAP.
    5     Utilities in HR
    The following utilities are available.
    General Utilities
    Report     Meaning
    RPUACG00     Code generation / authorization check
    RPUAUD00     Infotype auditing
    Programming Utilities
    Report     Meaning
    RPINCL10     String search in reports
    Cluster Utilities
    Report     Meaning
    RPCLSTyy     Display cluster for PCLx (yy = RELID)
    RPUPxD00     Delete cluster for PCLx (individual data records)
    RPUPxD10     Delete cluster for PCLx (several data records)
    6     References:
    Different parts of the document has been prepared with the help of articles available on Internet
    Following websites are referred :
    a). http://help.sap.com
    b). http://sapfans.com
    c). http://www.sap-basis-abap.com/saphr.htm

  • Reg ABAP-HR objects

    hi friends,
    could u plz send me some objects for abap-hr, ie, infotypes, reports,dynamic action, interfaces, etc....
    my mail id : [email protected]
    thanks in advance.
    regards,
    priya

    Hi this will be of some help 4 u:
    Few notes are below:
    InfoSets in the HR Application
    You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
    InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
    If you want to create InfoSets for HR, you can use logical databases PNP, PNPCE, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    The reports you can execute using InfoSets based on logical databases PNP (or PNPCE) or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
    Logical database PNP/PNPCE* PCH PAP
    Selection of Persons Objects from Personnel Planning Applicants
    Infotypes that can be included in the InfoSet Infotypes for· Personnel Administration (0000-0999) · Time Management (2000-2999) · Payroll infotypes · Infotypes for Personnel Planning objects that can be related to persons If the object type is specified:· Infotypes for the object type · Infotypes for objects that can be related to the specified object typeIf the object type is not specified:· All infotypes · Infotypes for Recruitment (4000-4999)· Some infotypes for Personnel Administration (such as 0001 and 0002)
    · Customer infotypes
    Reporting examples · Selection of all persons who participated in a specific business event, output of prices for reserved business events · Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons · Selection of all business events held in London in March, output of all persons who participated in these business events · Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions · Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
    Logical database PNPCE (PNP Concurrent Employment) functions just like logical database PNP. The procedure for creating InfoSets is also the same. It only becomes significant if you work with Concurrent Employment.
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
    1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
    2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
    3. Choose .
    This takes you to the Infotype Selection for InfoSet  create'
    4. Choose as business object 'PREL' and as document type 'HRICOLFOTO'
    5. Push the create button
    6. Fill in the appropriate personnel number
    Steps for uploading Logo to an Z progrAM :-:
    1. Goto the transaction OAER
    2. Enter the class name as 'PICTURES'
    3. Enter the class type as 'OT'
    4. Enter the object key as the name of the logo you wish to give
    5. Execute
    6. Then in the new screen select Standard doc. types in bottom window
    Click on the Screen icon
    Now, it will ask for the file path where you have to upload the logo
    7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE
    Here you go !!
    *& Form TOP_OF_PAGE
    text
    FORM F_TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = IT_LISTHEADER
    i_logo = Logo name
    I_END_OF_LIST_GRID = .
    ENDFORM. "TOP_OF_PAGE
    Also forms:
    HR FORMS
    http://help.sap.com/saphelp_erp2004/helpdata/en/3d/a458c7a4ab2a4382c5b6bfe988edcd/frameset.htm
    Go through these pdf docs....
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAXX/PYINT_FORMS.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYXXFORM/PYINT_FORMBUILDER.pdf
    with regards,
    Hema Sundara.
    pls reward points if u find it helpful.

  • ABAP HR material

    hi every one
    Can any one help me in providing links for ABAP HR material
    Rajesh

    Hi Rajesh, read this.
    HR:
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    For Personal Admn the Infotypes start with PA0000 to PA1999
    Time Related Infotypes start with PA2000 to PA2999.
    Orgn related Infotypes start with HRP1000 to HRP1999.
    All custom developed infotypes stsrat with PA9000 onwards.
    In payroll processing we use Clusters like PCL1,2,3 and 4.
    Instead of Select query we use PROVIDE and ENDPROVIDE..
    You have to assign a Logical Database in the attributes PNP.
    Go through the SAp doc for HR programming and start doing.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    Also,
    Few notes are below:
    InfoSets in the HR Application
    You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
    InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
    If you want to create InfoSets for HR, you can use logical databases PNP, PNPCE, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    The reports you can execute using InfoSets based on logical databases PNP (or PNPCE) or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
    Logical database PNP/PNPCE* PCH PAP
    Selection of Persons Objects from Personnel Planning Applicants
    Infotypes that can be included in the InfoSet Infotypes for· Personnel Administration (0000-0999) · Time Management (2000-2999) · Payroll infotypes · Infotypes for Personnel Planning objects that can be related to persons If the object type is specified:· Infotypes for the object type · Infotypes for objects that can be related to the specified object typeIf the object type is not specified:· All infotypes · Infotypes for Recruitment (4000-4999)· Some infotypes for Personnel Administration (such as 0001 and 0002)
    · Customer infotypes
    Reporting examples · Selection of all persons who participated in a specific business event, output of prices for reserved business events · Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons · Selection of all business events held in London in March, output of all persons who participated in these business events · Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions · Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
    Logical database PNPCE (PNP Concurrent Employment) functions just like logical database PNP. The procedure for creating InfoSets is also the same. It only becomes significant if you work with Concurrent Employment.
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
    1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
    2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
    3. Choose .
    This takes you to the Infotype Selection for InfoSet  screen. You now have the option of creating field groups and assigning fields as required for non-HR InfoSets. Field groups that correspond to infotypes and already contain fields, however, are always created for HR InfoSets. The field groups are displayed in an overview tree in the top right section of the screen.
    The infotypes that you included in the InfoSet are displayed in an overview tree on the left of the screen. The infotype fields that are already included in field groups are displayed in a different color, and the corresponding field group ID is displayed.
    In the standard system, a field group is created automatically for each infotype that you included in the InfoSet (a field group corresponds to an infotype).
    In the standard system, each field group contains the infotype-specific fields. To ensure that working with the InfoSet is as easy as possible, you are advised to restrict your use of fields in each field group to those you really require. This means you should remove fields that are not required.
    An infotype's fields must only be assigned to the pertinent field group. Make sure this assignment is correct. If the assignment is incorrect, the InfoSet could be rendered unusable.
    When an InfoSet is created, the following fields are transferred automatically to the first field group:
    § Logical database PNPCE or PNP Personnel number
    § Logical database PAP Applicant number
    § Logical database PCH Object ID, plan version, and object type
    6. Determine the fields that must be included in the field groups of your InfoSet. If you require further information, see Assigning Fields to a Field Group.
    If you want, you can change the default sequence of field groups and fields as required using Drag&Drop.
    7. To save the InfoSet, choose .
    8. To generate the InfoSet, choose .
    On the Change InfoSet (InfoSet name) screen, you can choose Edit ® Change infotype selection to add more infotypes to the InfoSet, or to remove infotypes from the InfoSet. Remember to regenerate the InfoSet afterwards.
    This screen also enables you to update InfoSets if, for example, the system contains new additional fields for specific key values. To do so, choose InfoSet ® Additional functions ® Update additional HR fields.
    9. Go back to the initial screen for InfoSet maintenance.
    10. Choose User group assignment.
    11. Select a user group, and save your entry.
    sample code
    START-OF-SELECTION.
    GET pernr.
      rp_provide_from_frst p0000 space pn-begda pn-endda.
      if pnp-sw-found EQ '1'.
          READ TABLE p0001 WITH KEY pernr = p0000-pernr.
         if sy-subrc = 0.
         write : p0001-plans. " earliest.
        endif.
      endif.
      rp_provide_from_last p0014 space pn-begda pn-endda.
      if pnp-sw-found EQ '1'.
       READ TABLE p0014 WITH KEY pernr = p0000-pernr.
         if sy-subrc = 0.
         write : p0014-LGART. .
        endif.
      endif.
    Also this is HR_data structure.
    Enterprise Structure
    Definition
    Structure of company according to personnel administrative, time management and payroll perspectives from the point of view of your own company
    The company structure describes elements of the company and there dependencies.
    Structure
    The enterprise structure in Personnel Administration consists of the following:
    Client
    The client is, in accordance with commercial law, an organizational and data technical isolated unit within the R/3 System, with separate master records and its own separate record of tables. A client’s area of jurisdiction can correspond to a unit as small as a company, or as large as an entire enterprise.
    Company code
    The company code is the smallest organizational unit of external accounting in which a complete and isolated financial accounting can be created. All events that affect the company code and the creation of all statements for a legal financial statement, for example balances, profit and loss calculation are contained within the company code organizational units.
    Personnel area
    The personnel area is an organizational unit; according to a personnel administrative, time management and payroll organizational point of view, a personnel area represents a delimited enterprise area. The personnel area is only used in Personnel Administration and is unique within a client.
    Personnel areas are sub-divided into personnel subareas. Organizational data and guidelines as how to assign it, are stored on a personnel area and personnel subarea level. The rules and guidelines could be of a legal, pay scale and collective agreement, or internal nature. A personnel area is assigned to a company code which has the financial accounting values that are relevant for the personnel area. A pay scale area, a pay scale type and a public holiday calendar are precisely defined for a personnel subarea.
    Example
    The personnel area in a software company can be subdivided into development, training and administration personnel subareas.
    Personnel subarea
    The personnel subarea is only used in Personnel Administration. The groupings linked to the personnel subarea determine which entries from the subsequent screen are allowed for an employee of a particular company code/personnel area.
    Groupings are used for validation of master and time data. Groupings are also used to check the plausibility of data that you enter.
    Organizational key
    The organizational key enables you to define the organizational assignment more exactly. The organizational key can consist of elements from the enterprise structure and personnel structure.
    If you require further information on the corporate structure, please see the Elements of the Enterprise Structure section.
    Integration
    The Hiring personnel action enables you to assign employees to the enterprise structure. The data is stored in the Organizational Assignment (0001) infotype. This infotype is essential for authorization checks.
    http://help.sap.com/saphelp_47x200/helpdata/en/48/35c3ea4abf11d18a0f0000e816ae6e/frameset.htm
    Personnel Structure
    Definition
    Describes an employee’s position in a company from the individual employee’s view.
    Structure
    The personnel structure can be considered from two perspectives:
    administrative perspective
    organizational perspective
    The Structure link administrative personnel structure consists of the following elements:
    Employee group
    Employee subgroup
    Payroll area
    Organizational key
    The extent of the distinction that you make between employee groups and employee subgroups depends on your evaluation and access protection requirements.
    The organizational key consists of a part of both the enterprise structure and the personnel structure. The elements employee group and employee subgroup could also be relevant in forming the organizational key.
    The Structure link organizational personnel structure consists of the following elements:
    Position
    Job
    Organizational unit
    Integration
    To assign an employee to the personnel structure, use the Hiring personnel action. The data is stored in the Structure link Organizational Assignment (0001) infotype. This infotype is essential for authorization checks.
    http://help.sap.com/saphelp_47x200/helpdata/en/48/35c3ea4abf11d18a0f0000e816ae6e/frameset.htm
    kindly reward if found helpful.
    cheers,
    Hema.

  • What is the difference between  ABAP and HR-ABAP?

    Hi people,
    Could u just tel me abt what is the difference between ABAP and HR-ABAP?
    Thanks in advance,
    Sanjeev K.V

    Hi Sir ,
    Please have a look below .Hope it is suitable and simpler solution for your question.
    Please do reward if useful.
    Thankx.
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    Also,
    HR:
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    For Personal Admn the Infotypes start with PA0000 to PA1999
    Time Related Infotypes start with PA2000 to PA2999.
    Orgn related Infotypes start with HRP1000 to HRP1999.
    All custom developed infotypes stsrat with PA9000 onwards.
    In payroll processing we use Clusters like PCL1,2,3 and 4.
    Instead of Select query we use PROVIDE and ENDPROVIDE..
    You have to assign a Logical Database in the attributes PNP.
    Go through the SAp doc for HR programming and start doing.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    And finally,
    Few notes are below:
    InfoSets in the HR Application
    You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
    InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
    If you want to create InfoSets for HR, you can use logical databases PNP, PNPCE, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    The reports you can execute using InfoSets based on logical databases PNP (or PNPCE) or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
    Logical database PNP/PNPCE* PCH PAP
    Selection of Persons Objects from Personnel Planning Applicants
    Infotypes that can be included in the InfoSet Infotypes for· Personnel Administration (0000-0999) · Time Management (2000-2999) · Payroll infotypes · Infotypes for Personnel Planning objects that can be related to persons If the object type is specified:· Infotypes for the object type · Infotypes for objects that can be related to the specified object typeIf the object type is not specified:· All infotypes · Infotypes for Recruitment (4000-4999)· Some infotypes for Personnel Administration (such as 0001 and 0002)
    · Customer infotypes
    Reporting examples · Selection of all persons who participated in a specific business event, output of prices for reserved business events · Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons · Selection of all business events held in London in March, output of all persons who participated in these business events · Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions · Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
    Logical database PNPCE (PNP Concurrent Employment) functions just like logical database PNP. The procedure for creating InfoSets is also the same. It only becomes significant if you work with Concurrent Employment.
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
    1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
    2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
    3. Choose .
    This takes you to the Infotype Selection for InfoSet  screen. You now have the option of creating field groups and assigning fields as required for non-HR InfoSets. Field groups that correspond to infotypes and already contain fields, however, are always created for HR InfoSets. The field groups are displayed in an overview tree in the top right section of the screen.
    The infotypes that you included in the InfoSet are displayed in an overview tree on the left of the screen. The infotype fields that are already included in field groups are displayed in a different color, and the corresponding field group ID is displayed.
    In the standard system, a field group is created automatically for each infotype that you included in the InfoSet (a field group corresponds to an infotype).
    In the standard system, each field group contains the infotype-specific fields. To ensure that working with the InfoSet is as easy as possible, you are advised to restrict your use of fields in each field group to those you really require. This means you should remove fields that are not required.
    An infotype's fields must only be assigned to the pertinent field group. Make sure this assignment is correct. If the assignment is incorrect, the InfoSet could be rendered unusable.
    When an InfoSet is created, the following fields are transferred automatically to the first field group:
    § Logical database PNPCE or PNP Personnel number
    § Logical database PAP Applicant number
    § Logical database PCH Object ID, plan version, and object type
    6. Determine the fields that must be included in the field groups of your InfoSet. If you require further information, see Assigning Fields to a Field Group.
    If you want, you can change the default sequence of field groups and fields as required using Drag&Drop.
    7. To save the InfoSet, choose .
    8. To generate the InfoSet, choose .
    On the Change InfoSet (InfoSet name) screen, you can choose Edit ® Change infotype selection to add more infotypes to the InfoSet, or to remove infotypes from the InfoSet. Remember to regenerate the InfoSet afterwards.
    This screen also enables you to update InfoSets if, for example, the system contains new additional fields for specific key values. To do so, choose InfoSet ® Additional functions ® Update additional HR fields.
    9. Go back to the initial screen for InfoSet maintenance.
    10. Choose User group assignment.
    11. Select a user group, and save your entry.
    sample code
    START-OF-SELECTION.
    GET pernr.
    rp_provide_from_frst p0000 space pn-begda pn-endda.
    if pnp-sw-found EQ '1'.
    READ TABLE p0001 WITH KEY pernr = p0000-pernr.
    if sy-subrc = 0.
    write : p0001-plans. " earliest.
    endif.
    endif.
    rp_provide_from_last p0014 space pn-begda pn-endda.
    if pnp-sw-found EQ '1'.
    READ TABLE p0014 WITH KEY pernr = p0000-pernr.
    if sy-subrc = 0.
    write : p0014-LGART. .
    endif.
    endif.

  • Help on ABAP HR

    Hi,
    i learned ABAP HR can any body help me materials regardign this
    any body having specifications regardsing ABAP HR it will be more helpfull to this id <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

    Maybe this link can be helpfull
    http://www.sapdevelopment.co.uk/hr/hr_infotypes2.htm
    Have a look at http://www.sap-img.com/human/how-to-create-a-hr-infotype.htm, but have also a look at this thread
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FthreadID%3D9945%26messageID%3D63016
    found this link probably can be helpful to someone
    http://help.sap.com/saphelp_46b/helpdata/en/f7/2fe034ee251f34e10000009b38f83b/frameset.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-hr/how-to-create-z-infotype-in-organizational-management-745603
    How to create a HR infotype?
    1) Go to Transaction PM01.
    2) Enter the custom Infotype number which you want to create (Should be a 4 digit number, start with 9).
    3) Select the ‘Employee Infotype’ radio button.
    4) Select the ‘PS Structure Infotype’.
    5) Click on Create… A separate table maintenance window appears…
    6) Create a PS structure with all the fields you want on the Infotype
    7) Save and Activate the PS structure
    8) Go back to the initial screen of PM01.
    9) Click on ‘All’ push button. It takes a few moments.
    10) Click on ‘Technical Characteristics’. Infotype list screen appears
    11) Click on ‘Change’(pencil) button
    12) Select your Infotype and click on ‘Detail’ (magnifying glass) button
    13) Give ‘T591A’ as subtype table
    14) Give ‘T591S’ as subtype txt tab
    15) Give your subtype field as subtype field
    16) Save and come back to PM01 initial screen
    17) Click on ‘Infotype Characteristics’ … Infotype list screen appears
    18) Click on ‘Change’ (pencil) button
    19) Click on ‘New Entries’
    20) Enter your Infotype number and short text
    21) Here we have to set different Infotype Characteristics as per the requirement. (Better open another session with some standard Infotype’s infotype characteristics screen and use as the reference to fill yours)
    22) Save your entries.
    23) Now the Infotype is created and ready to use.
    24) If you want to change the layout of the Infotype as per your requirement…
    25) In the PM01 initial screen…Select ‘Screen’ radio button and give 2000 as the screen name, then click on edit.
    26) In the next screen.. Select ‘Layout Editor’ and click ‘Change’.
    27) Screen default layout appears…here you can design/modify the screen..change the attributes of the fields..etc.
    28) Save and activate. (Don’t forget to ‘Activate at every level)
    InfoSets in the HR Application
    You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
    InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
    If you want to create InfoSets for HR, you can use logical databases PNP, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    The reports you can execute using InfoSets based on logical databases PNP or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
    Logical database PNP PCH PAP
    Selection of Persons Objects from Personnel Planning Applicants
    Infotypes that can be included in the InfoSet Infotypes for
    • Personnel Administration (0000-0999)
    • Time Management (2000-2999)
    • Payroll infotypes
    • Infotypes for Personnel Planning objects that can be related to persons If the object type is specified:
    • Infotypes for the object type
    • Infotypes for objects that can be related to the specified object type
    If the object type is not specified:
    • All infotypes • Infotypes for Recruitment (4000-4999)
    • Some infotypes for Personnel Administration (such as 0001 and 0002)
    • Customer infotypes
    Reporting examples • Selection of all persons who participated in a specific business event, output of prices for reserved business events
    • Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons • Selection of all business events held in London in March, output of all persons who participated in these business events
    • Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions • Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
    1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
    2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
    3. Choose .
    This takes you to the Infotype Selection for InfoSet .
    The logical HR database uses the table APPLICANT. You must declare it in the TABLES statement.
    At the GET APPLICANT event, the APPLICANT structure contains the data for an applicant number chosen on the basis of selection screen entries.
    The APPLICANT-APLNO field contains the applicant number which is selected for processing.
    Only the APPLICANT-APLNO field should be read from the work area of the APPLICANT table. The other fields are intended for internal use only.
    2.7 Authorization Checks in Reporting (PA-APP)
    Generally, authorization checks in reporting do not differ from those in the transactions. Since data access in reporting is always of the read type, the system checks for a read authorization; the authorization group must be R or *.
    In some situations, you may want to use a simplified authorization check when running reports. The object RPABAP is required for the check as well as the object RPORGIN; if these authorizations are available, a simpler and faster check is performed.
    If the report cannot read certain applicant data due to lack of authorization, data for these persons is not processed at the GET APPLICANT time point. A note appears at the end of the list stating the number of applicants who were skipped due to lack of authorization.
    2.8 Views
    Introduction
    When evaluating data, we distinguish between the logical and the physical view.
    The physical view corresponds to the form in which the infotype data is stored in the HR tables. This data is stored in infotype records with a validity period.
    In the logical view, the validity periods of individual fields are determined for several infotype records. For example, for an evaluation, the time period during which an employee worked at a particular job may be important, irrespective of whether a company code, personnel area or cost center change occurred during this time.
    Data from several infotypes can also be provided for a specific partial period. When calculating partial payroll periods, it is especially important that data on basic pay, work schedule and cost distribution are provided for the relevant partial period.
    These two types of logical views are implemented in the projection and join.
    &#61607; Join
    &#61607; Projection
    &#61607; Join and Projection
    &#61607; Time-Dependent Control Tables
    &#61607; Generalization of the View
    Join
    A join processes records from two or more infotypes. The data from these infotypes is provided for a specific partial period.
    &#61607; We would like to know in which time period an employee worked at which job and at which address he or she resided during this time.
    The following address data is available:
    January – June Hamburg
    June – December Munich
    The following work center data is available:
    January – April Programmer
    May – December Course instructor
    If the address and work center data are provided for specific partial periods, the following cases result:
    January – April Hamburg / programmer
    May – June Hamburg / course instructor
    July – December Munich / Course instructor
    The ABAP syntax of this join is as follows:
    PROVIDE * FROM Pomp
    FROM Pnnnn
    BETWEEN PN-BEGDA AND PN-ENDDA.
    The partial periods for infotypes Pomp and Pnnnn as well as for all other infotypes of the join are defined in the fields BEGDA and ENDDA.
    The data of each infotype in the join must be available during the entire validity period of the infotype. The time periods of infotype records may not overlap; therefore, the join may not contain infotypes with time constraint "three".
    The time periods of records overlap if an infotype is read without any subtype restrictions. For example, the Address infotype has the subtypes Permanent residence, Temporary residence and Home address.
    Time periods will ultimately overlap if all addresses are read. Therefore, you must always select a subtype for a join, and this subtype may not have the time constraint "three".
    The program code for the above join for work center and address data is as follows:
    REPORT RPABAP03.
    TABLES: PERNR.
    INFOTYPES: 0001, 0006.
    GET PERNR.
    PROVIDE * FROM P0001
    FROM P0006 BETWEEN PN-BEGDA AND PN-ENDDA
    WHERE P0006-SUBTY eq '1'.
    WRITE: / PERNR-PERNR, P0001-STELL,
    P0006-STRAS, P0006-BEGDA, P0006-ENDDA.
    ENDPROVIDE.
    Sometimes no data is available for a particular infotype in the selected partial period. Infotype validity periods may not overlap but gaps are permitted.
    For example, gaps can occur when personal data is joined with address data:
    Personal data
    January 1960 - May 1998 Miller
    May 1998 - December 1998 Smith
    Address data:
    January 1998 - December 1998 Hamburg
    A join for personal and address data is presented as follows:
    January 1960 - December 1997 Miller
    January 1998 - April 1998 Miller / Hamburg
    May 1998 - December 1998 Smith / Hamburg
    Only personal data is available in the first partial period. Since the record does not provide the required information, the join's function of providing data from all associated infotypes has not been fulfilled.
    The variables Pnnnn_VALID recognize that only incomplete data is available for a particular partial period.
    This variable is formed when the report is run for each Pnnnn infotype included in a join.
    If data exists in the partial period for the Pnnnn infotype, the variable Pnnnn_VALID is filled with X.
    These variables are evaluated as follows:
    REPORT RPDEMO03.
    TABLES: PERNR.
    INFOTYPES: 0002,
    0006.
    GET PERNR.
    PROVIDE * FROM P0002
    FROM P0006 BETWEEN PN-BEGDA AND PN-ENDDA
    WHERE P0006-SUBTY = '1'.
    IF P0006_VALID EQ 'X'.
    WRITE: / PERNR-PERNR,
    P0002-BEGDA DD/MM/YYYY,
    P0002-ENDDA DD/MM/YYYY,
    P0002-NACHN,
    P0006-ORT01.
    ENDIF.
    ENDPROVIDE.
    A list is generated only if address data is available. The first partial period, for which only personal data is available, is suppressed.
    Projection
    All data of an infotype is stored on the database with its period of validity.
    When you change one or more fields of an infotype record, the system creates a new record with a new validity period. The date on which you changed the record is the start date of this new record.
    Therefore, the data fields that are not affected by the changes contain the same data over several infotype records and validity periods.
    From a logical perspective, these fields are valid in all infotype records until they are changed.
    When seen from this logical perspective, each field of an infotype has its own validity period.
    This is illustrated in the following case:
    An employee has worked as a programmer for three years in three different personnel areas.
    The following organizational assignment data is available:
    January 1992 - December 1992: Programmer /personnel area 1
    January 1993 - December 1993: Programmer /personnel area 2
    January 1994 - December 1994: Programmer /personnel area 3
    If you only require the time period during which an employee performs a specific job and not his or her personnel area for an evaluation, the following applies:
    January 1996 - December 1998: Programmer
    The physical view has three infotype records, the logical view one.
    To create meaningful evaluations and avoid redundancies, create logical views for infotype records.
    Select the infotype fields that are important for the evaluation and disregard the others.
    In the above example, the data in the other fields is invalid for the evaluation since it is unknown which personnel area the employee belonged to from 1996 - 1998.
    This view of the validity period of a group of infotype fields is known as projection.
    The program code for the projection is:
    PROVIDE  FROM Pnnnn
    BETWEEN PN-BEGDA AND PN-ENDDA .
    The infotype data for a projection must be available throughout the entire validity period. If the time periods of certain infotype records overlap, the data cannot be clearly assigned to one period.
    Therefore, you should not use projections for infotype records with time constraint ‘three’. The report for the above projection is:
    REPORT RPABAP04.
    TABLES: PERNR.
    INFOTYPES: 0001.
    GET PERNR.
    PROVIDE STELL FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.
    WRITE: / PERNR-PERNR, P0001-STELL, P0001-BEGDA,
    P0001-ENDDA.
    ENDPROVIDE .
    The logical validity for the activity period is included in the infotype BEGDA and ENDDA fields.
    Join and Projection
    You can combine the two logical views of infotype data, the join and the projection.
    We read the data from several infotypes and create new partial periods. We select the infotype fields that are important for the evaluation and combine these partial periods again.
    The following example illustrates this.
    An employee works as a programmer in the current year and marries in May. Her name does not change.
    Organizational assignment:
    January - December Programmer
    Personal data:
    January - April Donna Debug - single
    May - December Donna Debug - married
    When the data from both infotypes is read concurrently, the result is:
    January - April Donna Debug - single /
    programmer
    May - December Donna Debug - married /
    programmer
    Since we can disregard her marital status in the evaluation, we project on her first and last names:
    January - December Donna Debug / programmer
    The following report exemplifies the above case:
    REPORT RPDEMO04.
    TABLES: PERNR.
    INFOTYPES: 0001,
    0002.
    GET PERNR.
    PROVIDE STELL FROM P0001
    NACHN VORNA FROM P0002
    BETWEEN PN-BEGDA AND PN-ENDDA
    IF P0001_VALID = 'X'.
    WRITE: / P0002-NACHN, P0002-VORNA,
    P0001-BEGDA DD/MM/YYYY,
    P0001-ENDDA DD/MM/YYYY,
    P0001-STELL.
    ENDIF.
    ENDPROVIDE.
    This report combines the associated validity periods and provides the data of relevant infotype fields for a specific period.
    &#61607; Fields which are not accessed have their initial value in the projection.
    Provision of data for a specific partial period is especially important for partial period factoring in payroll.
    If an employee's basic pay or the cost distribution changes during the payroll period, you must calculate the salary proportionately for the resulting partial periods.
    However, if the payroll administrator of the organizational unit changes, this has no effect on payroll.
    By linking a join and a projection, you can read the master data for a specific partial period.
    Time-Dependent Control Tables
    Infotype data is generally coded as a key (for example, infotype P0006, address type 1 = permanent residence) to allow fast data entry and space-saving storage. When you process infotypes, the texts or attributes of the keys are read from the relevant control tables.
    In many control tables, storage of data is time-dependent and therefore assigned a validity period.
    In HR, this applies to the following areas:
    • Work schedules
    • Pay scale structures
    • Wage types
    • Wage type valuation
    • Bank data
    • Positions
    • Payee codes
    When you read the data for an infotype key from time-dependent control tables, you must determine which record is valid in the specified validity period.
    If you use a transaction to process an infotype, the system reads the table record which is valid on the start date.
    Generalization of the View
    You can use the logical view to edit and output data according to user specifications.
    The special feature of HR views is the time dependency of the data. Personnel data is almost always related to specific validity periods. A HR view provides data for specific time intervals.
    In general terms, a HR view is a logical perspective of interval-dependent internal tables.
    See also:
    Processing All Infotype Records (PA-PAD)
    Processing All Infotype Records (PA-APP)
    Processing a Specific Infotype Record (PA-PAD)
    Processing a Specific Infotype Record (PA-APP)
    3 Import/Export Files in HR
    The following sections describe the purpose of files PCL1 and PCL2 and explains how to access them.
    Files PCL1, PCL2, PCL3 and PCL4
    Storing Data in PCLn Files
    PCLn Buffer
    Cluster Directory Manager
    3.1 Files PCL1, PCL2, PCL3 and PCL4
    Which information is stored in the files?
    File PCL1 is the basis for the HR work area data. It contains information from the time data recording, for example, incentive wage time tickets or infotype supplement texts.
    File PCL2 contains derived information, for example, payroll results. It also contains all generated payroll schemas.
    File PCL3 contains applicant data.
    File PCL4 contains the change documents for HR master data and recruitment.
    The structure of PCLn files corresponds to that of the INDX file which you may be familiar with from other applications. The structure of all PCLn files (n = 1, 2, 3, and 4) is identical.
    Structure of Files
    Like in almost all SAP files, the key element with the highest priority is the client; data within a client is grouped according to basic relations (field PCLn-RELID).
    The type of basic relation is known as a cluster and characterizes the stored data according to the type, for example, cluster RX contains the payroll result for country X (from table T500L) and cluster TE contains the trip costs data.
    Depending on the cluster, the structure of PCLn-SRTFD is defined in a field string xx-KEY, which is defined in an include RPCnxxy0.
    Naming conventions
    n = 1, 2, 3, or 4 (for PCL1, PCL2, PCL3, or PCL4)
    xx = for the cluster
    y = 0 for international clusters
    y = country grouping according to T500L for national clusters
    The personnel number is usually the first component of xx-KEY.
    Importing and Exporting Data
    The import/export files PCLn are managed with the ABAP/4® commands IMPORT and EXPORT . These commands store objects such as fields, field strings, or internal tables on the database, or read these from the database. Data is read from and written to the database using a unique key( xx-Key).
    Please note that the RMAC macros RP-IMP-Cn-xx and RP-EXP-Cn-xx are provided for importing and exporting data. Only these macros should be used.
    See also Macro Modules
    3.2 Storing Data in PCLn Files
    Data from the different HR application areas is stored in data clusters in PCLn files (n = 1, 2, 3, or 4).
    This collection of data objects can consist of:
    • Fields used within reports
    • Field strings
    • Internal tables
    The structure of the PCLn files provides a framework for the individual application areas.
    Each application area must have a two-character cluster name (relation ID). It must also have a key structure; 40 bytes of the SRTFD field are available for this structure.
    When a record is exported to the PCLn file, the cluster ID is written to the RELID field and the key value to the SRTFD field.
    Naming convention for includes when defining clusters:
    RPCnxxy0 n = 1, 2, 3 or 4 (for PCL1, PCL2, PCL3, PCL4)
    xx = cluster ID
    y = country indicator
    Description of Cluster Data using Cluster RX as an Example
    The data definition is stored in the include RPC2RX00 in accordance with the above naming conventions.
    Structure of cluster key:
    Data: BEGIN OF RX-KEY.
    INCLUDE STRUCTURE PC200.
    DATA: END OF RX-KEY.
    The DDIC structure PC200 contains the fields PERNR (personnel number) and SEQNO (sequential number).
    The data definition of the cluster also contains other internal tables.
    For a list of available data clusters, refer to the domain description in the Data Dictionary.
    xx Key
    The xx key name is dependent on the cluster.
    The RX KEY is used for all Rx and Xx clusters. In all other cases, the name of the xx key corresponds to that of the cluster.
    Cluster xx Key
    RA RX-KEY
    B1 B1-KEY
    G3 G3-KEY
    XA RX-KEY
    3.3 PCLn Buffer
    To keep the number of database accesses to a minimum, import and export data is stored in the main memory buffer. Buffer management routines ensure that exported data can be stored in the PCLn files.
    The following two examples illustrate which problems can occur without a buffer.
    Retroactive accounting of payroll results
    Starting payroll in the test mode
    Retroactive Accounting of Payroll Results
    In February 1998, a retroactive accounting run is executed for January.
    FOR PERIOD 199801 IN PERIOD 199802
    The payroll results for January are recalculated and then written directly to the database.
    Result:
    The database now contains the results of the following payroll periods.
    FOR-PERIOD 199801 IN-PERIOD 199802
    FOR-PERIOD 199801 IN-PERIOD 199801
    Payroll is then run for February.
    FOR-PERIOD 199802 IN-PERIOD 199802
    If problems should arise during the payroll run for this period, the February record is not stored on the database.
    Result:
    The current January record on the database is:
    FOR-PERIOD 199801 IN-PERIOD 199802
    This problem does not arise if you use the buffer since all data of a transaction is always updated collectively. In the above example, the recalculated January result would be stored in the buffer and, if the payroll run for February were terminated prematurely, the database would not be updated.
    The current January record on the database would thus be:
    FOR-PERIOD 199801 IN-PERIOD 199802
    Starting Payroll in the Test Mode
    In a test run, the database is not updated. Since the payroll results from the previous period are used as the basis for calculating the results of the following period, the results of the actual payroll run would differ from those of the test run, if this test run were executed over several periods.
    The use of the buffer enables trouble-free access to the required results for the previous period.
    What is required for exporting/importing data to/from the PCLn files using the buffer?
    &#61607; The following includes contain the data definition for the buffer. They must be included in the report that writes the data to or reads the data from the database.
    RPPPXD00
    RPPPXD10
    &#61607; Include RPPPXD10 must be in the common part ‘BUFFER’ .
    Include RPPPXM00, which contains the buffer management routines, is also required.
    The macros for importing and exporting data must comply with the following naming convention:
    Naming Convention for EXPORT/ IMPORT Macros:
    RP-aaa-Cn-xy
    where aaa = IMP / EXP, n=1 for PCL1, 2 for PCL2, 3 for PCL3, 4 or PCL4
    and xy = cluster name.
    This guarantees consistency between the export and import of data and also ensures that all exported objects are imported again.
    Export Using the Data Buffer
    When macros are used for exporting, records are written to a main memory buffer and not directly to the database. When the program run has been completed, the records in the buffer are stored in the appropriate PCLn database.
    Import Using the Data Buffer
    When the macros are used to import data, the data records are not read directly from file PCLn. Instead, the system checks the buffer directory to see whether the main memory already contains a record with the same key. If this is not the case, the record is read from PCLn to the buffer and then retrieved from the buffer for the report.
    If the import is successful, the return code RP-IMP-xy-SUBRC = 0 is set. When data is read from the buffer, the system carries out a check for cluster authorization. Standard import programs follow the naming convention RPCLSTxy (xy = cluster name).
    &#61607; report rpttcdmg.
    tables:
    pernr,
    pcl1,
    pcl2.
    include rpppxd00. "buffer definitions
    data: begin of common part 'BUFFER'.
    include rpppxd10. "PCLx buffer
    data: end of common part.
    data: begin of common part 'CLUSTER_DIRECTORY'.
    include rpc2cd00. " "cluster directory definitions
    data: end of common part.
    include rpc2rdd0.
    get pernr.
    rp-init-buffer. "reset buffer
    cd-key-pernr = pernr-pernr.
    rp-imp-c2-cd. "read cluster CD from
    buffer/DB
    perform cd_manager using ... .
    alternative: call function rp_evaluation_periods...
    rx-key-pernr = pernr-pernr.
    rx-key-seqno = rgdir-seqnr.
    rp-imp-c2-rd. "read cluster RD from
    buffer/DB
    rp-exp-c2-rd. "update cluster RD in buffer
    perform prepare_update using 'V'. "update database (DB)
    Subroutines CD manager and Cluster buffer
    include rpcmgr00. "Cluster Directory Manager
    include rpppxm00. "module pcl1(2)-buffer
    3.4 Cluster Directory
    Finding Payroll Results for a Specific Query
    Payroll results are stored in cluster Rx of the PCL2.
    The cluster key is non-mnemonic. It contains the PERNR (personnel number) and SEQNO (sequential number) fields.
    The internal table RGDIR contains a directory entry for each payroll result. This entry is a sequential number (RGDIR-SEQNR) which uniquely identifies the payroll result.
    Payroll results can only be imported if the payroll cluster key contains the personnel number and sequential number.
    Before you can import a payroll record, you must select the entry in the RGDIR on the basis of existing data such as for-period, for-payroll area, for-payroll category, in-period, in-payroll area, in-payroll category, and so on, in order to determine the sequential number.
    You will probably always have the same queries when importing payroll records. For example, "Which payroll results (original and retroactively accounted records) were written for a specific payroll run (defined by IN payroll category, IN payroll area, IN period)"?
    There are standard modules that can be used. It is advantageous to use the standard modules rather than self-programmed solutions because no program modifications will be required if the payroll directory changes. The modules are described in the following section:
    Function Modules for Selecting Payroll Results
    3.5 Function Modules for Selecting Payroll Results
    The employee’s payroll directory is always transferred to the function modules using the table RGDIR.
    The modules then transfer the payroll records which satisfy the specified selection criteria using a table whose type corresponds to that of the RGDIR but which has a different name. The selection parameters differ according to the function of the module. For more information, read the module documentation.
    All module names begin with ‘CD_’.
    Function Module: CD_EVALUATION_PERIODS
    Function Module: CD_READ_PREVIOUS
    Function Module: CD_READ_PREVIOUS_ORIGINAL
    Other Modules for the Payroll Cluster
    Sample Report
    Function Module: CD_EVALUATION_PERIODS
    This module transfers the payroll results to a payroll run as ‘A’ records (current). It also transfers the accompanying ‘P’ records (previous).
    This is the module most frequently used in evaluation programs.
    Table contents before the function module is accessed:
    SEQNR FPPER FPBEG FPEND INPER IPBEG IPEND BONDT PAYTY PAYID INPTY INPID
    00001 01.1996 01.01.96 01.15.96 01.1996 01.01.96 01.15.96
    00002 01.1996 01.01.96 01.15.96 01.16.96 01.16.96 B 0
    00003 01.16.96 01.16.96 01.16.96 01.16.96 01.16.96 B 0 B 0
    00004 01.17.96 01.17.96 01.17.96 01.17.96 01.17.96 A 0 A 0
    00005 01.17.96 01.17.96 01.17.96 01.17.96 01.17.96 A 1 A 1
    00006 02.1996 01.16.96 01.31.96 02.1996 01.16.96 01.31.96
    00007 02.1996 01.16.96 01.31.96 03.1996 02.01.96 01.15.96
    00008 03.1996 01.16.96 01.31.96 03.1996 01.01.96 02.15.96
    The following parameters are transferred:
    - BONUS_DATE = '00000000'
    - INPER_MODIF = '02'
    - INPER = '199803'
    - PAYTY = ' '
    - PAYID = ' '
    Result:
    SEQNR FPPER FPBEG FPEND INPER IPBEG IPEND BONDT PAYTY INPTY INPID SRTZA
    00006 02.1996 01.16.96 01.31.96 02.1996 01.16.96 01.31.96 P
    00007 02.1996 01.16.96 01.31.96 03.1996 02.01.96 02.15.96 A
    00008 03.1996 01.16.96 01.31.96 03.1996 02.01.96 02.15.96 A
    Explanation of individual fields
    Function Module: CD_READ_PREVIOUS
    This module transfers a previous payroll record for a payroll record; this is the newest record for the payroll period (or daily payroll run) which was written before the transferred payroll record and contains the same FOR data as the transferring record.
    Table contents before the function module is accessed:
    SEQNR FPPER FPBEG FPEND INPER IPBEG IPEND BONDT PAYTY PAYID
    00001 01.1996 01.01.96 01.15.96 01.1996 01.01.96 01.15.96
    00002 01.1996 01.01.96 01.15.96 01.16.96 01.16.96
    00003 01.16.96 01.16.96 01.16.96 01.16.96 01.16.96 B 0
    00004 01.17.96 01.17.96 01.17.96 01.17.96 01.17.96 A 0
    00005 01.17.96 01.17.96 01.17.96 01.17.96 01.17.96 A 1
    00006 02.1996 01.16.96 01.31.96 02.1996 01.16.96 01.31.96
    00007 02.1996 01.16.96 01.31.96 03.1996 02.01.96 02.15.96
    00008 03.1996 01.16.96 01.31.96 03.1996 02.01.96 02.15.96
    The following parameters are transferred:
    - Record with SEQNR '00007'
    Result:
    SEQNR FPPER FPBEG FPEND INPER IPBEG IPEND BONDT PAYTY SRTZA
    00006 02.1996 01.16.96 01.31.96 02.1996 01.16.96 01.31.96 P
    Explanation of individual fields
    Function Module: CD_READ_PREVIOUS_ORIGINAL
    This module reads the previous original payroll result.
    Table contents before the function module is accessed:
    SEQNR FPPER FPBEG FPEND INPER IPBEG IIPEND BONDT PAYTY PAYID
    00001 01.1996 01.01.96 01.15.96 01.1996 01.01.96 01.15.96
    00002 01.1996 01.01.96 01.15.96 01.16.96 01.16.96
    00003 01.16.96 01.16.96 01.16.96 01.16.96 01.16.96 B 0
    00004 01.17.96 01.17.96 01.17.96 01.17.96 01.17.96 A 0
    00005 01.17.96 01.17.96 01.17.96 01.17.96 01.17.96 A 1
    00006 02.1996 01.16.96 01.31.96 02.1996 01.16.96 01.31.96
    00007 02.1996 01.16.96 01.31.96 03.1996 02.01.96 02.15.96
    00008 03.1996 01.16.96 01.31.96 03.1996 02.01.96 02.15.96
    The following parameters are transferred:
    - Record with SEQNR '00008'
    Result:
    SEQNR FPPER FPBEG FPEND INPER IPBEG IPEND BONDT PAYTY SRTZA
    00006 02.1996 01.16.96 01.31.96 02.1996 01.16.96 01.3196 P
    Explanation of individual fields
    3.6 Other Modules for the Payroll Cluster
    Modules which derive information from the payroll cluster are available in addition to the modules for payroll result selection.
    1. CD_RETROCALC_PERIOD
    This module differentiates between original payroll records and retroactive accounting records.
    Table contents before the function module is accessed:
    SEQNR FPPER FPBEG FPEND INPER IPBEG IPEND BONDT PAYTY PAYID
    00001 01.1996 01.01.96 01.15.96 01.1996 01.01.96 01.15.96
    00002 01.1996 01.01.96 01.15.96 01.16.96 01.16.96
    00003 01.16.96 01.16.96 01.16.96 01.16.96 01.16.96 B 0
    00004 01.17.96 01.17.96 01.17.96 01.17.96 01.17.96 A 0
    00005 01.17.96 01.17.96 01.17.96 01.17.96 01.17.96 A 1
    00006 02.1996 01.16.96 01.31.96 02.1996 01.16.96 01.31.96
    00007 02.1996 01.16.96 01.31.96 03.1996 02.01.96 02.15.96
    00008 03.1996 01.16.96 01.31.96 03.1996 02.01.96 02.15.96
    The following parameters are transferred:
    - Record with SEQNR '00008'
    Result:
    - CALCD = ' '
    Explanation of individual fields
    2. CD_PAYROLL_UNTIL
    This module reads the RGDIR for the date up to which the regular payroll run was executed for an employee.
    3. CD_HIGHEST_PAYDT
    This module reads the most recent check date for an employee from the RGDIR.
    4. CD_GET_INFO
    This module provides information (most recent check date, accounted to date) for a particular personnel number.
    3.7 Explanation of Individual Fields
    For-Information
    The FPPER, FPBEG, FPEND, BONDT, PAYTY, PAYID, ABKRS, PERMO, PAYDT, JUPER fields contain information on the period for which payroll is run.
    In-Information
    The INPER, IPEND, INPTY, INPID, IABKRS, IPERM fields contain information on the period in which payroll is run.
    SEQNR
    The field is used as a key to uniquely identify the payroll record.
    This field also defines the sequence of payroll results (history).
    Control Indicator (SRTZA)
    Control indicator Meaning
    a Current
    p Previous
    o Old
    &#61607; For more information, see the online documentation for the individual function modules.
    3.8 Sample Report
    REPORT RPTTMWBS.
    DATA: RGDIR LIKE PC261 OCCURS 0 WITH HEADER LINE.
    DATA: EVPDIR LIKE RGDIR OCCURS 0 WITH HEADER LINE.
    DATA: PREVIOUS_RESULTS LIKE RGDIR OCCURS 0 WITH HEADER LINE.
    DATA: CALCD TYPE C.
    DATA: IN_ENTRY LIKE PC261.
    DATA: OUT_ENTRY LIKE PC261.
    INCLUDE RPCCCD09.
    CALL FUNCTION 'CU_READ_RGDIR'
    EXPORTING
    PERSNR = '00021218'
    TABLES IN_RGDIR = RGDIR
    EXCEPTIONS
    NO_RECORD_FOUND = 1
    OTHERS = 2.
    Read RGDIR
    CALL FUNCTION 'CD_EVALUATION_PERIODS'
    EXPORTING
    BONUS_DATE = '00000000'
    INPER_MODIF = '02'
    INPER = '199603'
    PAY_TYPE = CD_C-REGULAR
    PAY_IDENT = ' '
    TABLES
    RGDIR = RGDIR
    EVPDIR = EVPDIR
    IABKRS =
    EXCEPTIONS
    NO_RECORD_FOUND = 1
    OTHERS = 2.
    output:
    00006
    00007
    00008
    Read regular payroll results for January
    A results (original result plus retroactive calculations)
    and P results
    LOOP AT EVPDIR WHERE SRTZA = CD_C-ACTUAL.
    Only current results (00007 and 00008)
    CALL FUNCTION 'CD_RETROCALC_PERIOD'
    EXPORTING
    ENTRY = EVPDIR
    IMPORTING
    CALCD = CALCD
    EXCEPTIONS
    OTHERS = 1.
    Determine, whether original result
    CHECK CALCD = ' '.
    Special processing: Only the original period
    March is processed (seqnr 00008).
    IN_ENTRY = EVPDIR.
    CALL FUNCTION 'CD_READ_PREVIOUS_ORIGINAL'
    EXPORTING
    IN_RECORD = IN_ENTRY
    IMPORTING
    OUT_RECORD = OUT_ENTRY
    TABLES
    RGDIR = RGDIR
    EXCEPTIONS
    OTHERS = 1.
    out_entry now contains the previous results
    Input 00008 ----> Output 00006
    ENDLOOP.
    LOOP AT EVPDIR WHERE SRTZA = CD_C-ACTUAL.
    IN_ENTRY = EVPDIR.
    CALL FUNCTION 'CD_READ_PREVIOUS'
    EXPORTING
    IN_RECORD = IN_ENTRY
    TABLES
    RGDIR = RGDIR
    OUT_RGDIR = PREVIOUS_RESULTS
    EXCEPTIONS
    NO_RECORD_FOUND = 1
    OTHERS = 2.
    Input 00007 ---> 00006
    Input 00008 ---> no record found
    Output structure is a table, since there can be
    several previous results: for example, if legal person
    changes, and is retroactively deleted
    ENDLOOP
    4 Specific Commands
    The following sections describe the different specific commands in HR.
    Function modules in HR
    Macro modules
    4.1 Function Modules in HR
    Function modules are program modules which have a defined interface and allow type testing of parameters.
    They are managed with transaction SE37 and combined to function groups according to relevant criteria. You can access this transaction under Tools &#61614; ABAP Workbench &#61614; Function Builder.
    The HR function groups use the naming convention RPxx or HRxx where xx is an identifier of your choice.
    You can use the SHOW FUNCTION * editor command to branch from report processing to function module display.
    4.2 Macro Modules
    Definition
    An module that can be called within an ABAP program.
    Use
    Like subprograms and function modules, macro modules are a means of presenting programs in modular form. Macro modules (macros) are used often in the Human Resources application component (HR).
    Defining and Calling Modules
    Two options are provided:
    • Macros can be defined in reports or includes using the ABAP command DEFINE. A macro can be used within a report or within an include. If a macro is used in a report, and the macro is defined in an include with the DEFINE command, the include must be integrated.
    &#61607; Macros have the following advantages:
    If a macro is changed, each report using this macro is automatically regenerated when it is executed.
    • Macros can also be defined as RMAC macros. The source code of these modules is stored in the function section of the control table TRMAC (Macros in ABAP Programs). The coding is grouped under a specific name in the table key.
    According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable.
    &#61607; Customer-specific RMAC modules should begin with a special character.
    The macros defined in the control table TRMAC can be used by all reports.
    &#61607; When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.
    The following section includes a list of programming utilities for the logical databases PNP and PAP.
    5 Utilities in HR
    The following utilities are available.
    General Utilities
    Report Meaning
    RPUACG00 Code generation / authorization check
    RPUAUD00 Infotype auditing
    Programming Utilities
    Report Meaning
    RPINCL10 String search in reports
    Cluster Utilities
    Report Meaning
    RPCLSTyy Display cluster for PCLx (yy = RELID)
    RPUPxD00 Delete cluster for PCLx (individual data records)
    RPUPxD10 Delete cluster for PCLx (several data records)
    6 References:
    Different parts of the document has been prepared with the help of articles available on Internet
    Following websites are referred :
    a). http://help.sap.com
    b). http://sapfans.com
    c). http://www.sap-basis-abap.com/saphr.htm
    HR:
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    For Personal Admn the Infotypes start with PA0000 to PA1999
    Time Related Infotypes start with PA2000 to PA2999.
    Orgn related Infotypes start with HRP1000 to HRP1999.
    All custom developed infotypes stsrat with PA9000 onwards.
    In payroll processing we use Clusters like PCL1,2,3 and 4.
    Instead of Select query we use PROVIDE and ENDPROVIDE..
    You have to assign a Logical Database in the attributes PNP.
    Go through the SAp doc for HR programming and start doing.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    sample code
    START-OF-SELECTION.
    GET pernr.
    rp_provide_from_frst p0000 space pn-begda pn-endda.
    if pnp-sw-found EQ '1'.
    READ TABLE p0001 WITH KEY pernr = p0000-pernr.
    if sy-subrc = 0.
    write : p0001-plans. " earliest.
    endif.
    endif.
    rp_provide_from_last p0014 space pn-begda pn-endda.
    if pnp-sw-found EQ '1'.
    READ TABLE p0014 WITH KEY pernr = p0000-pernr.
    if sy-subrc = 0.
    write : p0014-LGART. .
    endif.
    endif.
    check out the following links
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_DATAEX.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAARCHR/CAARCHR.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAXX/PAXX.pdf
    general links..
    http://www.sap-img.com/abap.htm
    http://help.sap.com/saphelp_46c/helpdata/en/fc/eb2d67358411d1829f0000e829fbfe/content.htm
    http://www.geocities.com/victorav15/sapr3/abap.html
    http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
    http://abap4.tripod.com/Other_Useful_Tips.html
    http://help.sap.com/saphelp_45b/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm
    http://www.sap-basis-abap.com/sapmm.htm
    http://sap.ittoolbox.com/nav/t.asp?t=303&p=448&h1=303&h2=322&h3=448
    http://sapfans.com/
    http://cma.zdnet.com/book/abap/ch03/ch03.htm
    http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm
    http://sappoint.com/abap/
    http://www.henrikfrank.dk/abapuk.html
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://www.sapgenie.com/abap/index.htm
    http://www.sap-img.com/abap.htm
    http://www.sapdevelopment.co.uk/tips/tipshome.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://sap.ittoolbox.com/nav/t.asp?t=322&p=322&h1=322
    http://sap.ittoolbox.com/nav/t.asp?t=448&p=448&h1=448
    http://www.thespot4sap.com/
    http://www.kabai.com/abaps/q.htm
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapgenie.com/abap/tips_and_tricks.htm
    http://www.sapassist.com/code/d.asp?whichpage=1&pagesize=10&i=10&a=c&o=&t=&q=&qt=
    https://www.sdn.sap.com/irj/sdn/collaboration
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/HRINF/HRINF.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAARCHR/CAARCHR.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAXX/PAXX.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_DATAEX.pdf

  • Scale type in condition type

    Hi,
    What is the importance of scale type in condition type.Actuly I want to know that how we use scale type in condition record.Please explain this with example.
    Regards
    Prabudh

    Hi,
    can u do a small search in this forum, todad morning also there was one posting regarding the same.
    <b>Scales</b>
    A scale in a condition record where prices, discounts, or surcharges are defined for different customer order quantities or values.
    This scale is used by the system to determine the price, discount, or surcharge for a given quantity or value.
    This is defined in the each condition type
    spro--> img>sd->basic functions> pricing>pricing control->define cond type--->select  any one condtion type eg: PR00--> come down u will find scales views.
    <b>scales basis:</b>
    depending upon the scales basis the prices are determined according.
    example:
    A company want to give discount based quantity scale ie, if customer buy 10 pcs the prices would be 100/ unit & if he purchase more than 20 the prices would be 80/unit.
    So in scale basis u have to select quantity scale. & the prices aganist teh qunatity will be defined in condition record maintanenace <b>(tcode:VK11)</b>. The other sclaes basis available are
    B      Value scale                 
    C      Quantity scale              
    D      Gross weight scale          
    E      Net weight scale            
    F      Volume scale                
    G     Scale based on a formula    
    L      Point scale                 
    M     Time period scale - Month   
    N     Time period scale - Years   
    O     Time period scale - Days    
    P     Time period scale - Week    
    R     Distance                    
    S     Number of shipping units    
    T     reserved (IS-OIL, time prices
    X     reserved (IS-OIL, day prices)
    <b><b>scale formula:</b></b>
    here there small routine is predefined to determined of scales
    hope this helps u
    regards,
    Arun prasad

  • Quantity based pricing

    Hi !
    We have a requirement where we require the price to be determined based on certain qty in the sales order. For example for a material,
    1. For 100 nos price to be determined  - Rs 50 (per unit price)
    2. For 200 nos price to be determined - Rs 25 (per unit price)
    Pl help with how to go about configuring the same.
    Thanks!
    Reena

    Hi,
    Ur requirement can fulfilled by using scales which defined in the condition type.
    Example:condition type:PR00
    Scales
    A scale in a condition record where prices, discounts, or surcharges are defined for different customer order quantities or values.
    This scale is used by the system to determine the price, discount, or surcharge for a given quantity or value.
    This is defined in the each condition type
    spro--> img>sd->basic functions> pricing>pricing control->define cond type--->select any one condtion type eg: PR00--> come down u will find scales views.
    scales basis:
    depending upon the scales basis the prices are determined according.In the scale basis select B Value scale.
    Now  goto VK11--> pr00> select material with release status--> enter the material & give the first price INR.50/unit
    now selct the line--> click GOTO in the menu bar & select scales> here in the second line give from:200 & amount:25/unit---> save
    check out in the sales order
    <b>The other sclae basis avalibale are:</b>
    B Value scale
    C Quantity scale
    D Gross weight scale
    E Net weight scale
    F Volume scale
    G Scale based on a formula
    L Point scale
    M Time period scale - Month
    N Time period scale - Years
    O Time period scale - Days
    P Time period scale - Week
    R Distance
    S Number of shipping units
    T reserved (IS-OIL, time prices
    X reserved (IS-OIL, day prices)
    hope this helps u
    regards,
    Arun prasad

  • HR ABAP Expert - PCL2-CLUSTD

    I can easily read PCL2 data by using "IMPORT blah blah.... FROM DATABASE PCL2(RU)".
    Somehow, someway, SAP takes what is strored in PCL2-CLUSTD and converts it into meaningful variables via the "IMPORT ... FROM DATABASE" syntax.
    [[I want to see the code SAP uses to do this]]
    Actually, what I really want is to take normal data say, employee name and say payroll dollars for a given period and then convert it back into PCL2-CLUSTD without updating PCL2.
    IDEAS?

    hi goldstein,
    pls refer the below liks once.u may get clear idea about wat u want.
    sap.ionelburlacu.ro/abap/sap2/SAP_Reports.html - 26k
    www.experts-exchange.com/Database/Software/HR_HCM/SAP/Q_23189513.html - 112k -
    www.sap-img.com/hr021.htm - 8k -
    www.sapbrainsonline.com/REFERENCES/StandardReports/SAP_standard_reports_list.html - 39k
    Best PDF file to learn HR Programming
    http://www.melayu.plus.com/SAP%20HR%20Programming.pdf
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    For Personal Admn the Infotypes start with PA0000 to PA1999
    Time Related Infotypes start with PA2000 to PA2999.
    Orgn related Infotypes start with HRP1000 to HRP1999.
    All custom developed infotypes stsrat with PA9000 onwards.
    In payroll processing we use Clusters like PCL1,2,3 and 4.
    Instead of Select query we use PROVIDE and ENDPROVIDE..
    You have to assign a Logical Database in the attributes PNP.
    Go through the SAp doc for HR programming and start doing.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    HR
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    you can see some Standard Program examples in this one..
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    These are the FAQ's that might helps you
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.erpgenie.com/faq/hr.htm.
    www.sap-img.com
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    http://www.sapfans.com/forums/viewtopic.php?p=498530&sid=d7ec5866e3fb26880da129de45ce79de
    http://www.sapcookbook.com/preview_hr_questions.htm
    http://www.atomhr.com/library_full.htm
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci983590,00.html
    http://www.allsaplinks.com/HRmaterial.html
    http://www.allsaplinks.com/timemanagement.html
    http://www.allsaplinks.com/payrollcompletefunctional.html
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/HRINF/HRINF.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYXXFORM/PYINT_FORMBUILDER.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMPA/BCBMTWFMPA.pdfhttp://help.sap.com/printdocu/core/Print46c/en/data/pdf/MYSAP/SR_HR.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://www.planetsap.com/hr_abap_main_page.htm
    Regards,
    karthik
    <REMOVED BY MODERATOR>
    Few notes are below:
    InfoSets in the HR Application
    You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
    InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
    If you want to create InfoSets for HR, you can use logical databases PNP, PNPCE, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    The reports you can execute using InfoSets based on logical databases PNP (or PNPCE) or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
    Logical database PNP/PNPCE* PCH PAP
    Selection of Persons Objects from Personnel Planning Applicants
    Infotypes that can be included in the InfoSet Infotypes for· Personnel Administration (0000-0999) · Time Management (2000-2999) · Payroll infotypes · Infotypes for Personnel Planning objects that can be related to persons If the object type is specified:· Infotypes for the object type · Infotypes for objects that can be related to the specified object typeIf the object type is not specified:· All infotypes · Infotypes for Recruitment (4000-4999)· Some infotypes for Personnel Administration (such as 0001 and 0002)
    · Customer infotypes
    Reporting examples · Selection of all persons who participated in a specific business event, output of prices for reserved business events · Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons · Selection of all business events held in London in March, output of all persons who participated in these business events · Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions · Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
    Logical database PNPCE (PNP Concurrent Employment) functions just like logical database PNP. The procedure for creating InfoSets is also the same. It only becomes significant if you work with Concurrent Employment.
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
    1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
    2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
    3. Choose .
    This takes you to the Infotype Selection for InfoSet .
    Fill data object
    Export record
    EXPORT TABLE1 TO DATABASE PCLn (xy) ID xy-KEY.
    IF SY-SUBRC EQ 0.
    WRITE: / 'Update successful'.
    ENDIF.
    Export Cluster data using the macro
    . Export data using macro RP-EXP-Cn-xy.
    • When data records are exported using macro, they are not written to the database but to a main memory buffer.
    • To save data, use the PREPARE_UPDATE routine with the USING parameter 'V'.
    REPORT ZHREXPRT.
    *Buffer definition
    INCLUDE RPPPXD00. INCLUDE RPPPXM00. "Buffer management
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    RP-EXP-Cn-xy.
    IF SY-SUBRC EQ 0.
    PERFORM PREPARE_UPDATE USING ‘V’.
    ENDIF.
    Importing Cluster Data using standard include
    • The IMPORT command causes data objects with the specified key values to be read from PCLn.
    • If the import is successful, SY-SUBRC is 0; if not, it is 4.
    REPORT RPIMPORT.
    TABLES: PCLn.
    INCLUDE RPCnxxy0. "Cluster definition
    Fill cluster Key
    Import record
    IMPORT TABLE1 FROM DATABASE PCLn (xy) ID xy-KEY.
    IF SY-SUBRC EQ 0.
    Display data object
    ENDIF.
    Importing Cluster data using Macro
    • Import data using macro RP-IMP-Cn-xy.
    • Check return code SY-SUBRC. If 0, it is successful. If 4, error.
    • Need include buffer management routines RPPPXM00
    Example
    REPORT RPIMPORT.
    *Buffer definition
    INCLUDE RPPPXD00.
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    *Import data to buffer
    RP-IMP-Cn-xy.
    *Buffer management routines
    INCLUDE RPPPXM00.
    Cluster Authorization
    Simple EXPORT/IMPORT statement does not check for cluster authorization.
    Use EXPORT/IMPORT via buffer, the buffer management routines check for cluster
    authorization.
    How to read the Payroll Results
    • Payroll results are stored in cluster Rn of PCL2 as field string and internal tables.
    n - Country identifier.
    • Standard reports read the results from cluster Rn. Report RPCLSTRn lists all payroll results;
    • Report RPCEDTn0 lists the results on a payroll form.
    • The cluster definition of payroll results is stored in two INLCUDE reports:
    include: rpc2rx09. "Definition Cluster Ru (I)
    include: rpc2ruu0.”Definition Cluster Ru (II)
    o This first INCLUDE defines the country-independent part; the second
    INCLUDE defines the country-specific part (US).
    o The cluster key is stored in the field string RX-KEY.
    • All the field string and internal tables stored in PCL2 are defined in the ABAP/4 dictionary. This allows you to use the same structures in different definitions and nonetheless maintain data consistency.
    • The structures for cluster definition comply with the name convention PCnnn
    Unfortunately 'nnn' can be any set of alphanumeric characters.
    *Key definition
    DATA: BEGIN OF RX-KEY.
    INCLUDE STRUCTURE PC200.
    DATA: END OF RX-KEY.
    *Payroll directory
    DATA: BEGIN OF RGDIR OCCURS 100.
    INCLUDE STRUCTURE PC261.
    DATA: END OF RGDIR.
    • How to retrieve Payroll results
    o To read payroll results, you need two keys: pernr and seqno
    o You can get SEQNO by importing the cluster directory (CD) first.
    Example
    REPORT ZHRIMPRT.
    TABLES: PERNR, PCL1, PCL2.
    INLCUDE: rpc2cd09. "Definition cluster CD
    PARAMETERS: PERSON LIKE PERNR-PERNR.
    RP-INIT-BUFFER.
    *Import cluster Directory
    CD-KEY-PERNR = PERNR-PERNR.
    RP-IMP-C2-CU.
    CHECK SY-SUBRC = 0.
    LOOP AT RGDIR.
    RX-KEY-PERNR = PERSON.
    UNPACK RGDIR-SEQNR TO RX-KEY-SEQNO.
    *Import data from PCL2
    RP-IMP-C2-RU.
    ENDLOOP.
    o Reading records from the Payroll directory
    after importing the payroll directory, which record to read is up to the programmer
    o Each payroll result has a status.
    'P' - previous result
    'A' - current (actual) result
    'O' - old result
    o Function module CD_EVALUATION_PERIODS will restore the payroll result status for a period when that payroll is initially run. It also will select all the relevant periods to be evaluated.
    Example
    Call function 'CD_EVALUATION_PERIODS'
    exporting
    bonus_date = ref_periods-bondt
    inper_modif = pn-permo
    inper = ref_periods-inper
    pay_type = ref_periods-payty
    pay_ident = ref_periods-payid
    tables
    rgdir = rgdir
    evpdir = evp
    iabkrs = pnpabkrs
    exceptions
    no_record_found = 1.
    Authorization Check
    Authorization for Persons
    • In the authorization check for persons, the system determines whether the user has the authorizations required for the organizational features of the employees selected with GET PERNR.
    • Recruits for which the user has no authorization are skipped and appear in a list at the end of the report.
    • Authorization object: 'HR: Master data'
    Authorization for Data
    • In the authorization check for data, the system determines whether the user is authorized to read the infotypes specified in the report.
    • If the authorization for a particular infotype is missing, the evaluation is terminated and an error message is displayed.
    Deactivating the Authorization Check
    • In certain reports, it may be useful to deactivate the authorization check in order to improve performance. (E.g. when running payroll)
    • You can store this information in the object 'HR: Reporting'.
    2.1.6 Concepts of Macros (Import/Export etc.)
    Macros:
    Introduction
    Programs that process the cluster data (for example, RX) do not access the cluster independently. The data is accessed using a defined interface created with macros.
    Macro contains some part of source code, which it will be useful for number of applications. Macro is module, which is stored
    Naming Conventions of Macro:
    RP-aaa-bb-cc
    • aaa is the type of Macro. It takes two values
    o IMP Import Macro
    o EXP Export Macro
    • bb is the Database table where the data is saved:
    o C1 Database object PCL1
    o C2 Database object PCL2
    o C3 Database object PCL3
    o C4 Database object PCL4
    • Cc is the cluster, it may take
    o RX Cluster object RX
    o RD Cluster object RD
    o B2 Cluster object B2 and so on.
    Defining and Calling the Macros
    Defining:
    There are two options for defining the Macros
    • Macros are defined using the ABAP Commands DEFINE…. END-OF-DEFINITION. A macro can be used within a report or within include. If a macro is used in a report, and the macro is defined in include with the DEFINE command, include must be integrated.
    • Macros can also be defined as RMAC macros. The source code of these modules is stored in the function section of the control table TRMAC. The coding is grouped under a specific name in the table key.
    According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable.
    Difference between the two methods is:
    • If a macro is changed, each report using this macro is automatically regenerated when it is executed.
    • When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.
    Standard HR Macros
    o The macro RP-PROVIDE-FROM-FRST retrieves the first (start) data record, which is valid in the data selection period.
    o The macro RP-PROVIDE-FROM-LAST retrieves the last (latest) data record, which is valid in the data selection period.
    o The macro RP-READ-INFOTYPE retrieves the data record(s), which is valid in the data selection period.
    How to check whether the macro operation is successful or not
    For every macro, whether the operation was successful or not will be checked with
    PNP-SW-FOUND.
    If PNP-SW-FOUND = 1, then the operation is successful.
    Where exactly the Macrocode is stored
    The program code pertaining to this macro is stored in the control table RMAC
    Guidelines for how and when to use the Standard Macros
    o RP_PROVIDE_FROM_FRST
    Use macro RP_PROVIDE_FROM_FRST in programs for the logical databases PNP and PAP where the first data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype has time constraint 1 or 2.
    Prerequisites
    • The validity begin date of the time period must be before or the same as the validity end date.
    • Validity start and end dates are correct (preferably of the type DATE).
    • The infotype table is sorted in ascending order. Otherwise, you would receive the first fitting table entry that might not necessarily correspond to the first time entry.
    Features
    The first entry for a specified period is placed in the table header entry from an internal infotype table.
    Parameters
    RP_PROVIDE_FROM_FRST inftytab subty beg end
    IN: 1) Name of the internal table
    2) Subtype required or SPACE if no subtype is being specified
    3) Validity start date of the time interval
    4) Validity end date of the time interval
    OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
    2) The matching table header entry if PNP-SW-FOUND = 1 or
    the initial table header entry if PNP-SW-FOUND = 0
    Example
    (RP_PROVIDE_FROM_FRST inftytab subty beg end)
    RP_PROVIDE_FROM_FIRST P0021 '1' PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND EQ '1'.
    ENDIF.
    or
    RP_PROVIDE_FROM_FRST P0001 SPACE PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND EQ '0'.
    WRITE: / 'Error: Org. assignment is missing' REJECT.
    ENDIF.
    o RP_PROVIDE_FROM_LAST
    You use macro RP_PROVIDE_FROM_LAST in programs for the logical databases PNP and PAP where the last data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype (or subtype) has time constraint 1 or 2.
    Prerequisites
    • The validity begin date of the time period must be before or the same as the validity end date.
    • Validity start and end dates are correct (preferably of the type DATE).
    • The infotype table is sorted in ascending order. Otherwise, you would receive the last fitting table entry that might not necessarily correspond to the last time entry.
    Features
    The macro RP_PROVIDE_FROM_LAST makes sure that the last entry for a specified period is placed in the table header entry of the report output list.
    Parameters
    RP_PROVIDE_FROM_LAST inftytab subty beg end
    IN: 1) Name of the internal table
    2) Subtype required or SPACE if no subtype is being specified
    3) Validity begin date of the time interval
    4) Validity end date of the time interval
    OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
    2) The matching table header entry if PNP-SW-FOUND = 1 or
    the cleared table header entry if PNP-SW-FOUND = 0
    Example:
    RP_PROVIDE_FROM_LAST P0021 '1' PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND EQ '1'.
    ENDIF.
    OR
    RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND EQ '0'.
    WRITE: / 'Error: Org. assignment is missing'. REJECT.
    ENDIF.
    • RP_READ_INFOTYPE
    You can use the macro in all programs at any point. You can also use it in function modules. In database PNP, an infotype is usually read with GET PERNR. Using macro RP_READ_INFOTYPE is an exception.
    You can also use the function module HR_READ_INFOTYPE. For information on how to use the function module, see the documentation on Function Modules.
    Prerequisites
    • The validity begin date of the time period must be before or the same as the validity end date.
    • Validity begin and end are correct date specifications (preferably of the type DATE).
    • The infotype table must match the infotype number.
    • The program using the macro must contain the include DBPNPMAC.
    Features
    The macro RP_READ_INFOTYPE makes sure that all data records for a person for the specified period are placed in an internal infotype table.
    Parameters
    RP_READ_INFOTYPE pernr infty inftytab beg end
    IN: 1) Personnel number of the person requested
    2) Infotype number of the required infotype
    3) Name of the internal infotype table
    4) Validity start date of the time interval
    5) Validity end date of the time interval
    OUT: 1) PNP-SW-FOUND = 0, if there is no matching record in the dataset
    PNP-SW-FOUND = 1, if there is no matching record in the dataset
    2) PNP-SW-AUTH-SKIPPED-RECORD = 0, if the HR authorization check has not retained any records due to incorrect authorizations.
    PNP-SW-AUTH-SKIPPED-RECORD = 1 , if the HR authorization check has retained at least one record due to lack of authorization
    3) Internal infotype table, containing all matching records for which the user is authorized (this table can also be empty).
    Example
    (RP_READ_INFOTYPE pernr infty inftytab beg end)
    INFOTYPES: 0001.
    RP-LOWDATE-HIGHDATE.
    DATA: PERNR LIKE P0001-PERNR.
    DATA: BEGDA LIKE P0001-BEGDA, ENDDA LIKE P0001-ENDDA.
    PERNR = '12345678'.
    BEGDA = LOW-DATE + 15
    ENDDA = HIGH-DATE - 5.
    RP-READ-INFOTYPE PERNR 0001 P0001 BEGDA ENDDA.
    IF PNP-SW-AUT-SKIPPED-RECORD EQ '1'.
    WRITE: / 'Insufficient authorization'. STOP.
    ENDIF.
    IF PNP-SW-FOUND EQ '0'.
    WRITE: / 'Infotype 0001 missing'. STOP.
    ENDIF.
    2.1.7 Retrieval of data using LDBs (PNP/PAP/APP/PCH) without LDBs.
    Logical database
    A logical database is a special ABAP/4 program which combines the contents of certain database tables. Using logical databases facilitates the process of reading database tables.
    HR Logical Database is PNP
    Main Functions of the logical database PNP:
    • Standard Selection screen
    • Data Retrieval
    • Authorization check
    To use logical database PNP in your program, specify in your program attributes.
    Standard Selection Screen
    • Date selection
    Date selection delimits the time period for which data is evaluated. GET PERNR retrieves all records of the relevant infotypes from the database. When you enter a date selection period, the PROVIDE loop retrieves the infotype records whose validity period overlaps with at least one day of this period.
    • Person selection
    Person selection is the 'true' selection of choosing a group of employees for whom the report is to run.
    • Sorting Data
    • The standard sort sequence lists personnel numbers in ascending order.
    • SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001.
    • Report Class
    • You can suppress input fields, which are not used on the selection screen by assigning a report class to your program.
    • If SAP standard delivered report classes do not satisfy your requirements, you can create your own report class through the IMG.
    Data Retrieval from LDB
    1. Create data structures for infotypes.
    INFOTYPES: 0001, "ORG ASSIGNMENT
    0002, "PERSONAL DATA
    0008. "BASIC PAY
    2. Fill data structures with the infotype records.
    Start-of-selection.
    GET PERNR.
    End-0f-selection.
    Read Master Data
    • Infotype structures (after GET PERNR) are internal tables loaded with data.
    • The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop.
    GET PERNR.
    PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA
    If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. Endif.
    ENDPROVIDE.
    • Period-Related Data
    All infotype records are time stamped.
    IT0006 (Address infotype)
    01/01/1990 12/31/9999 present
    Which record to be read depends on the date selection period specified on the
    selection screen. PN/BEGDA PN/ENDDA.
    • Current Data
    IT0006 Address - 01/01/1990 12/31/9999 present
    RP-PROVIDE-FROM-LAST retrieves the record, which is valid in the data selection period.
    For example, pn/begda = '19990931' pn/endda = '99991231'
    IT0006 subtype 1 is resident address
    RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.
    2.2 Personnel Administration (PA)
    PA involves administrating employee data, commonly referred to Master Data. Master Data contains all employee data used in HR processing. Master Data includes Personal (E.g. address), Organizational (Position description), Benefits (Insurance, Pension), Time & Payroll.
    Master Data is stored in Infotypes. Infotypes are tables (for user Data entry screen) that contain logically related employee data. Data can be stored for specific periods, which includes current and historical.
    Components of PA:
    Personnel Area: represents a division of a company code into subunits. It is an organizational entity representing an area within an organization defined by specific aspects of personnel administration, time management and payroll. Personnel areas are subdivided into personnel subareas. Personnel area is specific to HR and is a four character alphanumeric identification. E.g. Personnel area 100 is for employees in Karnataka, 200 is for Chennai.
    Personnel Subarea: is a further subdivision of Personnel area. It may represent geographical locations. Functions include:
    1. Set groupings for Time Management, so that work schedules, substitution and absence and leave types can be setup for individual personnel subareas.
    2. Generate default pay scale type and area for an employee's basic pay.
    3. Define public holiday calendar.
    Employee Groups: divides or groups employees into various categories. E.g. Active employees, Retired employees, Contractors Employee groups are used to generate default values for payroll accounting area and basic pay.
    Employee Subgroups: are further differentiated within the employee group. E.g. Salaried employees, Hourly employees, unionized employees, Executives The employee subgroup grouping for the payroll rule allows you to define different payroll procedures for different employee subgroups. For e.g. you can specify whether an employee's pay should be determined on hourly or monthly basis. The employee subgroup grouping for the work schedule defines the validity of work schedule, and the attendance or absence quota type determines the validity of time quotas.
    Here a Data Model
    2.2.1 Importance of Dates and periods in payroll
    Here is a simple ABAP example of reading DATE types stored in infotype 0041.
    There can be a maximum of 12 dates stored in this infotype. Here is an example of an infotype 0041 record:
    The date types are stored in PA0041-DAR01, PA0041-DAR02, etc.
    In the example above, PA0041-DAR01 is “01”, PA0041-DAR02 is “09”.
    The dates themselves are stored in PA0041-DAT01, PA0041-DAT02, etc
    To read through this in ABAP, the easiest way is to use the DO VARYING statement. Here is a simple demonstration ABAP:
    Note: to print the text of the date type, e.g. “Leave year entry” select from table T548T.
    REPORT ZDATES1.
    TABLES: PERNR.
    DATA: BEGIN OF MYDATES,
    DAR LIKE P0041-DAR01,
    DAT LIKE P0041-DAT01,
    END OF MYDATES.
    INFOTYPES 0041.
    GET PERNR.
    WRITE: PERNR-PERNR, PERNR-ENAME. "Show employee number and name
    RP-PROVIDE-FROM-LAST P0041 SPACE PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND = 1.
    DO 12 TIMES VARYING MYDATES
    FROM P0041-DAR01
    NEXT P0041-DAR02.
    If mydates-dar ne space.
    WRITE: /, MYDATES-DAR, MYDATES-DAT.
    Endif.
    ENDDO.
    ENDIF.
    2.2.2 Overview of date fields and period-Ex. for period/in-period/ payroll
    FOR-PERIOD: Payroll period (start and end date of a period) for which a payroll result is created or generated.
    IN-PERIOD: The payroll period (start and end date of a period) in which a payroll result is created or generated.
    Example: For every employee payroll should be run, it may be bi-weekly, monthly, or quarterly. Say it is monthly, then for an employee a payroll should be run for this month and it is run next month then. For-period start date is 01/9/2003 and end date is 30 and in-period end date will be the date it is run 15/10/2003.
    In-Period View
    An in-period view is a selection of payroll results from the payroll directory (for example, RPCLSTRD Payroll Result for Germany,) for a number of in-periods. The payroll results that were generated for the required number of payroll periods in the selected period are selected.
    Payroll Result
    For-Period View
    A for-period view is a selection of payroll results from the payroll directory (for example, RPCLSTRC Payroll Result for Switzerland) for a number of for-periods. The payroll results that were generated in the required number of payroll periods for the selected period are selected.
    Example: For-Period View / In-Period View
    Payroll
    result For-period
    view Start date
    for-per. view End date
    for-per. view In-period
    view End date
    in-per. view
    1 01/1997 01.01.1997. 31.01.1997 02/1997 28.02.1997
    2 02/1997 01.02.1997 28.02.1997 02/1997 28.02.1997
    Explanation
    The payroll result 1 for the payroll period (for-period) 01/1997 has the start date 01.01.1997 and the end date 31.01.1997. This payroll result was generated in the payroll period (in-period) 02/1997.
    2.2.3 Repetitive Structures processing
    In many master data infotypes the data is stored in the form of repetitive structures. For example infotype 0008, the structure wage type line is available for 20 times, that is an employee is eligible for having 20 different wage types based on his benefits. When evaluating repeat structures, you must ensure that all fields are entered. In the case of the Basic Pay infotype, 20 * 5 = 100 fields are queried.
    To use this method of evaluation, define a field string whose structure corresponds to the fields in one line of the repetitive structure.
    Example for understanding the repetitive Structure
    Say, for an employee you want to know that for what all wage types an employee is eligible for the latest period you mentioned on the selection screen.
    Using LDB (PNP)
    Program:
    Report zhk_repstru.
    Tables Pernr.
    Infotypes 0008.
    • You have to declare a structure same as repetitive structure in the 0008 infotype
    Data: begin of s_wagetypes,
    Wagetype type p0008-lga01,
    Amount type p0008-bet01,
    Hours type p0008-anz01,
    Unit type p0008-ein01,
    Ind type p0008-opk01,
    End of s_wagetypes,
    • Selecting data from the Data base Get pernr
    • Getting the latest record based on the selection period.
    RP_PROVIDE_FROM_LAST P0008 SPACE PN-BEGDA PN-ENDDA.
    • Now knowing for what all wage types the employee is eligible.
    Do 20 times varying s_wagetypes from p0008-lga01 next p0008-lga02. If s_wagetypes-wagetype is initial.
    o Here the data is stored sequentially, i.e., if the employee is eligible for 5 wage types then all the 5 wage types are stored sequentially in lga01 to lga05 respectively. So, if say the lga05 is initial then it is understood that, employee is eligible for only 4 wage types and from lga05 to lga20 structures will be empty so, we need not process further
    Exit.
    Else.
    Write: / s_wagetypes-wagetype,
    S_wagetypes-amount.
    Endif.
    Enddo.
    2.2.4 Guidelines to retrieve Payroll data (Mainly US/UK/Ireland)
    Before directly going into the Guidelines to retrieve Payroll Data let us look in to the basic concepts of the Payroll.
    Introduction to Payroll
    To calculate the remuneration for work done for each employee
    Payroll does not just involve the calculation of remuneration, but consists of a variety of processes that are becoming increasingly important due to the employer’s increased obligation to supply benefits and medical welfare. These benefits are products of:
    • Labor law
    • Tax law
    • Contribution law
    • Benefits law
    • Civil law
    • Reporting law
    • Information law
    • Statistics law
    Payroll in the SAP System: In the SAP Human Resources Management System, payroll accounting is executed using the Payroll driver.
    Process Flow:
    When you access Payroll, the payroll driver calls the accompanying payroll schema, which consists of a sequence of functions. For each activity, the individual functions import data from internal tables and payroll relevant files.
    Payroll Integration:
    Payroll can be integrated in Personnel Administration, Time Management, Incentive Wages and Accounting:
    Standardized data retention enables you to use master data and other payroll relevant data from Personnel Administration.
    Time data, entered via Time Management, is automatically included in the Payroll and is valuated during the payroll run. Data from the Incentive Wages component is used to calculate piecework wages and premium wages directly in Payroll.
    Information on expenses and payables from Payroll is posted for accounting directly in Financial Accounting, and you assign the costs to the appropriate cost center. You can also control the financial system of third-party providers.
    Payroll Driver
    Payroll driver is a special report for Payroll.
    SAP has developed country-specific payroll drivers, which are based on report RPCALCx0.
    The country-specific net calculation of pay must be developed explicitly for every country.
    Separate country programs, which meet the tax and insurance requirements of the respective country, can be created from the basic report RPCALCx0. Since the payroll driver has a modular structure, you can use the Customizing functions to quickly modify the payroll procedure to meet the particular requirements of your enterprise.
    Integration
    Calculation rules and other reports are stored in an accompanying schema, which also contains the activities carried out by the payroll driver during payroll. All data is stored in internal tables and saved in files with a cluster structure.
    When you access Payroll, the payroll driver calls the accompanying payroll schema, which consists of a sequence of functions. For each activity, the individual functions import data from internal tables and payroll relevant files.
    Payroll Schema:
    It contains calculation rules to be used by the payroll driver during payroll.
    SAP has developed country-specific schemas, which are based on schema X000.
    With country-specific reports, the first character in the name refers to the country indicator.
    For example,
    D for Germany
    F for France
    U for USA
    Schema Structure A schema consists of the following parts:
    1. Initialization
    Where system performs the following steps:
    Updates the databases
    Imports required infotypes
    2. Gross calculation of pay
    Where system performs the following steps:
    Processes basic data and time data
    Reads payroll account of the last period accounted
    Processes time data and calculate the individual gross values
    Performs factoring
    3. Net calculation of pay
    where system performs the following steps:
    Calculates net remuneration
    Performs bank transfers
    Example:
    The classic example is the payroll for salaried employees at the end of the month in contrast to the wage accounting of hourly workers in the middle of the following month.
    Enter the organizational assignment of employees to a payroll accounting area (ABKRS) in Infotype 0001. Payroll accounting area also determines the two functions necessary for payroll accounting:
    • The summarization of personnel numbers to be accounted and
    • The determination of the exact payroll period.
    Select Personnel Numbers:
    Personnel numbers are selected for payroll accounting by specifying a payroll area in the payroll driver. Infotype 0001 Organizational Assignment enables you to assign an employee to the appropriate payroll area.
    These Pernrs are locked during Payroll Run.
    Determine Payroll Period:
    On the Selection screen, you can give Payroll Period Parameter as per the requirement else you can give Payroll Area, by which system calculates the payroll period.
    Finding Payroll Results for a Specific Query:
    Payroll results are stored in cluster Rx of the PCL2. The cluster key is not mnemonic; it contains only the PERNR (personnel number) and SEQNO (sequential number) fields.
    The internal table RGDIR (PC261 - Cluster Directory for Export and Import of Payroll Results) contains a directory entry for each payroll result.
    This entry is a sequential number (RGDIR-SEQNR), which uniquely identifies the payroll result.
    Payroll results can only be imported if the payroll cluster key (PC200) contains the personnel number and sequential number.
    Function Modules for Selecting Payroll Results
    You will probably always have the same queries when importing payroll records. For example, "Which payroll results (original and retroactively accounted records) were written for a specific payroll run (defined by IN payroll category, IN payroll area, IN period)"? To save programmers from having to write their own reports for this functionality, standard modules are available for the most important queries. The employee's payroll directory is always transferred to the function modules using the table RGDIR (PC261). The modules then transfer the payroll records, which satisfy the specified selection criteria using a table whose type corresponds to that of the RGDIR (PC261) but which has a different name.
    Exporting Pernr – Personal Number
    Importing Molga – Country
    Tables Rgdir – Payroll Results Directory
    This Function Module populates payroll results of all employees with PERNR & SEQNR as key.
    Macro Modules:
    We have populated Results Directory & retrieved Sequential Number, we need to call an import macro module for retrieving the required payroll results. For this we need to pass the unique identification of an Employee payroll Result i.e. rx-key-pernr = v_pernr.
    rx-key-seqno = v_seqnr.
    To that import macro.
    Calling Import Module: RP-imp-c2-RU.
    This Macro populates all the cluster tables required for Payroll, by importing from PCL2 Cluster Directory. After that we can loop through these cluster tables for required fields.
    Guideline to write a program, which retrieves the data for, specified country
    • Use Logical Database As per the Requirement.
    • Include Payroll Driver with reference to Country- Specific modules which inturn includes Country-specific Schemas etc.
    • Get the PERNRs for which you want to obtain payroll results.
    • Populate Results Directory RGDIR with PERNR & Molga (Country) calling FM CU_READ_RGDIR.
    • Get the Unique Sequential Number with PERNR, From Date & Last Date calling CD_READ_LAST.
    • Pass these KEY Field (PERNR, SEQNR) to IMPORT MACRO
    RP-IMP-C2- RU to import all the relevant field entries from PCL2
    DIRECTORY to all the cluster tables
    • Get the required fields by looping through cluster tables.
    Integration
    All data is stored in internal tables and saved in files with a cluster structure.
    Internal Tables: Internal tables store data during payroll.
    The system imports data to these tables and used them to calculate new data. This data is then also saved in internal tables.
    At the start of the payroll run, the system reads the values from the results tables to the old results table (ORT). Data from the previous period is, therefore, available in the current payroll period.
    The most important internal tables are:
    • Input table (IT)
    Table IT contains data that can be edited. The table exists only during processing.
    •• Output table (OT)
    Table OT contains the results of an activity. These results are written to the input table for further processing. The table exists only during processing.
    •• Results table (RT)
    Table RT contains the results of the period for which payroll has been run. The system saves this data in the PCL2 file in cluster RX.
    Interaction of IT, OT and RT:
    The necessary data for the respective processing step is loaded into the input table and is thus available for various processing procedures. The results of a processing step are stored either in the output table or the results table. At the end of a processing step, the data from the OT is loaded back into the IT, where it is available for further processing steps. The IT and OT are only temporarily filled, whereas the RT is stored on the database. In one of the first processing steps, the RT of the last payroll accounting period is imported into the old results table (ORT) and can consequently be used for further processing.
    Payroll Relevant Files:
    Payroll files contain data for payroll and payroll results.
    Structure
    The system requires the following files for payroll:
    • Pnnnn (nnnn = number of the infotype)
    The Pnnnn files contain data that has been entered in the respective infotypes for an employee.
    Example
    P0000 - Actions Infotype
    P0008 - Basic Pay Infotype
    • PCL1
    The PCL1 file contains primary information, in other words, data from the master data and time recording systems.
    • PCL2
    The PCL2 file contains secondary information, in other words, derived data and all generated schemas
    Integration
    When you start payroll, the system imports the relevant master data from the Pnnnn files (for example, basic pay and tax class) and imports the time data from the PCL1 file to the IT table.
    The system imports the payroll results from the previous month from table ORT (for example, to form averages).
    The system processes this data and saves the payroll results and generated schemas in the PCL2 file.
    Payroll Control
    Edited by: Alvaro Tejada Galindo on Apr 8, 2008 5:09 PM

  • How to setup internal fulfillment process on release 11.5.10

    Dear All,
    If anybody has previously implemented internal fulfillment between two operating units , if any documents relating to its implementation and its integration with Oracle are available please share to me.
    I know there are some white papers in metalink but they are a little bit confunsing.
    As far as I know it has the following steps
    Receiving org - Internal Requisition:
    Enter Requisition, Approve: Will show cost of shipping org as informational price of requisition, not IC price
    Receiving org – Create Internal Orders (request)
    Shipping Org:
    Import Sales Order – parameter by requisition (menu option) – price is informational only, not IC price.
    Reserve sales order and pick release (after other required steps)
    Ship-Confirm (add freight if needed)
    Run Costing Manager
    Shipping Org:
    Create intercompany AR Invoices (request)
    Run Auto-Invoice (request – source: internal)
    Receiving Org:
    Create intercompany AP Invoices (request)
    Payables Invoice Import (request)
    Thanks in Advance
    Regards,
    [email protected]

    Just FYI.
    I probably overestimated RHEL/OEL-5.3 capability to "compete in Music Showbiz" as a digital studio workstation OS. Seems that "very old" alsa kernel drivers (1.0.17), compiled with actual kernel, don't like Audigy cards when it comes to MIDI interface, despite the fact the audio is perfect. Although I am still not sure nothing could be done as a workaround in order to get MIDI worked on OEL-5.3, the fact is that SB Audigy MIDI works like Roland Synth, sounding amazingly, if the kernel 2.6.18-128.1.1.0.1.el5 is recompiled with the actual alsa driver version 1.0.19 (modules snd-emu10k1, snd-emu10k1-synth, etc).
    It's interesting that overall device and loaded-modules schema's picture is the same as with old alsa (original kernel). That's why I still think something could be done, at least as workaround, to get MIDI worked with original OEL-5.3 kernel.
    NJ

  • Need an app for a bc hotel reservations that gives the price.

    Hello everyone,
    I would like to know how can i make a hotel bookings web form in Bc were the clients enter the date, the type of room, the number of nights, the number of rooms,  and the form gives the value in € at the price field, then wen the client clicks the reserve button it redirects to the reservations web form. How can this be done in bc? Are there any free or paid templates that do this for BC?What about bc app store?

    Post replication, original post:
    Hotel Bookings web form in BC

  • Hi my add no:301705896039 does not show my 'buy it now' option... and cannot put a reserve price

    As said above...cannot put a reserve price on my add... I did put a buy now price... but it does not show up on the add!!! 

    pylapatus wrote:
    As said above...cannot put a reserve price on my ad... I did put a buy now price... but it does not show up on the ad!!!  For an auction you do not need a reserve price -- just start the auction at the minimum price you want. You should not start at 0.01 -- most auctions these days rarely get 2 bidders. And you need at least 2 bidders for an auction to work for you. If there is a bid, the buy-it-now option will disappear. You do have a bid showing for that item -- so Buy-It-Now is removed for your auction. Option of last resort: You can (1) cancel the bid, (2) then cancel the auction and (3) list again with options properly set up. 

Maybe you are looking for

  • How do you make the Iphone 4 ring from its speaker while it is connected to a charging dock?

    I have a basic charging dock for my Iphone. It allows it to be plugged into my MacBook via usb or to a wall charger it also has a line out port. I typically just use it to charge on my bed side table. When its connected and the phone rings it just vi

  • Laerner want to know xi landscape in realtime environment

    Hi, Normally XI server will be in some place and we will work from a remote place through logon pad. suppose I want to work on file-xi-jdbc like scenario. So to upload the file into xi, is it necessary that file should always be on xi server or even

  • "Paste in Front" Gap?

    Hello everybody, I'm getting gaps between boxes when I paste in front (see screen shot). I've tried adjusting the origin point from the center to the corners and it doesn't help. It seems like it's offsetting the stroke width, which shouldn't be happ

  • Changing JPanels at runtime

    Hi guys, I'm writing a turorial apllication. I want to break down the information into JPanels, however I can't seem to swap between JPanels at runtime. I've tried calling validate and revalidate and then repaint... but I cant seem to get it working.

  • Mac App Store, Lion, Remote Desktop

    Just installed Lion. Minimal problems. One is that I can't use the Mac App Store. The application runs, but I can't sign in, or (obviously) do anything that requires signing in. Just get "Connection failed." Similar problem with iTunes Store. No idea