What is advisable for complex calculation fields in ADF?

Hi,
I am using JDev 11.1.1.2.0 with ADF 11g.
I have a screen where user is going to select couple of LOVs. Based on this selection one of my "read only field" should get refreshed.
This field should actually do calculation based on the 2 fields and another column of a table.
So for such cases is it advisable to build a function and call this from a binding method OR there is a better way of displaying a calulated field.
NOTE:
1. using the expression on a transient field is good if the calculated fields are available in the row. Here I have to fetch a value from a completely different table's column that is not present in the row. Again the value that will be fetched will depend on some other parameter which is available to me in the session
2. I am looking out to make this generic since these combination of fields are repeated in few of the screens and for same calculations
Kindly advice the ways in which this can be handled. And pls point the best from your view point.
Thanks in advance.

Any quick suggestion?

Similar Messages

  • What is good for performance calculation in select st. or in formual column

    Dear Friends,
    I would like to ask you regarding what is good for performance specially i'm developing reports for EBS .
    is it better to calcualte total of 5 columns in select statment directly or using formula columns to do this,
    Regards & Thanks
    Yas

    I'd focus on easily readable query, namely use formula column if otherwise the query get too long or too complicated to read/maintain. Have inherited many ugly long queries/reports and hate to maintain or fix bugs for them etc.

  • Calculated Field In ADF Form

    I want to create calculated field.
    I have 2 date fields, my user case is to calculate difference between those 2 date field and display difference on the fly to user.

    You will need to write custom logic in a method of a managed Bean in your View Controller project.
    follow these steps -
    1)In the ViewController project ,create a java Class called <whatever_name_you want>.java
    2) register the managedBean in TaskFlow->Overview-> Managed Bean say in pageFlowScope.
    3)create a public method which returns a Number (of days or whatever you need) in your bean which calculates difference between the dates using Calender API (You can google for this)
    4)Bind this method to the value property of the field which shows the difference between these fields.

  • How to select specific rows in rtf template for complex calculation

    Hi,
    I want custom calculation in my rtf template and for this i need to select specific cell's value OR specific row's value. Any one please suggest how can I get this. Below is the example i have plotted using excel. My target is to get field 8 and 9 using sum and minus. We can calculate column over column, is there any way to calculate row over row? If I use variables, then i have to create so many variables because I have more columns and rows to calculate (here i posted one sample table). Any one please help me how can I get expected result other than using variables! If "Using variables" is the only way then also give your valuable opinions.
    Row No
    Curr Qtr
    PQtr1
    PQtr2
    3
    B3
    C3
    D3
    4
    B4
    C4
    D4
    5
    B5
    C5
    D5
    6
    B6
    C6
    D6
    7
    B7
    C7
    D7
    8
    B8=SUM(B4:B7)
    C8=SUM(C4:C7)
    D8=SUM(D4:D7)
    9
    B9=B8-B5
    C9=C8-C5
    D9=D8-D5
    Thanks.

    Hi AlexAnd,
    Thanks for the reply, I got 0 using both codes. This is a dummy table and I plotted 3,4 to give an idea of row number (as like as excel). Rows are individual data sets combining different measures and dimensions with different values.
    Account
    Curr_Qtr
    PQtr1
    PQtr2
    Deposit
    10
    15
    20
    Loan
    15
    20
    25
    Earning
    20
    25
    30
    Assets
    25
    30
    35
    Total
    =SUM(15,20)
    =SUM(20,25)
    =SUM(25,30)
    Expense
    =SUM(15,20)-25
    =SUM(20,25-30
    =SUM(15,20)-25
    Is there any way to identify the range or individual cell's value? Using variables I have to create lots of variables for each cells, I want to avoid that and want to use rows in calculation! Is that possible, Pls share your valuable opinions!
    Thanks.

  • SORTING FOR THE CALCULATION FIELD IN CROSS TAB REPORT

    LIST_G_AUCTION_TITLE>
    <G_AUCTION_TITLE>
    <BID_NUMBER>5002</BID_NUMBER>
    <AUCTION_TITLE>E2E-01 Construction RFQ</AUCTION_TITLE>
    <ITEM_NUMBER>C2631</ITEM_NUMBER>
    <ITEM_DESCRIPTION>4G000,000,0STRUC,X,SPECIAL STRUCTURE</ITEM_DESCRIPTION>
    <ESTIMATED_QTY>1</ESTIMATED_QTY>
    <UNIT>LS</UNIT>
    <QUOTE_PRICE>400</QUOTE_PRICE>
    <ESTIMATED_QUOTE_PRICE>400</ESTIMATED_QUOTE_PRICE>
    <SUPPLIER>X - L CONTRACTING</SUPPLIER>
    my xml data is in this format, i created a cross tab report for ITEM_DESCRIPTION as row and SUPPLIER as column and calculated a sum(ESTIMATED_QUOTE_PRICE)
    for all the ITEM_DESCRIPTION for every SUPPLIER in templete . now i need to sort the data by sum(ESTIMATED_QUOTE_PRICE) from lowest to higest from left to right , that is supplier with lowest sum(ESTIMATED_QUOTE_PRICE) should display first from left to right.
    can any one help thanks in advance.

    thank you tim , for asking i got the solution. it is actually in template builder i was asking about. xml template builder

  • What is reason  for authrorization group field not showing in FD01 tocde

    Hi,
      The authrization group is showing  under Control data  when i am creating the customer manually by using the tcode FD01.but when i am creating the customer through BDC program  by using same tcode its giving the error message
    error message is aurization group( Field KNA1-BEGRU. does not exist in the screen SAPMF02D 0120  ).
    can any body  help on the above issue if knows.

    perhaps check field-sttuas of your account group
    tcodes: ob23 and obd3
    Message was edited by:
            Andreas Mann

  • To read a calculated field of an MDM record

    Hi All,
    We have a main table in MDM repository with a calculated field and other fields.
    On entering the values of other fields in the table an ID gets generated for the calculated field of that main table.
    Now we want to retrieve that calculated field Id.Can anyone provide pointers for the same?
    Regards,
    Richa

    Hi Richa,
    To retreive calculated field you can use RefreshCalculatedFieldsCommand
                      ResultDefinition resDef = new ResultDefinition(schema.getTableId("TableId"));
                      resDef.addSelectField((FieldId)fieldId.get("fieldId"));
                        RetrieveRecordsByIdCommand varCmd = new RetrieveRecordsByIdCommand(wdContext.currentContextElement().getVa_ConnectionStr());
                        varCmd.addId(VarRecord.getId());
                        varCmd.setSession(wdContext.currentContextElement().getVa_SessionId());
                        varCmd.setResultDefinition(resDef);
                        varCmd.execute();
                        RecordResultSet recResSet = varCmd.getRecords();
                        Record resRecord = recResSet.getRecord(0);
                        wdControllerAPI.getMessageManager().reportWarning("functionsave:SaveVarietyData( )*********07"+resRecord.toString());          
                        MdmValue varCreated = resRecord.getFieldValue((FieldId)fieldId.get("Variety_Material_Number_Inter"));
                        String varCreatedVal = varCreated.toString();
                      Integer varNumCreated = new Integer(varCreatedVal);
                      int varietyValue = varNumCreated.intValue();
                      wdContext.currentContextElement().setVa_GeneratedVarietyId(varietyValue);

  • Trouble when attempting to Sum Calculated Field.

    I had to create a calculated field called RI_Limit which contains static data.  (Developers/DBA could not enter it into the database at this time, so this was a work around. 
    The calculated field is setup as such:
    =iif(Fields!Location_LOCATION_NAME.Value = "a", 8, iif(Fields!Location_LOCATION_NAME.Value = "b",2, iif(Fields!Location_LOCATION_NAME.Value = "c",0, iif(Fields!Location_LOCATION_NAME.Value = "d",0, iif(Fields!Location_LOCATION_NAME.Value = "e",1, iif(Fields!Location_LOCATION_NAME.Value = "f",1, iif(Fields!Location_LOCATION_NAME.Value = "g ",0, iif(Fields!Location_LOCATION_NAME.Value = "h",0,iif(Fields!Location_LOCATION_NAME.Value = "i",4,iif(Fields!Location_LOCATION_NAME.Value = "j A",0,iif(Fields!Location_LOCATION_NAME.Value = "k",0,iif(Fields!Location_LOCATION_NAME.Value = "l",7,iif(Fields!Location_LOCATION_NAME.Value = "m",0,iif(Fields!Location_LOCATION_NAME.Value = "n", 1, iif(Fields!Location_LOCATION_NAME.Value = "o",0, iif(Fields!Location_LOCATION_NAME.Value = "p",1, iif(Fields!Location_LOCATION_NAME.Value = "q",3, iif(Fields!Location_LOCATION_NAME.Value = "r",1, iif(Fields!Location_LOCATION_NAME.Value = "s",1, iif(Fields!Location_LOCATION_NAME.Value = "t",3, iif(Fields!Location_LOCATION_NAME.Value = "u",5,iif(Fields!Location_LOCATION_NAME.Value = "v",0,iif(Fields!Location_LOCATION_NAME.Value = "w",0,"NA")))))))))))))))))))))))
    and I setup a textbox with that expression and the numbers fill in correctly with its cooresponding site name.
    However, when I go to sub total or total, I get a much larger number than expected. (See screenshot)
    I have searched the internet on a way to calculate both the total by Location Level 2 and LOB total, but nothing that pertains to the specific issue where by calculated field contains static data.  Nothing I try produces an accurate sum.  Any suggestions?

    Hi Katherine,
    Sorry for taking a few days to reply.
    I tried the suggestion, but it it still not summing my calculated fields.  The total row will calculate my other cells okay but not the calculated fields that I had to add to the report.  When I attempted to write an expression to sum the calculated
    fields I get the following error message. 
    The expression used for the calculated field '=sum(iif(Fields!Location_LOCATION_NAME.Value = "test", 8, iif(Fields!Location_LOCATION_NAME.Value = "test1",2, iif(Fields!Location_LOCATION_NAME.Value = "test2",0, iif(Fields!Location_LOCATION_NAME.Value = "test3",0, iif(Fields!Location_LOCATION_NAME.Value = "test4",1, iif(Fields!Location_LOCATION_NAME.Value = "test5",1, iif(Fields!Location_LOCATION_NAME.Value = "test6 ",0, Fields!Location_LOCATION_NAME.Value = "test7",0,Fields!Location_LOCATION_NAME.Value = "test8",4,Fields!Location_LOCATION_NAME.Value = "test9",0,Fields!Location_LOCATION_NAME.Value = "test10",0,Fields!Location_LOCATION_NAME.Value = "test11",7,Fields!Location_LOCATION_NAME.Value = "test12",0,Fields!))' includes an aggregate, RowNumber, RunningValue, Previous or lookup function. Aggregate, RowNumber, RunningValue, Previous and lookup functions cannot be used in calculated field expressions.
    The Espression for the calculated field I am attempting to sum is the following:

  • Table for user status field in CJ20n transaction project defination

    HI ALL,
    what is table for user status field in CJ20n transaction project defination creation. This field is in Basic Data tab.
    Thanks.

    Hi,
    Check following tables for Usre status:
    TJ30 - User status
    TJ30T - Texts for user status
    TJ20 - Status profile
    JEST - Object status
    JSTO- WBS status profile.
    Check this code:
    REPORT zps_get_userstatus .
    PARAMETERS: p_posid LIKE prps-posid.
    *-- Constants
    CONSTANTS: gc_yes(1)     TYPE c                 VALUE 'X',
               gc_no(1)      TYPE c                 VALUE ' '.
    *-- Variables
    DATA: l_objnr LIKE prps-objnr.
    *-- Internal tables
    DATA: BEGIN OF lit_jest OCCURS 0,
           objnr LIKE jest-objnr,
           stat  LIKE jest-stat,
         END OF lit_jest.
    DATA: BEGIN OF lit_jsto OCCURS 0,
           objnr LIKE jsto-objnr,
           stsma LIKE jsto-stsma,
          END OF lit_jsto.
    DATA: BEGIN OF lit_status OCCURS 0,       "Combination of JEST & JSTO
              objnr LIKE jest-objnr,
              stsma LIKE jsto-stsma,
              stat  LIKE jest-stat,
            END OF lit_status.
    DATA: BEGIN OF lit_usrsta OCCURS 0,       "Uer status for all wbs
             objnr LIKE jest-objnr,
             stsma LIKE jsto-stsma,
             stat  LIKE tj30t-estat,
             txt04 LIKE tj30t-txt04,
           END OF lit_usrsta.
    DATA: BEGIN OF lit_usrtxt OCCURS 0,       "User Status text - TJ30T
            stsma LIKE tj30t-stsma,
            stat  LIKE tj30t-estat,
            txt04 LIKE tj30t-txt04,
          END OF lit_usrtxt.
    * get WBS object number
    SELECT SINGLE
         objnr FROM prps
               INTO l_objnr
               WHERE posid = p_posid.
    * get WBS active status from table JEST
    SELECT
          objnr
          stat
               FROM jest INTO TABLE lit_jest
               WHERE objnr =  l_objnr AND
                     inact <> gc_yes.
    * get WBS status profile from table JSTO
    SELECT
          objnr
          stsma FROM jsto
                INTO TABLE lit_jsto
                WHERE objnr =  l_objnr.
    * combine JEST and JSTO table for user status
    LOOP AT lit_jest.
      IF lit_jest-stat CP 'E++++'.
        READ TABLE lit_jsto WITH KEY
                            objnr = l_objnr.
        IF sy-subrc = 0.
          lit_status-objnr = lit_jest-objnr.
          lit_status-stsma = lit_jsto-stsma.
          lit_status-stat  = lit_jest-stat.
          APPEND lit_status.
        ENDIF.
      ENDIF.
      CLEAR: lit_jsto, lit_status.
    ENDLOOP.
    *  get text for user status
    SELECT DISTINCT
             stsma
             estat
             txt04 FROM tj30t
                   INTO TABLE lit_usrtxt
                   FOR ALL ENTRIES IN lit_status
                   WHERE stsma = lit_status-stsma AND
                         estat = lit_status-stat  AND
                         spras = sy-langu.
    Let me know if you have any question.
    Regards,
    RS

  • Trouble with calculating fields. Can't select (check) fields. Also can't figure out what's wrong with a division field (percent) that I created. Keep getting the pop up that format of the field doesn't allow blah blah blah... Help!

    Trouble with calculating fields. Can't select (check) fields. Also can't figure out what's wrong with a division field (percent) that I created. Keep getting the pop up that format of the field doesn't allow blah blah blah... Help!

    1. Use the mouse to select the field and then press the space bar.
    2. A null string is the same as zero. What is the result for division by zero?

  • How do I write JavaScript for a complex calculation in a PDF?

    Is there a way to create a more complex calculation in a PDF? I have created an order form that has separate fields for quantity, price and subtotals. For every item on the order form, the first two quantities are no charge. Each quantity after that is .25/each. How do I write the JavaScript to accomplish this calculation?
    e.g. 6 items ordered, first 2 are No Charge,
    =(2*0.00)+(Qty-2*0.25), should equal $1.00
    =(2*0.00)+(6-2*0.25)
    =0.00+1.00
    =1.00

    Not quite. You still need to use the eval function otherwise the numbers are just strings.
    Try this in the JavaScript Debugger:
    var Qty = 4;
    if (Qty>2) {
        var subtotal = eval ((Qty-2)*0.25);
    } else {
        var subtotal = 0;
    app.alert (subtotal);
    Steve

  • Conditional formating for calculated fields

    Hi,
    What i need to do is apply a diferent format for some itens on the reports.
    I have some fields that are calculated in the script logic, so in the excel report it is shown as any other field where you can type the value, but that value gets overiten once the script logic takes place.
    So what i need to do is add a new collum at the dimention for example "CALCULATED" and when it's set to Y the field would be shown in the form with a diferent formula.
    And further on, add automtic comment to that cell, showing how that field is calculated.
    Thanks in advance
    Leandro Brasil

    Hey all,
    the CALC property in BPC refers only to hierarchie nodes. If you wanna highlight calculated nodes, this will be the solution for you. But, if you wanna highlight values in your report, which are calculated by a script logic and which are not necessarily hierarchie nodes, you'll have to add another property different from CALC in your dimension and flag the calculated values.
    If you're done, you can refer to this property in your format range.
    Example:
    Dimension - Property - Value: ACCOUNT - SCRIPTCALC - 1
    Formatrange - Criteria: ACCOUNT.SCRIPTCALC = 1
    Have a nice day!
    Karsten

  • IF statement in Calculated Field for Share point, doesnt calculate sum in my Excel Pivot table.

    Hi Everyone
    I used this in SP calculated column field.
    =IF([Shift Sched]="1pm to 10pm","0",IF([Shift Sched]="2pm to 11pm","1",IF([Shift Sched]="3pm to 12am","2",IF([Shift Sched]="4pm to 1am","3",IF([Shift Sched]="5pm to 2am","4",IF([Shift
    Sched]="6pm to 3am","5",IF([Shift Sched]="7pm to 4am","6",IF([Shift Sched]="8pm to 5am","7",IF([Shift Sched]="9pm to 6am","8",IF([Shift Sched]="10pm to 7am","8",IF([Shift
    Sched]="11pm to 8am","7",IF([Shift Sched]="12pm to 9am","6",IF([Shift Sched]="1am to 10am","5",IF([Shift Sched]="2am to 11am","4",IF([Shift Sched]="3am to 12pm","3",IF([Shift
    Sched]="4am to 1pm","2",IF([Shift Sched]="5am to 2pm","1",IF([Shift Sched]="6am to 3pm","0",IF([Shift Sched]="7am to 4pm","0",IF([Shift Sched]="8am to 5pm","0",IF([Shift
    Sched]="9am to 6pm","0",IF([Shift Sched]="10am to 7pm","0",IF([Shift Sched]="11am to 8pm","0",IF([Shift Sched]="12pm to 9pm","0"))))))))))))))))))))))))    
    it was able to work fine however my issue is when i extract the information to excel and use a pivot table the table is not able to calulate the sum of the value for this field. Can you please help me with this. this is for an Attendance traker for Night
    Differential pay for employees. they create a daily log of their shift schedule and if i summarize this in pivot the value in the calculated field for this is not getting the sum.
    Thanks,
    Norman

    Hi Everyone
    I used this in SP calculated column field.
    =IF([Shift Sched]="1pm to 10pm","0",IF([Shift Sched]="2pm to 11pm","1",IF([Shift Sched]="3pm to 12am","2",IF([Shift Sched]="4pm to 1am","3",IF([Shift Sched]="5pm to 2am","4",IF([Shift
    Sched]="6pm to 3am","5",IF([Shift Sched]="7pm to 4am","6",IF([Shift Sched]="8pm to 5am","7",IF([Shift Sched]="9pm to 6am","8",IF([Shift Sched]="10pm to 7am","8",IF([Shift
    Sched]="11pm to 8am","7",IF([Shift Sched]="12pm to 9am","6",IF([Shift Sched]="1am to 10am","5",IF([Shift Sched]="2am to 11am","4",IF([Shift Sched]="3am to 12pm","3",IF([Shift
    Sched]="4am to 1pm","2",IF([Shift Sched]="5am to 2pm","1",IF([Shift Sched]="6am to 3pm","0",IF([Shift Sched]="7am to 4pm","0",IF([Shift Sched]="8am to 5pm","0",IF([Shift
    Sched]="9am to 6pm","0",IF([Shift Sched]="10am to 7pm","0",IF([Shift Sched]="11am to 8pm","0",IF([Shift Sched]="12pm to 9pm","0"))))))))))))))))))))))))    
    it was able to work fine however my issue is when i extract the information to excel and use a pivot table the table is not able to calulate the sum of the value for this field. Can you please help me with this. this is for an Attendance traker for Night
    Differential pay for employees. they create a daily log of their shift schedule and if i summarize this in pivot the value in the calculated field for this is not getting the sum.
    Thanks,
    Norman

  • What is the initial value for a numeric field ??

    Can someone tell me what the INITIAL VALUE FOR A NUMERIC FIELD is ?? Thank you
    Rod.

    Using the following...
       class MyClass
         int myvar1;  // Default initial value
         int myvar2 = 3;  // Default initial value and default value
         MyOtherClass myclass1; // Default initial value
         void doit()
           int mylocal1;  // No value
           MyOtherClass myclass2; // No value
    All number member variables, like myvar1 start off with andefault initial value which is zero. For booleans this is false. Object reference variables, like myclass1, have a null value.
    All local numeric variables are considered undefined. So mylocal1 and myclass2 are undefined. Before you can use them you must explicitly provide a value.
    Finally note that myvar2 will have two values during class instantiation. Initially it will have a value of zero. Sometime later it will have the value of 3. (When that happens is very definitely outside the scope of what this forum covers. If you want to know then ask in the advanced forum.)

  • What is the table name and field name for Street 2, street3 in Vendor mast.

    Hi,
    I have a BDC code for Vendor master. I just need to insert the fields street 2, street3, stree4 and street5 in the code. Can I insert it in the code directly without re-recording? If yes then what would be the table and field names for the fields mentioned above.
    Thanks & Regards,
    Sriram

    Hi Sriram,
       Its a Configuration Setting to bring the Check box ask your SD consultant, else directly insert this try, change your internal table filed here,
      PERFORM bdc_dynpro USING 'SAPMF02K'    '0100'.
      PERFORM: bdc_field USING 'RF02K-BUKRS' indata-bukrs,
               bdc_field USING 'RF02K-EKORG' indata-ekorg,
               bdc_field USING 'RF02K-KTOKK' indata-ktokk,
               bdc_field USING 'USE_ZAV'     'X',------------------------>this part is check box
               bdc_field USING 'BDC_OKCODE'  '/00'.
    for street just try this without re-recording,
    PERFORM bdc_field  USING 'ADDR1_DATA-NAME1'       indata-name1.
      PERFORM bdc_field  USING 'ADDR1_DATA-NAME2'       indata-name2.
      PERFORM bdc_field  USING 'ADDR1_DATA-SORT1'       indata-sortl.
      PERFORM bdc_field  USING 'ADDR1_DATA-STREET'      indata-stras.
      PERFORM bdc_field  USING 'ADDR1_DATA-POST_CODE1'  indata-pstlz.
      PERFORM bdc_field  USING 'ADDR1_DATA-CITY1'       indata-ort01.
      PERFORM bdc_field  USING 'ADDR1_DATA-COUNTRY'     indata-land1.
      PERFORM bdc_field  USING 'ADDR1_DATA-REGION'      V_regio.
      PERFORM bdc_field  USING 'ADDR1_DATA-PO_BOX'      indata-pfach.
      PERFORM bdc_field  USING 'ADDR1_DATA-STR_SUPPL2'  indata-suppl2.
      PERFORM bdc_field  USING 'ADDR1_DATA-TAXJURCODE'  indata-txjcd.

Maybe you are looking for

  • Text input variable

    How do i make a text input element have a variable ?.....I don't mean instance name ....i mean variable!

  • Error while Connecting to external content types using sharepoint designer 2013

    I have a standalone development sharepoint server 2013. After i installed BDC service, i try to create a external content list. When i try to open the site in sharepoint designer i am getting the error like "Could not establish Trust relationship for

  • FCS on Dual 2Ghz G5?

    I know Apple recommends a minimum of a G5 1.8, but I'm wondering if anyone can give me an idea of how FCS might run on a Dual 2 ghz G5? Thanks in advance, Larry

  • "The storge location for time machine backups can't be found"

    I posted this on the TIme capsule forum and got no reply. PLEASE somebody, I need help with this. Time machine on my new MBP (Leopard 10.5.2) is now failing on my new Time Capsule and I am unable to connect to my backups. Whenever I open Time Machine

  • Outlook Contacts Issue after Edited on iPhone

    When I edit a contact (or add a new contact) on my iPhone, it appears with all information in my Outlook "Contacts" folder. This is good. BUT - when I am creating a new email in Outlook and press the "TO" button to open up the Contacts folder, all co