Help Center>Step-by-Step Guides Help

PA40 step by step: Personnel Actions

In this exercise, we use Winshuttle Transaction to create a PA40 t­code template in Excel. The Excel template provides an easy way for users to upload new hire information into SAP. We will add one new hire so that we can see how to create an Excel template in Transaction.



  1. Start Winshuttle Transaction from the desktop shortcut or from the Windows Start menu.
  2. Click New.

    file tab new button

  3. Enter transaction code PA40 in the Transaction Code box, and then click Go.

    enter the tcode click go to start recording

    An SAP Log On screen appears.

  4. Click the SAP system that you want to use and then click OK.
  5. Enter the appropriate user data in the SAP Logon window, and then click the OK button.

    sap logon box

    If you do not see the SAP system that you want, click the System button and choose a different system.

  6. For the recording mode, click Non-Batch Input Mode and Without SAP Controls.

    recording properties box

    Note: Non-Batch Input Mode Without Controls will work for most transactions. Non-Batch modes are necessary for downloading information from SAP transactions, or for Finance or HR transactions in which there are Dynamic Actions executing or user parameter values being used; otherwise, if you do not have access to Non-Batch modes, you can try recording in Batch Mode. The difference between Without SAP Controls and With SAP Controls is just a matter of what tools are on the transaction screens. For more information, see the Recording modes topic (Connect mode or Central mode).

  7. Enter any additional properties in the appropriate fields.
  8. To prevent people from editing the script, check the Lock TRANSACTION script box. This will password-­protect the script, preventing anyone from changing it.
  9. Click Next.

    The PA40 transaction starts. For each HR Action performed, the SAP system configuration requires certain info types to be created.

    These are called Dynamic Actions.

    Note: The following screens may vary according to the way that your SAP system has been configured.

  10. In SAP, on the Personnel Actions screen, enter the start date. For the Action Type, select Hire. Click the Execute button.

    personnel actions screen

  11. On the Hire screen, enter the required data, and then click Save.

    hire screen

    The Personnel Data info type is created.

  12. On the Personal Data screen, fill in the required data, and then click Save. The Personal Data info type has been created.

    create personal data screen

    Based on your SAP system configuration for a Hire Action, you will then be directed to the next info type that must be completed for the Hire Action.

  13. Continue to create info types. Click Save to move to the next info type in the Hire Action. When you complete the Hire Action, SAP returns to the Personnel Actions screen.
  14. Click Back. You are brought back to Transaction.


It is now time to create the mapping for this transaction. Mapping a script is just a matter of connecting SAP fields to fields in your data file. Transaction provides a Mapper to facilitate this process.

Auto Mapping will map the entire script to an Excel spreadsheet and in order. Because of the complexity of this transaction, we will choose the Create Mapping option instead.

  1. In the Map pane, click Create Mapping.
  2. The screenshot below shows the Expert Tab of the Mapper.

    Each row of the Mapper displays the following:

    • Mapper Row number: This is just a reference number.
    • Enable flag: only enabled Mapper rows will be executed by Transaction.
    • Screen / Screen Number: Technical screen information from the recorded transaction.
    • Field Description: The label associated with the SAP technical field name.
    • Field Name: The SAP technical field name.
    • Mapping Type: Fixed Value, Excel to SAP, SAP to Excel (or, if mapping to Access: Access to SAP, SAP to Access).
    • Value: Values assigned to the SAP field; either fixed values or values to or from the assigned data source.
    • Notes: Free­format notes to provide useful information to runners of the Transaction script.

    mapper expert view

  3. In the Data Source Preview section, you will see a preview screen of the selected data source.

    To change the Data Source, click the Change Source Type link at the top of the Expert Tab.

    This displays a drop-down box to switch to Microsoft Access. The Preview section will also change to reflect the choice.

    In this case, we will use Excel.

  4. It is easiest to map from the Basic tab (as shown below). Click the Basic tab.

    mapper basic view

  5. To map the script to the data source, you will drag in the direction that the data will move. For this script, you are uploading data from Excel to SAP, so you will drag from Excel to SAP.

    Drag column A up and drop it onto row 2.

    Continue across the Excel preview by dragging column B up and dropping it onto row 3, column C onto row 4, and so on, until all the fields that you want have been mapped.

  6. Continue this mapping process for any other info types created during the Hire Action.

    fields mapped to excel columns

Clearing the Personnel Number field

By default in SAP, the personnel number field on the initial screen contains the personnel number of the previously hired employee. For Transaction to process subsequent Hire Actions, you must clear this field.

  1. Click the Expert tab.

    In the Transaction Mapper, the personnel number field (RP50G­PERNR) is not enabled because we did not edit this field in the initial recording. You can tell that the field is not enabled, because the check box in the Enable column is not selected. If you cannot see this field, click the Filters button in the Mapper and then click Hide All Disabled Fields to turn that filter off.

  2. To enable the Personnel Number (RP50G­PERNR) field, click its check box in the Enable column.
  3. Leave the Mapping Type set to Fixed Value Upload, which is indicated by the red push pin, and leave the Value field blank.

    personnel number field enabled

  4. Find the next instance of RP50G­PERNR, and enable the field.
  5. To download personnel numbers from SAP, drag that instance of the Personnel Number field down and drop it in the column in the Excel preview pane where you want the Personnel Number to be displayed.

    personnel number dragged to excel preview

  6. Click the Save button above the Excel Preview pane to save the Excel template.
  7. To save the script file, click the Save button on the File tab.
  8. Click the back arrow button to exit the Mapper and go to the Run pane. The next step is to populate the Excel spreadsheet with data to upload into SAP.

Add the data

Transaction loads the Run pane.

If necessary, you can navigate back to the Mapper by clicking the Update Mapping link on the Map pane.

link to open mapper and update mapping

  1. Click the Excel icon to the right of the Select Data File box. This will open the mapped Excel file that is listed in the Selected Data File box.

    run pane

    Note: Transaction will automatically assign the Log column to the next available column after the last mapped column (in this case, column N).

  2. Type the data in the columns, and then save the Excel file.

    After you enter the data into the Excel spreadsheet, you can run the script.


Back at the Transaction Run pane, you can specify a start and end row, specify the Excel sheet that contains the data, and change the Log column.

  1. To execute the upload, click the Test button, if you are a Central user, or click the Run button if you are not a Central user.
  2. In the SAP Logon window, if necessary, click the System button to select the appropriate SAP system.
  3. Enter the appropriate user data, and then click OK.

The Hire Action is executed based on the data in the spreadsheet.

The note in the Log column indicates that the Hire Action was successful, and column M, in this example contains the downloaded personnel number for each new hire.