Title | Under | Posted on |
---|---|---|
Component interface Error: no rows exist for the specified keys | PeopleSoft Technical | 03/15/2019 - 3:54am |
ADD 24 months starting from current month.(peoplesoft) | PeopleSoft Functional | 07/29/2018 - 8:44pm |
TRC values dropdown | PeopleSoft Technical | 04/04/2018 - 12:54am |
how to find missing sequence in GRID and print the mising sequence number while saving through peoplecode | PeopleSoft Technical | 09/11/2017 - 4:49am |
never had to do read from an excel sheet. It is ALOT easier to read from a CSV file. I know for a fact that you need a windows server with excel installed on it to be able to read and write excel sheets from an Application Engine. If you are on a Unix box, you need to deal with CSV files and file layouts and not excel.
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Hi Krishna,
Here iam giving one example for your scenario/Question.
Example: I want to upload the data into record(Database) by using files,that means am having data from multiple files(.CSV/XLS).
We need to create a Filelayout based on your columns and drag and drop the filelayout into AE Peoplecode action and you need to customised that code.The below iam giving sample code for multiple excel files data upload to database.
Local array of string &FNAMES;
Local File &FILE1;
&FNAMES = FindFiles("C:\temp\*.csv", %FilePath_Absolute); /* Here * indicates fetching the multiple Excel files in that temp folder */
While &FNAMES.Len > 0 /* Here Len>0 indicates length >0 all files are fetching and upload the data into database */
&FILE1 = GetFile(&FNAMES.Shift(), "r", "a", %FilePath_Absolute);
&LOGFILE = GetFile("D:\temp\ErrorLog.err", "W", %FilePath_Absolute);
&FILE1.SetFileLayout(FileLayout.MA_TEST_FL);
&LOGFILE.SetFileLayout(FileLayout.MA_TEST_FL);
&RS1 = &FILE1.CreateRowset();
&RS = CreateRowset(Record.MA_TEST_STG);
&SQL1 = CreateSQL("%Insert(:1)");
&RS1 = &FILE1.ReadRowset();
While &RS1 <> Null;
ImportSegment(&RS1, &RS);
&RS1 = &FILE1.ReadRowset();
End-While;
&FILE1.Close();
&LOGFILE.Close();
End-While;
Regards,
Mahendra
Note: If am wrong please correct me.
Regards,
Mahendra
Peoplesoft-Analyst Programmer
Shift() ... What it will do ?
Hi ,
Shift() will get the files in that particular path based on number of files like one by one means shift wise.
Regards,
Mahendra