Variable based on

Hello everyone!
I'm just learning JSP right now so I hope I can explain my problem correctly. If i'm not making sense please let me know.
I have a table (FormFields) in my database that stores which fields should be displayed on my web form.
The table has a field called "FieldSource". This is in the format of: TableName.FieldName.
So now java gives me all the games in our system (with all fields related to the games). Then I want to go through all fields in each game and display only those fields that were specified in the database table.
Here's what I tried to do:
/////// go through each game
<c:forEach items="${games}" var="ITGame">
<tr>
//////// go through all the fields specific to this form
<c:forEach items="${formFields}" var="formField">
///////// here's my problem
<td>$${formField.fieldSource}</td>
</c:forEach>
</tr>
</c:forEach>
For example:
I have a field called "GameDate" for gameID 1.
In my FormField table I have a field specified (FieldSource=ITGame.GameDate).
Since "GameDate" is in the FormField table I want to display "GameDate" for each game from my list of games.
Can someone please point me in the right direction here?
Thank you for your time! Any help is greatly appreciated!
Best Regards,
Leena

You need to use the square brackets syntax.
In general, a.b gets evaluated as a["b"]
You can specify b="myProperty" evaluate a[b] = a["myProperty"]
In your case I think you want:
${ITGame[formField]}ie Object ITGame. Look up the property which is the value of formField.
Warning: if the game object does not have the property you are looking for it will throw an error.

Similar Messages

  • How to get the current month for a variable based on info object 0FISCPER3

    Hie Gurus
    I am working on the financial reports i am failing to derive the Current month from the variable based on infobject 0FISCPER3 PERIOD .
    I would also like to get the same month from the prevoius year. Any ideas?

    If I understood correctly, you need in your repot
    Current Month Plan This year || YTD Plan This Year || Current Month Plan Last Year || YTD Plan Last Year
    Your variable 0I_FISCPER3 must be on the object 0FISCPER3 which is nothing but just the Fiscal Period. This variable is a user entry mandatory Interval variable.
    if you are entering a range in the input screen for this variable, you will get cumulative values. If you just need to get the value for a month in first column your report, you will have to create another variable of type Customer Exit which will read the "To value" entered for the variable 0I_FISCPER3 and columns for Current Month should be restricted on this variable.
    if you are entering a single value in the selection screen of this variable, current month column should be restricted on this variable with "Equal To" operation and YTD colmns should be restricted to "Less Than Equal to" operator with this variable.
    0FISCPER3 just have posting period and not year, so you will have to use varialbes for 0FISCYEAR separately.
    Please let us know if it helps or if you are using some other variable based on 0FISCPER3 or 0FISCPER.
    Regards,
    Gaurav

  • Restriction of f4 help of a bex variable based on another variable input

    Hi,
    Could you please let me know if there is any possibility to restriction of f4 help of a bex variable based on another variable input.
    eg: when i select particular company code in one variable, i need to restrict the f4 help for another variables eg: pur. group based on selected company code.
    Regards
    Kasi

    Hi,
    Try using replacement path option in bex with replace variable with variable selction.
    Thanks.

  • How to determine the length of variable based on the character contents

    Hi Experts,
    I need to determine the length of variable based on the character contents I am looking for.
    Example;
        lv = 'FENCE - Construction bond'
    Where I need to know the exact field length of 'FENCE -'.
    It's possible that variable will have different values in different lengths.
    Thanks.
    Kath

    Kathy Amion  ,
    hello Will you please elaborate ...!
    The suggestion for your proble as i understood it is you will have to split the string at seperator '-' in two say variable name and conten. and then  you will calculate the length of the VARIable name by using string function.

  • Need a measure variable based on dimension

    Dear Experts,
    I  need a variable based on dimension.This should gives the values from 1 to n based on dimension.
    Suppose i have a column "Wage type".If it has 10 rows,Then for first one it should be 1 and second one it should be 2 and so on.I want to implement break for this dimension,even though the variable should give same values as i mentioned above.
    I try to use RowIndex and Count functions.But i couldnt get my requirement.
    I want to use this values in Xcelsius.
    I hope you can understand issue.
    Regards
    Venkat
    Edited by: Venkat8130 on Jun 23, 2011 7:24 AM

    Hi,
    I worked on the same issue, in my case result in following format
    year........count...month......revenue
    2001........ 1........ jan............100
    .................2.........feb............200
    .................3......... mar...........300
    .................4......... apr............400
    2002.........1...........jan..........500
    .................2..........feb...........600
    .................3..........mar..........700
    If you are expecting the same format, first break the report deportment wise. Create the variable count with bellow formula.
    =RunningCount([Month];Break)
    Regards,
    Shahin.
    Edited by: shahin13 on Jul 19, 2011 8:58 AM
    Edited by: shahin13 on Jul 19, 2011 9:04 AM

  • Correct way to construct variable based on other variable's name

    Hello!
    I have done this topic based on some modifications of this thread.
    The problem is that I can't understand how to manipulate with selection of the columns as variable when iterating over loop.  My goal is to define multiple variables for 'select' and choose correct one when the adequate topic is selected on loop. It seems
    that my problem is that I'm not correctly construct the variable for 'select' by using 'invoke-expression'.
    The source file is the following:
    topic=interface_bridge ruleaction=add name=vlan10
    topic=interface_bridge ruleaction=add name=vlan13
    topic=interface_ethernet set=1 comment=DMZ
    topic=interface_ethernet set=2 comment=Servers
    The script is the following:
    $file="c:\scripts\mk.txt"
    #selections
    $interface_ethernet='comment','name','set','switch','master-port'
    $interface_bridge='comment','name','protocol-mode'
    #topics
    $topic_int_bridge='interface_bridge'
    $topic_int_ethernet='interface_ethernet'
    $topics=@($topic_Int_bridge, $topic_int_ethernet)
    foreach ($topic in $topics)
    $match='^topic='+$topic+'\s+'
    $result_File = 'config_'+$topic+'.txt'
    #construct selection
    $select = '$'+$topic
    $interface_ethernet='comment','name','set','switch','master-port'
    $interface_bridge='comment','name','protocol-mode'
    ##automatically select correct topic on loop - This does not work correctly on loop
    ##the main idea is to constuct select variable based on topic name
    $select_topic=invoke-expression ('$'+$topic)
    $results = Get-Content mk.txt | Where-Object { $_ -Match $match }| foreach { new-object PSObject -Property $($_ -replace '^' -replace ' ',"`n" | convertfrom-stringdata) }
    $results | select $select_topic
    I'm hang on the following: when I run the script it only takes first selection ($interface_bridge) gives the result about first topic (bridge), and for second (ethernet) - only comments (this means that the second selection for interface_ethernet (variable
    $interface_ethernet) is not used.
    comment name protocol-mode
    vlan10
    vlan13
    DMZ
    Servers
    Expected result should be the following:
    comment name protocol-mode
    vlan10
    vlan13
    comment set name switch master-port
    DMZ 1
    Servers 2
    Question:
    How to modify the script that the result is printed for each topic with adequate selection:
    1) when looping over topics, when the topic interface_ethernet is processed select and print results for variable $interface_ethernet
    (selected items 'comment','name','set','switch','master-port')
    2) when looping over topics, when the topic interface_bridge is processed select and print results for variable $interface_bridge
    (selected items 'comment','name','protocol-mode')
    3) etc...
    Each topic should be on separated iteration block because for each will be generated csv file with each own header. 
    Thanks.

     I just shorted my question. I hope that it can be better understandable. The source file is the following:
    topic=interface_bridge ruleaction=add name=vlan10
    topic=interface_bridge ruleaction=add name=vlan13
    topic=interface_ethernet set=1 comment=DMZ
    topic=interface_ethernet set=2 comment=Servers
    Expected result should be the following on pipeline or on separate csv files:
    comment name protocol-mode
    vlan10
    vlan13
    comment set name switch master-port
    DMZ 1
    Servers 2
    Expected behavior:
    1) Select variables for each of the topic should be in the following form
    $interface_ethernet='comment','name','set','switch','master-port'
    $interface_bridge='comment','name','protocol-mode'
    2) when looping over topics (the topics can be more than 50), when the topic interface_ethernet
    is processed select and print results for variable $interface_ethernet
    (selected items 'comment','name','set','switch','master-port')
    3) when looping over topics
    (the topics can be more than 50),
    when the topic interface_bridge is processed select and print results for variable $interface_bridge
    (selected items 'comment','name','protocol-mode')
    As the topics can be more than 50 it wouldn't be a good idea to write separate condition
    for each topic.

  • Is the CURRENT_YEAR variable based on our systems Financial Year?

    Hi,
    I have a report that uses the CURRENT_YEAR variable to filter data. The value of that variable is currently 2010, but our financial year starts on 1 October, so we are still in the 2009 finacial year?
    My question is: Is the CURRENT_YEAR variable based on the Financial Year start date configured in our CRM instance? or is it a "global" variable which is the same for everyone regardless of their financial year start date.
    Thanks.

    In my customer, CURRENT_YEAR and CURRENT_MONTH returns the fiscal year and month...
    Antonio

  • Need help with configuring setup cost as variable based on quantity

    Hello,
    I am brand new to PP and my client has inquiry as to how they can make the setup costs variable based on the production quantity. They already have the machine and labor working correctly, so I compared the formulas for machine and labor time with that of the formula for setup time and they are not the same (in fact, setup time does not have any formula). Do I simply need to create a formula for this or are there multiple other steps? If anyone can give instruction on how to set this up it would be of great help.
    Thanks,
    MH

    Check in the Work Center, tab Costing where Setup Time should have a formula using operation quantity / base quantity as ratio.
    Setup time should be included as parameter in the standard value key.
    The formula in the Capacity Tab would have only effect on the capacity evaluation, but no costs impact.
    Edited by: Dario on Feb 2, 2011 7:04 PM

  • 30 day rolling average of a single variable based on 1 hour averages?

    Can anyone recommend the best way to keep a 30 day rolling average of a single variable based on 1 hour averages?  I am thinking about using Citadel with and SQL query to update the average.  If there's a better way, I would appreaciate any ideas.

    I think you are on the right path, use the existing Citadel information with ODBC & SQL to get the data.  
    Saves archiving "duplicate" data.
    Forshock - Consult.Develop.Solve.

  • To use two presentation variables based on the period selection in OBIEE

    Dear All,
    I have period prompt in my report, based on the period prompt selection in my report I need to get the start and end dates of the period and apply in the report filter.
    For e.g. Period Name selected in the prompt is "2010 - Q1" (For this Period, Period Start Date = 01/01/2010 and Period End Date is 30/03/2010, which is not going to be displayed in the prompts).
    How can I get the start and end dates of the period into my report filter. I tried using the presentation variable for the period name, but unable to resolve the requirement.
    Your help is highly appreciated.
    Best Regards,
    Rajesh

    Hi Rajesh,
    Create a report A which will give you the period start date and end date and filter it using the period prompt.
    Then filter the main report using the report A start date and end date, using Filter -> Advanced ->Filter based on results of another request .
    Add the report A in separate section on the dashboard along with main report and hide report A section.
    Thanks,
    Vino

  • Looking to set the result of a variable based on the content of another (new to scripts)

    Hi,
    I'm new to scripts, new to acrobat forms to be honest, so be gentle with me
    I have a text field Acc1pnt which can accept either Y or N as an entry. Based on the answer, text field Acc1snd would always be N/A if the result of Acc1pnt is N. I'm looking for a script that will add N/A to the second text field and skip over it (make read only?) if the answer to the first field is N.
    Sorry if I'm making this look like hard work. Basically a check is made as to whether an accessory is received and, if it is, whether it is 'sound' or 'damaged'. Obviously if it isn't received then it's condition is irrelevant hence N/A in the senond text field.
    Also, is there something simple I can add to convert an entry to a capital letter?
    Thanks in advance
    Cliff

    Hi Gilad
    I've shied away from radio buttons as the users are used to tabbing through the fields and 'clicking' a radio button would mean taking their hands from the keyboard, I will certainly consider it though.
    Acc1snd (the 2nd variable) should be editable ONLY if the answer to Acc1pnt (the 1st variable) is Y. If the value of the 1st variable is N then Acc1snd can only be N/A (not applicable) and should not be editable.
    Obviously if the user makes an initial mistake and needs to change the value of the 1st variable to Y then the 2nd variable would then need to be editable.
    I will run through the tutorials this evening

  • Variable based on another varable does not change at runtime

    Hi.
    I have Foreach Loop container with a EXEC SQL task inside.
    The Foreach Loop loops through a directory containing flat files and and maps the filename to a "FileName" variable.
    The filenames have a datestamp in the filename that I want to extract.
    Because of that I have also another variable called "FileDate" which basically is an expression with substrings based on the FileName variable. The expression works fine when evaluating.
    The EXEC SQL task inside the Foreach Loop does an insert to a log table (two columns - FileName and FileDate) based on the two variables mentioned above. The trouble is, however, that only FileName is populated correctly in the table.
    For example: I have 5 files with different datestamps. In the log table the FileName column is populated correctly (5 different values), but the FileDate column has the same value for all 5 rows.
    Any ideas why ?
    dakine

    Hi Dakine,
    Your expression works well in my test package. It’s really odd that it doesn’t work in your package. You could add a Script Task into the Foreach Loop Container to show the value of the FileDate variable in a MessageBox, and check whether its value is correct
    for each loop of the container. The script is simple (select User::FileDate as ReadOnlyVariables for the Script Task):
    MessageBox.Show(Dts.Variables["User::FileDate"].Value.ToString());
    By the way, you can also try to recreate the package from scratch.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Function Module to pull in variables based on a source variable

    Hi,
    I am new to user exits and function modules and don't know any ABAP, but I need to make use of a user exit to pull in 4 cost center values (0COSTCENTER) based on a single profit center (0PROFIT_CTR) value.  For example, in the planning layout users will select a profit center from the variable screen.  Based on that profit center selection, I want to populate 4 cost centers values that correspond to the following:
    - a "Pproduction" cost center value
    - a "Level 2 R&D" cost center value
    - a "Level 2 Selling" cost center value
    - a "Level 2 Admin" cost center value
    I know I need to create a mapper table that shows what production and level 2 cost centers are to be associated with what profit centers, but I'm not sure how, or where to do that (obviously I have the mapper data already, I just don't know how to set it up in a table that can be read by a function module).  And then I think I need to make use of a user exit (function module) to look up the values in that table so the correct cost center values are pulled in based on the profit center selection. 
    Can anyone offer any advice, and/or provide sample code where I could easily replace the values that are relevant to my situation.  Again, I don't know any ABAP, but clearly I need to learn, so I'm not sure if this is even feasible for me to do. 
    Any advice is appreciated.
    //HC

    Hi,
    You need to create BPS variable of type exit. You can learn it easily. See the following document and you can also search this forum for relevant threads.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/650ee690-0201-0010-4bb7-83c3e2a74039

  • Dynamic Variable based on Hierarchy causes additional prompts

    Hi all,
    I am getting some additional prompts in Crystal Report in following scenario and need some help to avoid them
    The query in BI has active cost center hierarchy and cost element hierarchy. It has two variables, Fiscal Year/period (X) and Budget Version (Y).
    In the report I have created a Dynamic parameter (Z) based on Cost Center Hierarchy. So when previewing the report, in designer as well in Info View, I get prompted for three variables (X, Y & Z).
    The issue is, before list of values are presented for selection for variable Z, it prompts me again for variables X and Y. Also, at this time around, prompts for variables X & Y does not show their list of values.
    The report has been created with SAP MDX driver, has been published to Business Objects Enterprise via saving report to SAP BW. SAP authentication is used to preivew/view the report from CR designer as well as in BOE.
    Can some please point out what I am missing and help me to get rid of prompts for variables X & Y second time.
    Thank you,
    IMS

    Hi Ingo,
    After much testing and looking into trace etc. we have got this thing to behave as desired. Basically, following two things,
    - no reference to CR Dynamic Hierarchy variable on report. There were places where this parameter was being refered and causing grief. We tested with brand new report.
    - making sure that on query Cost center restriction is placed in Characteristic Restriction area of Filter tab of query, as oppose to default value area filter tab.
    With above in place, the published report in infoview behave as desired, i.e. proper hierarchy structure in cost center prompt and group tree and only desired nodes showing on report.
    Thank you for all you pointers
    Regards
    IMS

  • BPS User Exit Variable based on Planning Package Selection

    Hi,
    I'm implementing a SAP BW-BPS planning layout to be integrated into the CRM we user interface.
    Most of the characteristic selections come from the CRM fields that need to be filled by the user when creates a trade promotion.
    The charcteristic selections work (as standard) just if in the planning level I flag "Selection in Package", then in package these selections are dinamically defined from what the user select in the CRM fields at runtime.
    My problem is that I have to build a BPS User Exit variable to filter, in the planning level, the proper Planning Area based on the CRM Sales Organization value.
    The characteristic CRM Sales Organization belongs to whose chararcteristic the value is determined dinamically in the planning package.
    Is it possible for a BPS user exit variable, set in the planning level, to catch the value of a characteristic selection made at planning package?
    Many thanks for your help.
    Alessandro

    Hi Indu,
    Many thanks for your answer.
    I have already took a look at the document posted by you but I didn't find the solution to my problem.
    This because i have to create a user exit variable that need to get the value of the characteristic selection in package.
    I mean in the planning level I will have the user exit variable that restrict the planning area and, his function module, need to read, at runtime, what is the value of the characteristic CRM Sales Organization restricted in package by CRM.
    So I don't have any idea to which BPS internal table I have referred to in my funcion module to catch the value of the CRM Sales Organization dinamically filtered by CRM.
    Many thanks,
    Alessandro

  • Regards standard available text variables based on exceptions.

    Dear BI Experts,
    Please look into following link:
    [Standard Available Text Variables|http://help.sap.com/saphelp_nw70/helpdata/en/43/8464d082206353e10000000a11466f/content.htm]
    I need to use text variables in last box of above link (which are based on exceptions) -->
    XML_ER_NUMBER_TOTAL: Specifies the total number of exceptions that occurred.
    XML_ER_NUMBER_BAD: Specifies the number of bad exceptions.
    XML_ER_NUMBER_CRITICAL: Specifies the number of critical exceptions.
    XML_ER_NUMBER_GOOD: Specifies the number of good exceptions.
    But I can not see them in sytem (BI7 21pkg), all others are available...
    is there a way to activate them....
    I need them in SAP BI Information Broadcasting (in Subject line & Body of email)....
    Edited by: Arun Purohit on Oct 5, 2010 4:24 PM
    Edited by: Arun Purohit on Oct 5, 2010 4:24 PM
    Edited by: Arun Purohit on Oct 5, 2010 7:03 PM

    Hi,
    Text variables do not work when the variable the column on which the variable is running does not have a unique value under it.
    Is the text variable getting the appropriate value if the query is run as a table? If yes, then you will probably be better off opening a OSS message with SAP.
    Cheers
    Aneesh

Maybe you are looking for