Technical Articles
DM PROMPT(COMBOBOX,…) behavior in BPC NW 10 and 7.5
PROMPT(COMBOBOX… is a useful statement in DM advanced script to provide user selection of some text values that can be later used in script logic. With the help of this statement it’s possible to limit user choice to only values hardcoded in this statement. One example can be restricted list of members to perform some calculations.
The syntax is:
PROMPT(COMBOBOX,%VARIABLE%,"Prompt text for user",(type of combobox),TEXT1,{TEXT1,TEXT2,TEXT3,TEXT4,TEXT5})
Where:
%VARIABLE% – to store the selection, can be passed to the script logic as $VARIABLE$ using:
INFO(%EQU%,=) INFO(%TAB%,;) TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,EQU,%EQU%) TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,TAB,%TAB%) TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,REPLACEPARAM,VARIABLE%EQU%%VARIABLE%)
Or you can concatenate this variable to %SELECTION% to be sure that only fixed list of members for some dimension are allowed to select:
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SELECTION,%SELECTION%DIMENSION:SOMEDIMENSION|%VARIABLE%|)
(type of combobox) – 0 or 1 – limit to list (different behavior in BPC 7.5 and 10 – see below)
TEXT1 – default selection (if empty – for BPC 10: first string in the list, for BPC 7.5: empty default selection)
{TEXT1,TEXT2,TEXT3,TEXT4,TEXT5} – list of values.
I have done some tests of the COMBOBOX parameters and found some differences between BPC 10 and 7.5:
For BPC 10:
1. PROMPT(COMBOBOX,%BU%,"Select BU to run earning calculations",0,,{A003,A004,A005,A006,A019})
Will provide a fixed list with empty line at the end of list and with A003 (first string in the list) as a default selection. You are forced to select some non-empty line (“Next” for empty value generates error). You are not able to enter list of values (not able to type in combobox field).
2. PROMPT(COMBOBOX,%BU%,"Select BU to run earning calculations",0,A004,{A003,A004,A005,A006,A019})
Will provide a fixed list without Empty line at the end of list and with A004 as a default selection. “Next” will be OK. You are not able to enter list of values (not able to type in combobox field).
3. PROMPT(COMBOBOX,%BU%,"Select BU to run earning calculations",1,,{A003,A004,A005,A006,A019})
Will provide a list with Empty line at the end of list and with A003 (first string in the list) as a default selection. You are forced to select some non-empty line (“Next” for empty value generates error) or you can type some value – from the list or not from the list. You are able to enter list of values (it’s allowed to type in combobox field).
4. PROMPT(COMBOBOX,%BU%,"Select BU to run earning calculations",1,A004,{A003,A004,A005,A006,A019})
Will provide a list without Empty line at the end of list and with A004 as a default selection. You are not able to clear default value and proceed (“Next” for empty value generates error) but you can type some value – from the list or not from the list. You are able to enter list of values (it’s allowed to type in combobox field).
For BPC 7.5:
1. PROMPT(COMBOBOX,%BU%,"Select BU to run earning calculations",0,,{A003,A004,A005,A006,A019})
Will provide a list without Empty line at the end of list and with empty default selection. You are not forced to select some non-empty line (“Next” for empty value will pass without error) or you can type some value – from the list or not from the list. You are able to enter list of values (it’s allowed to type in combobox field). Like option 3 for BPC 10.
2. PROMPT(COMBOBOX,%BU%,"Select BU to run earning calculations",0,A004,{A003,A004,A005,A006,A019})
Will provide a list without Empty line at the end of list and with A004 as a default selection. You are able to clear default value and proceed (“Next” for empty value will pass without error) or you can type some value – from the list or not from the list. You are able to enter list of values (it’s allowed to type in combobox field). Like option 4 for BPC 10.
3. PROMPT(COMBOBOX,%BU%,"Select BU to run earning calculations",1,,{A003,A004,A005,A006,A019})
Will provide a fixed list without Empty line at the end of list and with empty default selection. But you are forced to select some value from the list (“Next” for empty value generates error) and if you type value missing in the list you will also have error. You are able to enter list of values but only from combobox lines (it’s allowed to type in combobox field).
4. PROMPT(COMBOBOX,%BU%,"Select BU to run earning calculations",1,A004,{A003,A004,A005,A006,A019})
Will provide a fixed list without Empty line at the end of list and with A004 as a default selection. You are not able to clear default value and proceed (“Next” for empty value generates error) and if you type value missing in the list you will also have error. You are able to enter list of values but only from combobox lines (it’s allowed to type in combobox field).
See the difference and use the required combobox type.
B.R. Vadim
Hi Vadim,
Nice document as always helpful..
Just wanted to know whether it is possible or not, Suppose I have tow prompt for tow dimension i.e BU and BL, and there is one to many relation between BU to BL, If I select BU1 , in BL it should show members only related BU1.
Thanks,
Shrikant
Not possible!
Vadim
Thanks for the information.
You can do it using VBA... generating answer file on the fly...
Vadim
In my give case Can user will be able to select BL related to BU ?
Shrikant
Scenario:
1. VBA code will read both dimensions with required property.
2. First dimension members will be used to fill first VBA combobox.
3. After user select some member in the first combobox the second will be filled with related members of the second dimension.
4. User will select member from the second combobox (from the limited list).
5. Button is pressed - xml answer file is generated,... etc...
Vadim
Thanks Vadim for the hint.. I will try and update you on the same.
Shrikant
Hi Vadim,
Thanks for the post, it is very useful.
I am in BPC 10.0 and I notice that the comobox, per self doesn't work fine:
If I have just the comobox it doesn't work, I have to have a Select and at least one dim to be selected by user. At least it worked that way in my tests.
Any idea if I am doing something worng?
Regards
One option is not to use %SELECTION% at all - use replaceparam with some $$ variable.
Another option is to add special prefix.