Activity 2- Using CI and AE

Activity 02:-

Using CI and AE we’re populating data directly in PIA(to this page).(inbound also there)

(using Multilevel Component Interface):

Steps and hints:

1. Create records

2. pages,

3. components- search record as our physical record

4. When you going to write code in you project , USE UR RECORD And FIELD names , otherwise it’ll execute.

Flow of Objects:

Flow Of Records:

This is that page:

Flow of App.engine:

Flow of File Layout:

Code:

1. Truncating the Staging Record:

In sql section -

DELETE FROM PS_Z_EMP_STG;

2. Here getting the data from Out file:

In inbound Section:

Peoplecode: (Inbound code only)

Local File &MYFILE;

Local Record &REC;

Local array of string &ARRAY;

&MYFILE = GetFile("C:\Documents and Settings\raghavr\Desktop\Satya.CSV", "R", "a", %FilePath_Absolute);

&REC = CreateRecord(Record.Z_EMP_STG);

&ARRAY = CreateArrayRept("", 0);

If &MYFILE.IsOpen Then

If &MYFILE.SetFileLayout(FileLayout.Z_EMP_FLT) Then

While &MYFILE.ReadLine(&STRING);

&ARRAY = Split(&STRING, ",");

For &I = 1 To &REC.FieldCount

&REC.GetField(&I).Value = &ARRAY [&I];

End-For;

/* do additional processing here for converting values */

&REC.Insert();

End-While;

Else

/* do error processing - filelayout not correct */

End-If;

Else

/* do error processing - file not open */

End-If;

&MYFILE.Close();

3. Pass the values from Staging to State Record:

In Staging Section:

i) Do Select: (take sql action):

%Select(EMPLID,OFFICE_NAME,DIVISION1,PHONE1_TYPE,PHONE)

SELECT EMPLID

,OFFICE_NAME

,DIVISION1

,PHONE1_TYPE

,PHONE

FROM PS_Z_EMP_STG

ii) Peoplecode:

Here you drag the CI or you can write ur own Rowset logic code:

Local ApiObject &S, &CI;

&S = %Session;

&CI = &S.GETCOMPINTFC(CompIntfc.Z_EMP1_CI);

&CI.EMPLID = "1123";

&CI.CREATE();

&L1 = &CI.Z_OFF_TBL;

&L1R1 = &L1.ITEM(1);

&L1R1.OFFICE_NAME = "MY OFF";

&L2 = &L1R1.Z_DV_TBL;

&L2R1 = &L2.ITEM(1);

&L2R1.DIVISION1 = "COMP";

&L3 = &L2R1.Z_PH_TBL;

&L3R1 = &L3.ITEM(1);

&L3R1.PHONE1_TYPE = "FAX";

&L3R1.PHONE = "228276";

&CI.SAVE();

**************************************************************

Try and Do this practice With this above hints …

SHARE

peoplesoft

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Phaniraavi@gmail.com