File Layout
File Layout
PeopleTools supports reading and writing to plain text files, and to files that have a format based
on a File Layout that has been created in PeopleSoft Application Designer.
If the file is a plain text file, data is read or written using text strings.
If the file is based on a File Layout, you can use text strings, rowset, or record objects.
This simplifies reading, writing, and manipulating hierarchical transaction data with PeopleCode.
Here the following work is done on single record and multiple records.
First we discuss on single flat file modal for this the following definitions were created.
Following steps are required to perform data transfer between flat file to single record and vice-
versa
Create a table with 3 fields like deptid, emplid and salary as shown below
Click on Preview tab of file layout and select the record name at segment name and set the
default file name.
4.Click on AE button and save the AE Program. The People code will be automatically
generated as given below.
rem *****************************************************************;
rem * PeopleCode to Import Data *;
rem *****************************************************************;
Local File &FILE1;
Local Record &REC1;
Local SQL &SQL1;
Local Rowset &RS1, &RS2;
Local integer &M;
&FILE1.Close();
&LOGFILE.Close();
By directly running the AE Program the information can be uploaded to the record
from flat file.
To write a flat file with data from a record create another filelayout definition and AE
Program with the code as given below
To read data from flat file and upload to the data base the following code is written
on a separate AE Program as below.