• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

UBE - User set data selection on conditional section

BOster

Legendary Poster
I have a UBE where the first section attached to a BSVW is conditional. Before this conditional section I have a section not attached to any BSVW that looks at the RI values and either runs the conditional section or skips it. The conditional section with the BSVW has code that sets the data selection append flag to YES and then appends and additional WHERE clause element to what ever the user has defined. I am finding that if that section is conditional it is ignoring what the user sets and only creates a WHERE clause with pro grammatically set data selection instead of appending.

Summarize:
Code:
Section A. Driver Section - No BSVW
Section B. PreCommit Section - Conditional - Attached to BSVW
   setappendflag(yes)
   setuserselection
If section B is conditional it ignores any user set data selection. If section B is NOT conditional it works correctly.

Is this correct/documented behavior?
 

nkuebelbeck

VIP Member
Sounds correct to me.

The user is selecting data on the driver bsvw. The user has no idea about conditional sections. So the selection on B would be "Select * from BSVW". I don't believe there is any inheritance of user selection to conditional sections
 
Last edited:

Abhishek Chhajer

Well Known Member
I am not sure about this behavior. I have done this many times and it works fine.
1) The driver section here is a section without bsvw.
2) Conditional section is mapped to business view.
2) The conditional section bsvw will be available to user for run time data selection. (I used view on F0101)
3) You can append whatever parameters you want in conditional section.

Question: Is the run time bsvw different from the set selection bsvw?
 

BOster

Legendary Poster
No, the data selection correctly shows for the conditional section (B in my example). The driver doesn't have a business view attached to it. When you go to set data selection, the dialog is definitely showing tables/fields for the conditional section. If I un-check the conditional property and make no other changes it works just fine - user selections are applied along with any code appended where clauses.

To get past this I had to un-check the conditional property on section B and then in the driver section (A in my example) set a flag to effectively stop section processing when B executes. It works but is not as clean as a conditional section would have been.
 

johndanter

Legendary Poster
When the user prompts for data selection, I am guessing the BSVW fields they select from are the section B fields, yes?

As E1 always looks down the list of sections for the first BSVW linked section. However I didn't realise it would still do that if it were a conditional section. So I agree with what it's doing when conditional.
I'm just amazed we can still select from it at run time if it is conditional.

You could give the first section a BSVW but then end processing straight away, call your next section and then inherit the selection in the the called section....?
 

David Robertson

Reputable Poster
The first non-conditional section is the driver section.
If you changed the conditional flag on a section that was previously the first non-conditional section (or did anything which changes the driver section), you would need to delete and re-create all of your versions for them to work correctly.
Any data selection being displayed at prompting time would be ignored/not used at run time.
If your driver section has no BSVW, then you should not be able to prompt for selection. The fact that it prompts at all shows that it did have a BSVW on the driving section when the version was created. Such versions must be deleted as they are unreliable and probably give random results.

If you want to have data selections on the conditional section, you need to do that programmatically somehow, such as using processing options.
 
Last edited:

Abhishek Chhajer

Well Known Member
Hi Boster,

I am attaching this code for reference. I have conditional section with BSVW and driver section without any view. Save and change extension to par.

1) Dummy Driver - no BSVW
2) Conditional Section with view on F0101

Conditional section is having set selection for internal DS. AN8>10000
During execution, I will do selection on only Search Type (AT1) = E


I can do run time selection on view along with set selection in condition. they work fine for me.
 

Attachments

BOster

Legendary Poster
When the user prompts for data selection, I am guessing the BSVW fields they select from are the section B fields, yes?
Correct.

You could give the first section a BSVW but then end processing straight away, call your next section and then inherit the selection in the the called section....?
I was kind of hoping for something a little cleaner. I have a work around, just seems like it should work the way I originally had it. I.e. user set data selection is applied to the first section with a business view. To me it should do that even if the section is conditional... and maybe it DOES do that and I had something else wrong. Was hoping someone could confirm what I think I am seeing.
 
Last edited:

Abhishek Chhajer

Well Known Member
I am not sure I fully understand your question. But the set selection system function is compatible with the business view.
I was asking about a scenario where we have business view A and B on two conditional sections respectively. We have one driver section with no BSVW as usual. You will see business view A or B in run time selection based on which comes first in layout.
So, my question was on set selection in business view which is not visible at run time.
 

BOster

Legendary Poster
The first non-conditional section is the driver section.
If you changed the conditional flag on a section that was previously the first non-conditional section (or did anything which changes the driver section), you would need to delete and re-create all of your versions for them to work correctly.
Any data selection being displayed at prompting time would be ignored/not used at run time.
If your driver section has no BSVW, then you should not be able to prompt for selection. The fact that it prompts at all shows that it did have a BSVW on the driving section when the version was created. Such versions must be deleted as they are unreliable and probably give random results.

I actually thought about this and created a new version to see if it was some hold over from an old version. The new version still showed data selection for section B in my example. Which is what I would expect... it just doesn't apply the user set data selection.

The driver section was actually just added and never had a BSVW attached.
 

BOster

Legendary Poster
Hi Boster,

I am attaching this code for reference. I have conditional section with BSVW and driver section without any view. Save and change extension to par.

1) Dummy Driver - no BSVW
2) Conditional Section with view on F0101

Conditional section is having set selection for internal DS. AN8>10000
During execution, I will do selection on only Search Type (AT1) = E


I can do run time selection on view along with set selection in condition. they work fine for me.
Thanks for the example. I don't currently have a stand alone install so I can't import at this time (I usually don't bring PARs into our work install). However, based on your comments it looks like you are programmatically setting data selection. I can do that just fine. My problem is that it doesn't apply any user set data selection.
 

Abhishek Chhajer

Well Known Member
It does. Check my example.
The user data selection i have used is AT1 = E.
You try it with external or run time data selection and it works fine.
 
Last edited:

bsush

Active Member
It does. Check my example.
The user data selection i have used is AT1 = E.
You try it with external or run time data selection and it works fine.
Hi List

Just out of curiosity I restored the .par file provided here on DEMO9.0 and found that it does work as desired i.e.

1. The user will be able to choose the run time data selection from the BSVW fields for Section B. In the .par file example this is AT1 (Search Type) = E.

2. It will also pick up the user defined selection set using the SetUserSelection system function in Section B. In the .par file example this is F0101.AN8 > 10000

Thanks
 

BOster

Legendary Poster
It could very well be that I have some other problem some place, but the UBE is pretty simple so not a whole lot to look through. I am also wondering if it is a TR issue. I can't believe I have not run into this same scenario before. We just recently moved to TR9.1.5.1.
 

nkuebelbeck

VIP Member
Again, I don't believe that inheritance makes logic sense. What if it's a different BSVW all together? The bsvw columns would map 1 to 1. What would the conditional section data selection be? Would be interesting to know, to your OP, what is the designed functionality. Oracle you reading this?
 

Kim Schmidt

Active Member
It's also possible to design processing options as a substitute for prompted data selection. You then would use each conditional section's Initialize Section event to parse the relevant processing options for each conditional section, and move the values into Set User Selection function calls.
 

Kim Schmidt

Active Member
Why not have a processing options template with appropriate items instead of prompting the user for data selection? You could then have code in each conditional section's Initialize Section event to parse out the values relevant for that section, and use those values in Set User Selection function calls. I've done this many times...

Regards,
 

BOster

Legendary Poster
This is a good technique. We have used this technique as well in other places. In this case it really doesn't work as well as the default data selection dialog.

I quit trying to figure out why a conditional section ignores user set data selection. My workaround was simply to make the section unconditional (not conditional) and then instead of the calling the system function to run the conditional section, I just stop section processing if the condition is not met in the init section event. It works but is not as clean as having a conditional section.
 
Top