Defining Writable Array Elements

To define writable array elements, use the Writeable Arrays (GP_WRITE_ARRAY) component.

Page Name

Definition Name

Usage

Writable Array Name Page

GP_PIN

Name the element and define its basic parameters.

Definition and Fields Page

GP_WRITABLE_ARRAY

Identifies the table into which the writable array process inserts data. Also identifies the element that populates each column (field name) in the table.

Writable arrays are elements that you can use to populate user-defined result tables. You use PeopleSoft Application Designer to create the result table, then you use the writable array pages that are described in this topic to define the element that populates the table during batch processing. Writable arrays are in many ways the opposite of standard arrays. Instead of reading values from a row in a table to user-defined variables, a writable array writes the values of user-defined elements into a row in a table.

Writable arrays make it easy for you to design reports that exactly meet your needs—each row in your table can produce a corresponding line of information in your report. You can also combine multiple tables to create a report, for example, use one table for a report header, one for the body of the report, and another for the footer.

Finally, writable arrays can also conserve valuable storage space by consolidating many vertical rows of information into a single horizontal row.

To define a writable array:

  1. Use PeopleSoft Application Designer to create the table that the writable array element populates.

    The first seven fields in the table must be the same as the keys in the basic result tables. You can also use some of the optional result table keys, such as INSTANCE or SLICE_BGN_DT, and include keys that are not used in the basic result tables, such as DEPTID.

    The seven fields are:

    • EMPLID

    • CAL_RUN_ID

    • EMPL_RCD

    • GP_PAYGROUP

    • CAL_ID

    • ORIG_CAL_RUN_ID

    • RSLT_SEG_NUM

  2. On the Writable Array Name page, define the naming information for the writable array.

  3. On the Definition and Fields page, identify the table that the writable array is to populate, and map the elements that are to populate the table to the corresponding fields (columns) within the table.

Note: When you create a result table using a writable array, the table must include the basic segment status keys shared by all the standard result tables. You can include additional keys as well.

While custom result tables can conserve storage space, they can also increase the need for space if they duplicate data from the standard result tables. Consider using writable arrays to consolidate or temporarily store the following types of results:

  • Miscellaneous personal data required for audit purposes.

    You might want to store these values in a single row instead of in the standard result tables and keep the records as long as you need them for auditing purposes.

  • Period summary data.

    If you need to summarize data by period on year-to-date reports, you can save summary data for each period for as far back as needed.

  • Temporary data used in reports.

    For reporting purposes, you may want to duplicate data found in the standard result tables but present it in a different form. You can then delete the data once you complete the reporting period.

Because you may want to delete temporary data at different times, the management of the data in your result tables is up to you.

Typically, each call to a writable array element creates one row of data. To produce multiple rows of output, you can use loops within a subprocess section and arrays to call the writable array multiple times. Using pointers and variables, you can populate the same field in a writable array with values from different elements, as long as you do not map character and numeric elements to the same field.

Use the Writable Array Name page (GP_PIN) to name the element and define its basic parameters.

Navigation:

Set Up HCM > Product Related > Global Payroll & Absence Mgmt > Elements > Supporting Elements > Writable Arrays > Writable Array Name

When a writable array resolves successfully, the element itself is set to one. Most likely, you will not want to store this value, so the Store and Store if Zero options on the Element Name page are not selected, by default. You can select them if you choose.

In addition, writable arrays are not effective-dated, so there is no definition as of date on the Writable Array Name page. If you need to change the element's definition, create a new writable array instead, and then create new effective-dated elements that reference the new writable array. If you rename a database table or view, create a new writable array.

Note: You name every element and define its basic parameters on an element name page with the object name of GP_PIN. The page title and general appearance of this page change based on the type of Global Payroll element that you are naming and defining. All of the fields on this page are documented in another topic in this product documentation.

Use the Definition and Fields page (GP_WRITABLE_ARRAY) to identifies the table into which the writable array process inserts data.

Also identifies the element that populates each column (field name) in the table.

Navigation:

Set Up HCM > Product Related > Global Payroll & Absence Mgmt > Elements > Supporting Elements > Writable Arrays > Definition and Fields

This example illustrates the fields and controls on the Definition and Fields page.

Definition and Fields page

Note: The writable array must have a record name and at least one field name in order to save.

Field or Control

Description

Record (Table) Name

Enter the name of the table that the writable array is to populate. The only tables available for selection are those containing the seven required key fields of a writable array.

The system appends the prefix PS_ to the table name and uses the new name in the INSERT clause of a SQL statement.

Insert Rows Immediately

Select if you are defining a writable array to generate data for immediate use by a standard array in the same process. This ensures that the data is present in the database when the standard array element is processed.

If this check box is not selected, the system does not immediately write data to the database table that the array is populating. It inserts the data at a later time using a bulk insert process.

Note: Not all relational database management systems provide bulk insert. For these, the rows will always be inserted one-by-one as they are processed.

Field Name

Enter the name of the writable array field that you want to populate. The list of available options includes only those fields that are included in the table that you selected in the Record (Table) Name field.

The order in which you add field name is not important.

Entry Type

Select the type of element that will populate the field.

Element Name

Select the element whose value the system uses to populate the writable array key field that you are defining.

Note: During processing, the system populates the array with the current value of the selected element. (Linking an element to a writable array field does not, in itself, cause the element to resolve.)