You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Application Engine inbound program

1 reply [Last post]
Guest's picture
Guest

Hi,

Can you please send application engine inbound program code(without filelayouts)

Regards
Ravi

raj.psoft's picture
User offline. Last seen 2 years 14 weeks ago. Offline
Joined: 03/25/2010
Posts: 26
Re: Application Engine inbound program

To use this code:

You need to create a AET record and use the existing or create new base record and runcontrol page input value(FILE_PATH_NAME,RECNAME) to inbound the data into record.

SQL Code:
%SelectInit (FILE_PATH_NAME, RECNAME)
SELECT FILE_PATH_NAME
, RECNAME
FROM %Table (XX_XXXXX_RUN1)
WHERE OPRID=%OperatorId
AND RUN_CNTL_ID=%RunControl

People Code:

Local File &MYFILE, &MYFILE1;
Local string &PATH_READ, &PATH_WRITE, &REC, &rec_value;
Local array of string &values;
Local Record &rec1;
&DATE = %Datetime;
&PROCESS_INSTANCE = XX_XXXXX_AET.PROCESS_INSTANCE.Value;

&REC = XX_XXXXX_AET.RECNAME.Value;
&PATH_READ = XX_XXXXX_AET.FILE_PATH_NAME.Value;
&MYFILE = GetFile(&PATH_READ, "R", %FilePath_Absolute);
&rec_name = "RECORD." | &REC;
&rec1 = CreateRecord(@&rec_name);

While &MYFILE.ReadLine (&rec_value)
&values = Split(&rec_value, ",");
For &j = 1 To &values.Len

&rec1.GetField(&j).Value = &values [&j];
End-For;
&rec1.Insert();
End-While;

Type:2
Local File &MYFILE, &MYFILE1;
Local date &date;
Local string &PATH_READ, &PATH_WRITE, &REC, &rec_value;
Local array of string &values;
Local Record &rec1;

rem local datetime &DATE1;
rem &DATE1 = %Datetime;

&RECNAME = XX_XXXXX_AET.RECNAME.Value;
&FILE_PATH_NAME = XX_XXXXX_AET.FILE_PATH_NAME.Value;
&MYFILE = GetFile(&FILE_PATH_NAME, "R", %FilePath_Absolute);
&rec_name = "RECORD." | &RECNAME;
&rec1 = CreateRecord(@&rec_name);

While &MYFILE.ReadLine(&rec_value)
&values = Split(&rec_value, "|");

For &j = 1 To &values.Len
&val = &values [&j];
If IsDate(&values [&j]) Then
SQLExec("SELECT TO_DATE(:1,'YYYY/MM/DD') FROM PS_INSTALLATION", &values [&j], &date);
&rec1.GetField(&j).Value = &date;
Else
&rec1.GetField(&j).Value = &values [&j];
End-If;
End-For;
rem &rec1.Insert();
End-While;

Raj

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
6 + 6 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.