895 pts.
 Subfile
I want to toggle between two columns in a subfile...I'm using following code to condition the fields...however when i display subfile none of the fields are displayed...is there anything else i need to take care of

A            #PROCP         8A  O  6 22                    A  15                                  DSPATR(ND)          A            #ORDERP        8A  O  6 22                    A N15                                  DSPATR(ND)         

----------

C   If  cond = true

C  Eval *in15 = *on

C endif



Software/Hardware used:
AS400
ASKED: October 27, 2009  7:18 PM
UPDATED: October 28, 2009  4:56 PM

Answer Wiki:
Do you update and redisplay the subfile after you set *in15 to on?
Last Wiki Answer Submitted:  October 27, 2009  7:43 pm  by  Teandy   5,830 pts.
All Answer Wiki Contributors:  Teandy   5,830 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Sometimes it is easier to have two subfiles in the program and you build them at the same time. Everything being the same except that #PROCP is in subfile1 and #ORDERP is in subfile2. Then *IN15 just conditions which EXFMT to use.

 32,915 pts.

 

yes, I do update the subfile after switching the indicator on

 895 pts.

 

i actually have only one column different in both sfls ….defining new subfile may need a new set of variables and then bunch of move’s
do you think this is the only way?

 895 pts.

 

Regardless of whether *IN15 is on or off, ND will be in effect at the field position your data is displayed.

Tom

 108,300 pts.

 

how can i toggle between 2 columns then in SFL?

 895 pts.

 

AFAIK, you actually want to toggle between two subfiles — the toggle will make one or the other subfile active.

(And when I say you “want” to, I mean that that’s the facility you need to look at. I’m pretty sure it’s not what any of us would want to do in this circumstance!)

I’m pretty sure that’s what CharlieBrowne was getting at back in his first comment.

Tom

 108,300 pts.

 

Exactly — you make two subfiles identical except one has one field showing and the other as hidden and the other has the mirror image

When you write records to the subfile you write to both
You exfmt on the control for the first subfile, if use hits the function key for the change exfmt on second.
Phil

 44,190 pts.

 

You would have to read in every record in the subfile and update it with the new *IN15 value to have one subfile with the conditioned display.

 7,185 pts.

 

Let’s not use two subfile.

I do this sort of toggling all the time. In the case where you have two possible columns occupying the same space and with the same length, it’s quite easy.

Store both values in hidden fields in the subfile line. When the toggle is set one way, and the subfile is first filled, both these fields are filled, AND the displayable field is filled with the right value – first tim in, let’s say #PROCP values.

When the user presses the toggle function key, either you can just refresh the subfile and load the displayable field with #ORDERP data, or you can read through the subfile and copy the #ORDERP data from its hidden field into the displayable field.

Storing both pieces of data in hidden fields means that when you read a specific subfile record, you have that data available to you in your program.

Don’t forget to change the heading in the subfile control format (or header format) to show the user which data is being displayed.

Using this technique, you can do all sorts of things with a subfile, like having the sort of window left/right function you can see in the spool file display screen. Because you store ALL the data you want to display conditionally in hidden fields in the subfile record, you don’t have to reload the subfile when the toggle is pressed.

Regards,

Sloopy

 2,195 pts.

 

ok I used two mirror image subfiles which seems to be simple solution..

thanks,
Nutan.

 895 pts.