Now that, we have a list of programs (all in Reporting mode) wherein we have to call that subprogram, process the input data and retrieve back the results (in dynamic array).
In Reporting mode, field definition expects the total size of the param’s to be entered which I cant provide.
Is there a way to handle dynamic arrays from a reporting mode program.
X-array is defined in a DEFINE DATA statement (same holds true for dynamic variables). In reporting mode you can use a DEFINE DATA statement (known as “structured data mode”).
If this doesn’t help, please post a sample piece of code demonstrating what you have so far and what you are actually trying to do.
Part 2:
I have a list of programs (all in Reporting mode) where I have to call the above said subprogram and get the output back. How to achieve this.
Can we add the above PDA directly into a reporting mode program or
How to define the above PDA fields into the Reporting mode program (I’m interested to hear on how to define a Group variable, dynamic array in reporting mode program)
Now that, what I have been tried so far is,
Add the PDA into the report mode program as below
DEFINE DATA LOCAL
LOCAL USING
END-DEFINE
However getting an error saying that I have to include all the existing fields into the DEFINE DATA structure which I cant.
Tried adding group variable as in PDA but Natural throwing error saying I have to define the length of it which I dont know (as we have dynamic array into it).
Your PDA has a typo: #PARAM5 must be at level 3 (not 4)
As Douglas says, in Structured Data Mode programs “ALL variables must be defined with the DEFINE DATA statement”.
Perhaps you could write a “front end” Structured Mode program (or subprogram) whose sole purpose is to call the X-Array subprogram and repackage the result X-Arrays into “normal” arrays and pass those back to your Reporting Mode program(s).
.
Questions about the X-Array subprogram:
Q1. Do the arrays REALLY have to be X-Arrays?
Q2. Couldn’t you make do with Variable arrays (ie. using the 1:V notation)?
To avoid the manual effort of moving all local variables in all your reporting mode programs to the DEFINE DATA area, you can use AIVs. Copy the following lines to all your programs and the subprogram.