I am in the process of trying to develop a report for our customers that would prompt them for an item code, and then produce a report displaying all orders that have that item on it for a predetermined amount of time. I have the framework of the report done, and it works. The problem I�m running into is when I try to include (-Include) an additional file. This file, a customer definition file, is set up so that when a customer logs in, he or she can see only information for their particular account. We�ve used this file in other reports that don�t prompt the user for parameters. However, in the report I am working on now, the user is prompted for parameters that should be supplied by the customer definition file. How can I set it up so that the user is prompted only for the item code? Here is what I have been working on.
TABLE FILE SALES
PRINT QTYORD BY PRODNO BY PRODNAME BY SHIPDT BY CUSTNO
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
WHERE ADFLAG EQ 'A'
WHERE SHIPDT GE 20050101
-IF &CUSTPARM.EXIST GOTO IFTEST ELSE GOTO BYTEST;
WHERE ( CUSTNAME EQ
TABLE FILE HOLD1
PRODNAME AS 'Product'
QTYORD AS 'Quantity Ordered'
SHIPDT AS 'Ship Date'
BY CUSTNO NOPRINT
WHERE ( PRODNO EQ '&PRODNO.Product Code.'
I've done a lot with variables set in other fexes, but never with a period in the variable, so I'll stay with general comments:
1. What happens if you take the quotes off?
WHERE ( CUSTNAME EQ
2. Is there supposed to be a period at the end of
3. Can you print the value of the variable set in the other fex?
-TYPE Equals: &CUSTPARM.CUSTPARM
4. Finally, if you store the value of the variable set in the other fex to a new variable, can you print it to screen?
&NEWVAR = &CUSTPARM
-TYPE Equals: &NEWVAR
I wish I had something more specific to offer.
Any parameter that is being explicitly set will not be prompted for. So, I would recommend that you issue a:
before the -INCLUDE.
I am assuming that &CUSTPARM is being set in the -INCLUDE'd fex.
Let me know if this works for you!
Thank you both for your suggestions. I'm still somewhat of a novice, so could you tell me what the purpose of issuing the -SET &CUSTPARM is? The &CUSTPARM is set by the -INCLUDEd fex.
When WebFOCUS prompts you for a parameter list, it will only prompt you for parameters that haven't been explicitly set. This means that only parms that do not have a -SET will be prompted for. Unfortunately, your version of WF is not parsing the -INCLUDEd focexec. This means that it does not read the -SET in the include, and therefore thinks that it is an unresolved parm.
That might not be that clear!!! Maybe someone else can add to this?
I'm curious as to whether you are able to print the value of the variable set in the other fex when running the original fex:
-TYPE TYPING OUT THE VALUE OF PARAMETERS
-TYPE FIRST PARAMETER: &CUSTPARM.CUSTPARM
-TYPE SECOND PARAMETER: &CUSTPARM
Should give you this when you run your fex:
TYPING OUT THE VALUE OF PARAMETERS
FIRST PARAMETER: (ValueOfParameterAppearsHere)
SECOND PARAMETER: (ValueOfParameterAppearsHere)
If you do not get values, then you've proved that the -INCLUDE'd fex did not set the values, else you proved that it DID set the values.
If it DID set the values, look to the syntax of your code for the problem.
What version of WebFOCUS are you on?
Thanks again! I have some time set aside today to work on this, so I'll let you know how it goes. We are running version 5.2.3.
Rachel, how are things going?
Thanks for checking back with me! I am still having issues. I tried using the -SET &CUSTPAR command but that didn't seem to work. I haven't tried your suggestions yet, largely because I am not sure where in the code to put it. I tried to research it in the documentation I have, but I haven't really found any answers yet.
Well, I would put the code to type out the parameters I was looking for just after the -INCLUDE to the fex where you expect those parameters to be set.
I ended up going another direction with this report. Thanks again for your help!
...and thank you for letting all of us know that you resolved your problem successfully, even if it wasn't the way you'd planned on.
|Powered by Social Strata|