Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Array in combination with a case statement

Status
Not open for further replies.

Pablito9

IS-IT--Management
Jan 1, 2006
22
NL
Is possible to use variables in a Dynamic Array in combination with a case statement?

The situation is as follows;
I'm using a temporary table in a sub report that has two columns, the amount of record varies but is never larger than 50. Also the values in both columns vary but in one column the values are always unique (Column.A).

Each time the report is generated all records need to be stored in shared variables.

So the amount of cases and variables (var_nn) should be the same as the total record count.

The formula I'm using now is a static one that looks like this, but when the values of Column.A change then variables are missing.

whileprintingrecords;
select {Column.A}

case "CF_CUSTGRP" : shared stringvar var_01 := {Column.B}
case "CF_CUSTID" : shared stringvar var_02 := {Column.B}
case "CF_EXCHRATE" : shared stringvar var_03 := {Column.B}


Hopefully somebody can help me.

Erik
 
Just wondering why you are not declaring the variables at the beginning of the function? I have never tried what you are doing, not sure what unusual side effects you might get.
 
I'm could declare the variables at the beginning but those would be static one's. The point is that the "cases" should be fill dynamically from the values that come from column.A that each time running the report could be different.
 
I do not understand the purpose of having dynamically declared variables.

Of course if there are not any values that that meet the case statement criteria, then the that variable would not be declared.

Where as if you statically declared them, then they would have a empty value ("") if there were no values that meet the case statement criteria.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top