Set Selection not working

kread

Active Member
I'm working on a new report that has 2 processing options but does not have data selection. I have a level break header section where I've set user selection in the initialize section.

My first line is to set the append flag to Yes. I have 3 lines after that. The first is to set one field from my business view to a specific value. The next 2 lines set business view fields based on the processing options. I've displayed the code below.

I've run it through debug and after it runs through the 3 lines, there's a delay before it gets to the Do Section. When it hits the Do Section, it's on the first record in the business view which does not match any of the criteria in the data selection.

I've used the same view in another report with no issue but could there be something in the business view that is overriding my data selection?


Set Selection Append Flag(<Yes>)
Set User Selection(BC Type of Hours (F31122)(TYR), <Equal To>, "4", <And>)
Set User Selection(BC Asset Item Number (F31122)(NUMB), <Equal To>, PO mnUserReservedNumber, <And>)
Set User Selection(BC User Reserved Reference (F31122)(URRF), <Equal To>, PO szUserReservedReference, <None>)

Thank you,
Kelly
 
First off: That <None> at the end should not be a <None>. I think you want <And> there.

Second: You're using 'Set User Selection' in a Level Break Hdr section?
confused.gif
confused.gif
confused.gif
 
Oh, and one more thing: Make a debug log. Those are very helpful in showing you what the actual Select statement was.
 
Kelly,

I agree with Remo's comments.

The set selection append and set user selection should be done in the init section event of the main data selection section (which has the business view assigned/attached). If you have no data selection for that section then the append flag should probably be no. If the append flag is no then the last parameter of the first set selection line should probably be <none>:

Set Selection Append Flag(<No>)
Set User Selection(BC Type of Hours (F31122)(TYR), <Equal To>, "4", <None>)
Set User Selection(BC Asset Item Number (F31122)(NUMB), <Equal To>, PO mnUserReservedNumber, <And>)
Set User Selection(BC User Reserved Reference (F31122)(URRF), <Equal To>, PO szUserReservedReference, <And>)

It would also be beneficial for you to look at the RDA manual, particularly chapters 2, 22, 23.
 
Thank you all for you comments. I have a number of years of JDE experience but as you can tell, I don't have a lot of developer experience.

Moving the set selection into the main section and cleaning it up as you suggested corrected the issue.

Thanks,
 
Back
Top