-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPO_SavePostChangeRS2JSON.peoplecode
More file actions
52 lines (44 loc) · 1.61 KB
/
PO_SavePostChangeRS2JSON.peoplecode
File metadata and controls
52 lines (44 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
REM **** PP ADD START ****;
rem Convert Rowset to JSON;
import PP_UTIL_PKG:RowsetJS:*;
import PSXP_ENGINE:*;
import PSXP_RPTDEFNMANAGER:*;
import PSXP_XMLGEN:RowSetDS:*;
REM **** PP ADD END ****;
REM **** PP ADD START ****;
&startTime = %PerfTime;
REM **** PP ADD END ****;
REM **** PP ADD START ****;
Local XmlDoc &SomeXMLDoc_;
Local Rowset &rsLvl0_;
Local Record &recPPWrk_;
Local string &sJSONReply_;
Local PSXP_XMLGEN:RowSetDS &oRowSetDS;
Local PP_UTIL_PKG:RowsetJS &oRS2JSON_;
&oRowSetDS = create PSXP_XMLGEN:RowSetDS();
&oRS2JSON_ = create PP_UTIL_PKG:RowsetJS();
&rsLvl0_ = GetLevel0();
&sJSONReply_ = &oRS2JSON_.getJSONData(&rsLvl0_);
&End = %PerfTime;
&TimeDiff = NumberToString("%6.3", Value(&End - &startTime));
MessageBox(0, "", 0, 0, "Time taken to generate JSON for " | GetLevel0()(1).GetRowset(Scroll.PO_LINE).RowCount | " line PO: " | &TimeDiff);
/*
Local File &BCFile_ = GetFile("/tmp/POComponentFile_" | %Datetime | ".txt", "W", "A", %FilePath_Absolute);
&SomeXMLDoc_ = CreateXmlDoc("");
Local string &strXML = &oRowSetDS.getXMLData(&rsLvl0_, "");
Local boolean &boolval_ = &SomeXMLDoc_.ParseXmlString(&strXML);
Local string &newoutStr_ = &SomeXMLDoc_.GenFormattedXmlString();
If &BCFile_.IsOpen Then
&BCFile_.WriteLine(&newoutStr_);
&BCFile_.WriteLine("**** JSON START ****");
&BCFile_.WriteLine(&sJSONReply_);
&BCFile_.Close();
Else
MessageBox(0, "", 0, 0, "File is NOT OPEN");
End-If;
*/
rem MessageBox(0, "", 0, 0, "&sJSONReply_ " | &sJSONReply_);
rem &recPPWrk_.DESCRLONG.Value = "";
rem &recPPWrk_.DESCRLONG.Value = &sJSONReply_;
rem &recPPWrk_.DESCRLONG.Value = &newoutStr_;
REM **** PP ADD START ****;