+ All Categories
Home > Documents > Introduction to PU12 Interface Toolbox - Part 1

Introduction to PU12 Interface Toolbox - Part 1

Date post: 12-Oct-2015
Category:
Upload: arbindokilu
View: 72 times
Download: 8 times
Share this document with a friend
Description:
Introduction to PU12 Interface toolbox - Part 1.pdf|Uploading...
Popular Tags:

of 56

Transcript
  • Generated by Jive on 2014-08-08+02:001

    Introduction to PU12 Interface toolbox - Part 1

    PU12 Interface tool

    PU12 Interface tool: PU12 is a tool to transfer data from the application components in Human Resources(HR)to a third-party system. The data is retrieved from Personnel Administration (PA-PA) or Payroll (PY) orTime Management components, or from all three.

    We use the Interface Toolbox to retrieve data from Human Resources for further processing in a third-partysystem. The third-party system can be a payroll system used outside of the SAP System. This can be useful if,for example, we run gross payroll in our enterprise and the net payroll takes place in a third-party system.Alternatively, we can use the Toolbox to import results based on personnel numbers from the third-partysystem and use them for payroll in the SAP System.

    This document describes the steps for creating interfaces using PU12 tool with detailed screen shots forfollowing scenarios:

    Personnel Administration (PA-PA) without change validations. (Part1) Personnel Administration (PA-PA) with change validations.(Part2) - http://scn.sap.com/docs/

    DOC-56426 Payroll (PY) without change validations.(Part3)

    Prerequisites

    We use the following application components in enterprise: Personnel Administration (PA-PA) Time Management (PT) Payroll (PY)

    PU12 Interface for (PA-PA) without change validations:

    Interface Format: The interface format contains the objects that we want to export from the HumanResources Application component (HR) to a third-party system.

    The interface format is the basis for data export with the Interface Toolbox. We use the interface format todetermine which HR data we want to select, and also how this selection should take place. When we definean interface format, we can access all employee data for the following application components:

    Personnel Administration (PA-PA) Time Management (PT)

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:002

    Payroll (PY)

    Using our defined interface format as a basis, the Interface Toolbox will ultimately generate a program usingthe Advanced Business Application Programming language (ABAP). We use this program to export the data.The system processes the data quickly and effectively during the export.

    Process flow diagram:

    Interface format steps:1. 1. Execute transaction code PU12 for creating interface format.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:003

    The interface toolbox involves following three tabs: Export tab: It is used to execute the interface and read respective results. Export History tab: It is used to see the log, and results of previously executed runs. Configuration tab: This is used for interface development.2. 2. Configuration tab details:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:004

    Interface Format: This is the place where we specify input layout of interface which includes datarequired by interface for e.g. Tables, info types and fields.Conversions, Restrictions, Change validations andother configurations are also handled here in order to pick the right data for the interface. File Layout: In File Layout we will specify the output structure of interface that is we will specify whichfields will be part of output file, their respective widths, order and frequency (e.g. for each employee). Create: Used to create new Interface Format or File Layout. Change: Used to change existing Interface Format or File Layout. Display: Used to display existing Interface Format or File Layout. Copy: Used to create new Interface Format or File Layout by copying existing Interface Format or FileLayout. Generate: Used to generate ABAP code for Interface Format or File Layout. It is implemented onceall the changes of Interface Format or File Layout are completed. Ideally, we need to generate the InterfaceFormat and File Layout every time we do a change in any of them, so that it generates fresh ABAP code for theconfiguration and we do not get any error.

    1. 3. Create a test interface format YIN3 as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:005

    2. 4. Enter respective country grouping as shown below.

    Note: One PU12 interface format is only for one country. Hence if we are dealing with multiple countries, weneed to create respective multiple interface formats. This step cannot be undone or changed later on, so if youchose a wrong country then you will have to delete the interface and create it again from scratch. File formatcan be reused for other countries as it does not require country grouping while creation.3. 5. Select Master data option for PA as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:006

    6. In this step select the info types that will be required by interface. As part of this example we will consider IT2, 6, 7, 9 and 21.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:007

    5. 7. Enter program and include names that it will generate for the interface format. Click on suggest valuesbutton, or you can chose a name according project naming convention.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:008

    This is a test interface hence we are changing Z to Y for main program and includes.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:009

    6. 8. Interface format is as shown below:

    7. 9. Now choose the fields that will be required by the interface and remove all unwanted fields. Select thefields by double clicking and use the delete button to remove them as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0010

    8. 10. For this test interface we have selected following fields:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0011

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0012

    9. 11. Table Entries : Here we specify which entries to pick, all of them are self-explanatory, and we willchose 2nd option for all the 5 infotypes.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0013

    10. 12. Conversions : Using this icon conversion can be done on field level. Click on the field and then click onthe conversions icon. There are three kinds of conversions that we can implement for any field selected.Types of Conversion: Constant Conversion. Table Value Conversion. User exit Conversion.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0014

    Constant conversion: This will give us a way to convert the values in the infotypes fields to constantvalues that we will provide in a table format.For e.g.: a constant conversion on FAMST field of infotype 0002 as shown below.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0015

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0016

    Table value conversion: It looks into a database table for and matches values of infotypefield mimicking a SELECT statements where clause and picks up the corresponding values. Fore.g. consider country field of the infotype 0006 as shown below.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0017

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0018

    Through above conversion we will pick up the description of the country from table T005U.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0019

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0020

    User Exit conversion: This is where a custom code logic will be involved, if above two methodscannot give the required conversion. We will need to create a custom program with a subroutinein it. It is important to specify the type of the program as subroutine pool.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0021

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0022

    Specify the program name and form routine in below pop-up:

    Code snapshot for User Exit:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0023

    1. 13. Restrictions : Here we restrict records that the interface will fetch from infotypes; it is likea where clause of select statement and only constant restrictions are allowed in this case. Fore.g. Restriction on infotype 0006 to get the specific subtype 1 and 2 as shown below.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0024

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0025

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0026

    2. 14. Attributes: A very important place where we specify the general settings of the interface as shownbelow.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0027

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0028

    Attribute details: Interface without payroll: Determines the relationship between the export program and the payrollprogram. 1. If you do not select this option, system executes export program after payroll program. The exportprogram refers to results of payroll program. That is The export program determines the payroll period from the payroll results generated in the payrollprogram. The export program only selects an employee if a payroll result exists for that employee for the period tobe exported. 2. If you select the attribute, the export program is processed without the payroll program. The export programgenerates the payroll period independently. Any existing retroactive accounting data is taken into account inpayroll. The export program evaluates the entry in the Earliest Master Data Change field in the Payroll Statusinfotype (0415) during the generation of the payroll periods. After a successful export, the export program updates the Payroll Status infotype (0415).o The following fields are updated:o Field: Exported untilo Field: Earliest MD Change

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0029

    The export program updates match code W. Match code W is the list of all personnel numbers rejectedduring the export.No retroactive accounting:

    1. If you Flag the attribute, the interface format does notperform retroactive accounting. Retroactive changes in HRmaster data are not exported. The system always only exportsthe current payroll period.

    2. The toolbox only evaluates the parameter for HR masterdata (infotypes) interface types. The attribute Interface withoutPayroll must be flagged. Check control record:1. If you flag the attribute, the export program checks the Payroll Control Record. The system only exportspayroll areas with the active status Released for Payroll in the payroll control record for the correct payrollperiod. This means that no changes can be made to the HR master data during data export. This guaranteesthe following: Export of consistent datasets to the third-party system. Changes to the HR master data are not lost during data export. The correct payroll period is selected.2. If you do not flag the attribute, the export program does not check the payroll control record.Indirect valuation of wage types:

    If you select this attribute, the Interface Toolbox performsan indirect valuation for wage types in the Basic Pay (0008),Recurring Payments and Deductions (0014), AdditionalPayments (0015), and Additional Off-Cycle Payments (0267)infotypes. Interface Format: New Change Validation If you flag the attribute, the new variant is used to determine the predecessor of the payroll period(comparison period). We recommend this variant.Advantages: Every change is only sent once for each payroll period. These changes are no longer sent in thecase of subsequent exports that follow the first export. This is in contrast to the old variant. The toolbox alwayssends retroactive changes.Note: During the first export after a change covering several periods, the changes are sent for every payrollperiod affected by the change.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0030

    If you do not flag this attribute, the old variant is used to determine the predecessor of the payroll period.Disadvantages: Changes are sent several times when there are several exports for a payroll period. Undercertain conditions the toolbox does not send retroactive changes.

    Do not save to cluster IF: Causes the system not to update the interface results on the cluster IF (InterfaceFormat). This cluster object is found in the database object PCL2 (Payroll). For the personnel numbersselected, it contains the contents of all the table objects from the interface format at the time of export. If you do not select the attribute, the export program updates the interface results in the cluster IF. Thechange validation and wage type options for retroactive accounting depend on the interface results beingsaved. Both functions can only work without errors, if the interface results were saved in the cluster IF. If you select the attribute, proceeding data exports should have no influence on the current export. Thismeans that you cannot use the change validation and wage type functions for Retroactive Accounting. Dependencies: If you change the attribute, you must regenerate the export program.

    Save current results only: Causes the system to only save the current interface results on theCluster IF (interface format). The results have status indicator 'A (current).

    To ensure that the export program works correctly, you onlyneed to save the current interface result for the payroll period.The functions Change Validation and Wage Type Options areintegrated for retroactive accounting (R1 to R4).You can activatethe attribute to save memory space. Dependencies: If youchange the attribute, you must regenerate the export program.3. 15. Save the interface format and go back to the main screen.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0031

    4. 16. Generate the ABAP program for interface format as shown below:

    5. 17. Program generated successfully as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0032

    We have created the interface format using above steps (1 to 17). The export program is generatedsuccessfully as shown above.

    File Layout: The file layout describes the structure of the export file, in particular the sequence and length ofthe field objects.The File Layout function allows you to convert the export file format, which is known as theSAP export file format, into any user-defined file format. An interface format is assigned to each file layout.

    Process flow:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0033

    File layout steps:The default output for PU12 interface tool is a text file and we will need to define a file layout of our exporteddata.1. 1. Create a custom file layout as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0034

    Provide the interface format created in above steps. In this step, the interface format is linked with File Layout.

    2. 2. Create a Block as shown below:

    Note: Blocks are at the top level of file layout hierarchy and they do not contain any data by themselves. Theycontain further structures which also do not contain any data. Each structure can contain fields which actuallycontain data in them. It is important to use these as per our logic for the requirement.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0035

    Processing time of a block: This option determines the processing time for a Block. During block processingby the Interface Toolbox, various processing times occur. At one particular processing time, the Toolboxprocesses all the blocks you have assigned to this time.Select a processing time for block processing: Start of File:The Toolbox processes these blocks at the start of the file to be converted. This processingtime exists exactly once. Employee Data before Processing: Before the Toolbox processes employee data, it checksthe processing time "Employee Data before Processing. The system calls this processing timeexactly once for every payroll period for an employee. Employee Data during Processing: The Toolbox calls this processing time when it processes payrollperiods for an employee. The system calls this processing time exactly once for every payroll period for anemployee. - Employee Data after Processing: After the Toolbox has processed the payroll periods for anemployee, the Toolbox calls the processing time "Employee Data after Processing". The system calls thisprocessing time exactly once for every employee in the file to be converted.

    - End of File:The Toolbox processes these blocks at the end of the file to be converted. Thisprocessing time exists exactly once.3. 3. Create a structure as shown below:

    4. Create following fields in above structure:

    EMP_NUMBER (Dynamic value):

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0036

    Length of a referenced field will ask in later step a field name to limit the output length to that referenced field.Because of Dynamic value we will chose a field that will populate the data in this field.

    In above screenshot we have chosen the field P0002-PERNR so the field width will be picked same as fieldwidth of P0002-PERNR

    field.In above screenshot we have chosen the global variable &VAR_PERNR which will contain the pernr value ofthe currently processed PERNR. Current entry makes sure that the record is active.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0037

    Constant value, as it says will replace the contents with a constant value, irrespective of the contents ofthe infotype. Dynamic value will get the data from the infotype or the global variables, (there are many globalvariables available, and that can be viewed by hitting F4). User exit will execute a custom routine and the returned value will be placed in the contents.

    WEEKDAY (User exit):

    Consider an example for user exit at field level as shown below.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0038

    Defining the length of weekday:

    Weekday field will contain the weekday of P0002-BEGDA and it will be placed in this field.Subroutine has 16 parameters, out of which first 15 are input parameters to the form and the 16th is the returnparameter which will replace the contents of the field in file layout as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0039

    The first, last and current value columns specify which record of the infotype to pick to pass value for P0002-BEGDA, the first, last or current active record.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0040

    Code for this user exit is as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0041

    Constant field (field having constant value ):

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0042

    Defining the length and value of constant field as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0043

    Value of the constant field is set to X_X as shown below:

    We have also added some additional fields as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0044

    5. 5. Enter program and include names that it will generate for the file layout. Click on suggest values button,or you can chose a name according project naming convention.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0045

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0046

    Changing Z to Y for main program and includes since its a test interface.

    6. Save the File layout format and return to the main screen as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0047

    7. Generate the ABAP program for file layout:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0048

    Test Interface for (PA-PA) without change validations

    Detailed steps for testing the interface:1. 1. In the Export tab, select Interface format and execute it.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0049

    2. 2. Export Options: Provide the selection screen data as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0050

    Export for original periods only: This option determines whether the system should export all periods or onlyoriginal periods. The original period corresponds with the payroll period in which the data export is started. If you flag the checkbox, a comparison is made with the last original period in the change validation,since it is the last period transferred to the third-party system. SAP recommends the export option when the third-party system does not support retroactive accounting. If you do not flag the checkbox, then the last period can also be a retroactive accounting periodExample: Payroll is run for an employee for period 03 with retroactive accounting to period 01. If the parameter is active, data is only exported for period 03 in 03. (Wage type differences must betransported to the current period using option R4). If the parameter is not active, data is exported for three periods (01 in 03, 02 in 03, and 03 in 03).

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0051

    Repetition of Export: This option determines whether thecurrent data export is a repetition or a new export. Thisinformation is of significance for the Toolbox in connection withthe change validation.

    Example: You have already exported data for your payrollperiod 02. Start a new export for payroll period 02. There are twooptions for the "repetition" export option: Option 1: The checkbox is not flagged.Effect 1: The export program treats the current export as an additional export for payroll period 02. The changevalidation compares data from payroll period 02 with the data from the previous export for this payroll period.This makes it possible to export a payroll period several times and only transfers the differences to the third-party system. Option 2: The checkbox is flagged.Effect 2: In the case of an active change validation, the export program ignores the first export from payrollperiod 02. The change validation compares the data from payroll period 02 with data from payroll period 01.Data from the first export is also deleted for payroll period 02. If you perform three or more exports for the payroll period and the Repetition checkbox is flagged, onlythe immediate previous export is ignored for the current payroll period. The system compares with the exportbefore last for the current payroll period.Not all exports are ignored for the current payroll period.Update When Exporting: This option decides whether a data export is only simulated or is actually carriedout.The checkbox must be flagged for every productive data export. If you do not flag the checkbox, the export program does not create an export file.

    The interface results on the cluster IF (interface format) are not updated. If you flag the checkbox, the export program creates the export file.

    The interface results on the cluster IF (interface format) are updated.

    Export Log:

    If you flag the checkbox, the system shows detailedinformation on the export data and change validation. You also flag the checkbox if you want to start the export program for test purposes for individualpersonnel numbers.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0052

    On execution the output is as shown below:

    Marital status is a converted value as shown below:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0053

    3. 3. Download from TemSe, i.e. Temporary Sequential File as shown below: In TemSe Object, hit F4.

    Select below option:

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0054

    Select the latest TemSe file

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0055

    Provide the file path on presentation server as shown below.

  • Introduction to PU12 Interface toolbox - Part 1

    Generated by Jive on 2014-08-08+02:0056

    File downloaded:


Recommended