Formula for restricting records

Hi All,
I have to restrict the record selection criteria to get the latest modified record for each customer as shown in below example. I cannot use SQL on this datasource so I think I should create a formula and I should use that in record selection criteria but I don't know how to define this formula. Can any one of you please help.
Ex.
Customer No             Modification Date       
10000001                  1-Jan-2009
10000001                  2-Jan-2009
10000001                  3-Jan-2009
10000002                  1-Jan-2009
10000002                  2-Jan-2009
Desired result only 2 records
Customer No             Modification Date       
10000001                   3-Jan-2009
10000002                   2-Jan-2009
Thanks,
Chetan

Hi Chethan,
I think its tough to write formula in select expert for your requirment..
But here is the another workaround!!!.
1, Create one new group(If not exists with 'CustomerNo'. Then suppress both Group header and footer.
2, Then suppress your detail section with this condition.
if {ModificationDate}=maximum({ModificationDate}, {CustomerNo}) then
false
else
true
This will work for you,
Regards,
Salah

Similar Messages

  • Formula field, Detail records not getting updated

    Hello seniors,
    i need help on 2 issues;
    first, Issue No. 1
    i have master-detail form with the following tables;
    POH                                  master record table
    PH_NO                              pk
    PH_PARTY
    PH_FXRATE                       exchange rate
    PH_PD_LOCAL_TOT           total of PD_LOCAL_AMT  from details records
    PH_PD_FOREIGN_TOT       total of PD_FOREIGN_AMT  from details records
    POD                      Detail records table
    PD_PHNO              fk
    PD_ITEM
    PD_QTY
    PD_PRICE
    PD_LOCAL_AMT        
    PD_FOREIGN_AMT
    M_PD_FOREIGN_AMT       Formula (PD_QTY * PD_PRICE)
    M_PD_LOCAL_AMT           Formula (M_PD_FOREIGN_AMT/PH_FXRATE)
    CTRL                 Control block
    M_PH_PD_LOCAL_TOT           Summary-Sum-Table=POD, Field=M_PD_LOCAL_AMT
    M_PH_PD_FOREIGN_TOT       Summary-Sum-Table=POD, Field=M_PD_FOREIGN_AMT
    Triggers
    POH Table
    Pre-Insert   and   Pre-Update
    :PH_PD_LOCAL_TOT := :M_PH_PD_LOCAL_TOT
    :PH_PD_FOREIGN_TOT  := :M_PH_PD_FOREIGN_TOT
    POD Table
    Pre-Insert   and   Pre-Update
    :PD_LOCAL_AMT := :M_PD_FOREIGN_AMT
    :PD_FOREIGN_AMT :=  :M_PD_LOCAL_AMTThe problem that i am facing is while i UPDATE a record.
    whats happening is when the form is in Query mode and if i change a record, lets say
    change the value of the field PH_FXRATE, then what happens is, on screen i get all Detail
    record's M_PD_LOCAL_AMT Calculated & Updated, but the actual db field PD_LOCAL_AMT remains unchanged
    in the database after i press F10 or Save button.
    The update takes place for the POH table and form displays 1 Record updated.
    whereas if i have for example 4 detail records, then form should update those as well and display finally
    5 records updated is'nt it..?
    In query mode,if i insert new or modify an existing record in the detail block, then at this point, form marks just
    that particular record as CHANGED. Thus making changes at db level only for this particular record.
    what i want is once i make changes to the field PH_FXRATE, then form should mark all detail records
    as CHANGED and on saving, the PRE-UPDATE tigger of POD table should come in to force and the changes
    in the values of M_PD_LOCAL_AMT in turn to the db field PD_LOCAL_AMT should get affected at db level.
    i have also tried to put these assignments
    :PD_LOCAL_AMT := :M_PD_FOREIGN_AMT
    :PD_FOREIGN_AMT := :M_PD_LOCAL_AMT
    at PRE-UPDATE of POH table, thinking that form might consider
    all detail records, at this point. i noticed that it does it, but only picks
    1 record (i guess just the first record always) and change a db level.
    No. 2 Issue:
    i have put a POST-FORM-COMMIT at form level for auditing the Total fields of POH table against the details records.
    Declare
         M_LC_AMOUNT NUMBER(13,3);
                  M_FC_AMOUNT NUMBER(13,3);
    Begin
         SELECT SUM(PD_LOCAL_AMT) INTO M_LC_AMOUNT
         FROM POD
         WHERE  PD_PHNO = :PD_PHNO;
         IF  :PH_PD_LOCAL_TOT != M_LC_AMOUNT  THEN
              :PH_PD_LOCAL_TOT := M_LC_AMOUNT;
         END IF;
         SELECT SUM(PD_LOCAL_AMT) INTO M_FC_AMOUNT
         FROM    POD
         WHERE  PD_PHNO = :PD_PHNO;
         IF  :PH_PD_FOREIGN_TOT != M_FC_AMOUNT  THEN
              :PH_PD_FOREIGN_TOT := M_FC_AMOUNT;
         END IF;
    End;i was testing and notice that in a query mode when all records are displayed.
    if i go on changing values on records and save or save later keeping the form open,
    form allows, but if 1 come back to a record which i may have changed and saved earlier, then it flashes Error;
    "Records has been changed by another user, requery to ..."
    i want to do an Audit before final db-Commit and keep the user free from this Error..
    Please tell me first of all, is my approach for both of my issues,correct.?
    if not, then please suggest what should be changed.
    i'll highly appreciate for all your help. TYVM. Regards.

    I did exactly as you suggested. It works well for new record insertion
    but when i press F7 to query it, its flashes messages before displaying detail records
    Field must be entered.
    Mr. Andreas,
    i have problem only when i change value of PH_FXRATE. It re-calculates on screen values for M_PD_LOCAL_AMT
    (Formula M_PD_FOREIGN_AMT/PH_FXRATE)
    i want the changed value of M_PD_LOCAL_AMT to be saved in the actual db-field PD_LOCAL_AMT.
    for this i have PRE-UPDATE on POD Table
    :PD_LOCAL_AMT := :M_PD_LOCAL_AMT
    :PD_FOREIGN_AMT := :M_PD_FOREIGN_AMT
    Which is doing that.It is not marking the detial record as CHANGED.
    I tried giving the above assignments in the PRE-UPDATE on POH table.
    It saves the changed value in the db-field, but not all detail records, if more than 1.
    what you have suggested, will get me acheived what i am looking for..?

  • How we can restrict record in CTL file on the basis of other table ?

    Hello all,
    How we can restrict record in CTL file on the basis of other table ?
    Eg.
    I have following control file to load the records in the table through the sql loader.
    LOAD DATA
    INTO TABLE THIST APPEND
    FIELDS TERMINATED BY "|" TRAILING NULLCOLS
    LNUM POSITION(1) Char "substr(:LOAN_NUM, 4, 13)",
    TSRNUM Char "rtrim:TRAN_SR_NUM)" ,
    TPROCDT Char "to_char(to_date rtrim:TRAN_PROC_DT), 'MMDDYYYY'), 'YYYYMMDD')"      
    I have another table c all TFILE in which I have LNUM. I want to import only those records from input text file using the control file and sql loader in which LNUM is exist in the TFILE.
    So how i can restrict it in the Control File.
    Thanks
    Kamlesh Gujarathi
    [email protected]

    Hello Satyaki De.
    Thank you very much for your suggestion but my Private information is totally apart from this question & I already I have changed each and every information from the question.
    Thanks
    Kamlesh Gujarathi
    [email protected]

  • How to use total/sum of values obtaind by applying formula on restricted KF

    Hi all
    I am using formula on restricted keyfigure i.e I want to apply formula on quantity for particular material say 100007,100990.I want to use total of values in some other formula,obtained by aaplyin formula on their respective quantities(obtained by using restricted keyfigure). if I use SUMCT or SUMGT it is not taking total of these 2 values instead taking value obtained by applying formula on result row.
    Is there any other way to use this 'total ' value in some other formula
    KIindly help
    Regards
    Megha

    have you tried: key figure properties -> calculations -> calculation directions
    hope it helps,
    Leo

  • Displaying variable no. of fields for different records

    Hi,
    I have the requirement of displaying variable no of fields for different type of record in the business object.How can this be done in VC. For example i have to show an extra field for country "IN"
    Thanks in advance,
    Regards,
    Anupam

    Hi Anupam,
    Please explain ur requirement more clearly.
    If understanding is right ,you are creating a Table/Form with the information of a particular company ,and u r interested to add another column to this table and this column should not be visible when to select another company. Am I right?
    What is the data source is it a BAPI or Query or Query View?
    1)Drag and drop a table from the Query(if suppose).Or form if u want to include in the form.
    2)And if u want another field(if it is to be calculated) in ur table u can have include an expression box by clicking a "+" sign in the table and specify the formula for it in the Expression field uder the Data source field in the General Tab.
    3)And if u want to hide this field when u select another country then u can set a visibility condition.
    4)Go to control properties window of the new field.U can get this by selecting the new added field and by clicking on configure or by left clicking the new field and then selecting the properties.
    5)Inside the General Tab, u have UI Control,below that u have Hidden which is a check box, just check it.And click on condition. Then type the condition for it to be hidden.Then it is hidden.
    Please try doing the above.
    Reward me with points if its helpful.
    Thanks,Regards,
    Sripriya Srinivasan.

  • Matching score for new records added to existing workflow

    Hi SDNers,
    My doubt is:
    I have a 2 Workflows which are already in process. The triggering event for them is Manual, Record Import.
    Now I manually assigned 20 records  to "Workflow A" based on Condition 1
    Also, I manually assigned 20 records  to "Workflow B" based on Condition 2
    I am importing 30 new records. Based on the condition, I want to assign these records to the existing Workflow A / Workflow B.
    Note: There is a Match stencil, so the newly created records have to be matched against the existing records in the present Workflow itself.
    Is it possible to add new records o existing workflow manually?
    Also, what about the Matching score? will the records be matched?
    Thanks & Regards,
    Priti

    Hi Priti,
    I tried restricting records using Named Searhes and Masks but it includes all the records with Match step property Records Vs All. You have to perform some maunal step either by selecting records using some search criteria or you can use Named Searches i.e.
    1. Create one field say New of type boolean and by default set it to NO.
    2. Create one named search for this field value to YES.
    3. Create one assignment which sets the value for this field to YES and add this assignment in the workflow as the first step.
    4. When ever you import records, assignment will set New=YES for all the records imported. Now, when you add more records, search the previous records using Restore Named Search function which will give the list of records imported now. You can perform Matching and Merging operation.
    5. Add one more assignment to the workflow as the last step which should set New=NO so that records should not appear next time for Matching
    Regards,
    Jitesh Talreja

  • Fox formula for actual/plan data  - Planning function

    Hello,
    I am working on the following scenarios for developing a  planning functions for a monthly forecast.
    It is rolling montly forcast where user starts the planning in Jan and he has to show the actaul value for the month of Jan and blank values for the remaining 11 months of the year and then the user post his new forecast values for the remain 11 of the year(to replace initial balnk values) so that the data will be saved to real time cube with version v108
    In Feb, Jan & Feb months has to show the act values and remaining 10 months has to show last month forecast data. The the user may revise the forecast for the 10 months and then we have to write the data to the real time cube with version v208
    In Mar, Jan, Feb and Mar has to show the actual values and the reamining 9 months has to show the last month forecast and then users may revise the forecast data and then i have to write back to the cube with version v308.
    I want to automate this process for all the months and all years without manual intervention. So, i decideed to write a fox formula for this scenario with following draft code.
    I will get the fy period & year as a variable values and then take the system date into the variable
    for each fy period
    if the fy perio <= sys date.
      {version, infoprovider,value type,amount} = {0,act cube, 10, 0amount)
    else
    {version, infoprovider,value type,amount} = {result,plan cube, 20, 0amount)
    endif.
    result will be calculated on the separe routine and populated here
    case (fy per)
    when 01.
    concatenate v1 with fy+2(2) into y
    result = v1+y
    when 02.
    concatenate v2 with fy+2(2) into y
    result = v2+y
    when 03.
    concatenate v3 with fy+2(2) into y
    result = v3+y
    when 04.
    concatenate v4 with fy+2(2) into y
    result = v4+y
    when 05.
    concatenate v5 with fy+2(2) into y
    result = v5+y
    when 06.
    concatenate v6 with fy+2(2) into y
    result = v6+y
    when 07.
    concatenate v7 with fy+2(2) into y
    result = v7+y
    etc...for all months
    So, can you please let me know the best way to implement this (either by fox formuls or exits)...your inputs are really appreciated
    Thanks,
    Srini
    Edited by: srini on Mar 28, 2008 12:05 PM

    Hi Srini,
    If I 've understood u r problem clearly ,You have to write two Fox Functions and you can call exit variable in both to check the system date.
    I think first you should create exit varriable which would return the system date,use the same variable in data slice to lock the data till current period.
    After that create one fox restricted with any one version where you can copy the data for planning .for example:-
    1)First Fox:-
    DATA TIM_FISCPER TYPE 0FISCPER.
    TIM_REF_FISCPER = VARV(ZEXIT_FPER).
    Get the last month
    version using modlue or any another logic .(v108)
    FOREACH TIM_FISCPER.
        IF TIM_FISCPER <= TIM_REF_FISCPER.
      {0amount,version(001) ,tim_fiscper} = {0amount,version(000) ,tim_fiscper}.
    else.
      {0amount,version(001) ,tim_fiscper} = {0amount,version(v108) ,tim_fiscper}.
         endfor.
    Its just n example use the granularity according to the requirement.
    2)Second fox would save the changed plan data:-
    DATA TIM_FISCPER TYPE 0FISCPER.
    TIM_REF_FISCPER = VARV(ZEXIT_FPER).
    Get the last month
    version using modlue or any another logic .(v208)
    FOREACH TIM_FISCPER.
        IF TIM_FISCPER > TIM_REF_FISCPER.
      {0amount,version(v208) ,tim_fiscper} = {0amount,version(001) ,tim_fiscper}.
         endfor.
    Here ZEXIT_FPER is an exit variable created using cmod and populated with system date.
    Hope it will helpful for u.
    Rgds,
    Indu

  • Error in formula function (ROUTINE_18) record 1

    Hi All,
    We are loading a flat file in to a DSO. From here we are loading the data from DSO to a cube (using this DSO as a Export datasource). In the export datasource infopackage, we are giving date in the selection screen and loading the data. before it is working fine. Now when we try to load the data, i am facing the error " Error in formula function (ROUTINE_18) record 1" and the data was not moving from the PSA to the infocube.
    Recently we have upgraded the BI system from 7.0 version to 7.3.
    Please let me know the reasong for the failure and how to correct it.
    I have replicated the Export datasource and even i re-generated the DSO as export datasource but no use and getting the same error.
    Thanks,
    jack

    Ok...you have a BW 3.5 flow.
    As you said you have selection at InfoPackage level. Please check whether the InfoPackage without selection works or not.
    If it works then you have the problem in Selection field.
    Also check if there is any problem in Update Rule /Transfer rule
    If you have selection routine written at InfoPackage level, create a new InfoPackage ( Full) and load .
    Anindya
    Edited by: Anindya Bose on Nov 3, 2011 11:01 AM

  • Calling Procedure for each record ?

    Hi,
    I am using a procedure in a mapping.
    I defined the procedure which is having 4 out parameters.
    I am assigning these default values to the tables in a mapping.
    When I see the generated code in a mapping, I observed that, the procedure is being called for each record.
    But actually, its enogh to be called only once.
    Could any one please help me, how can I restrict the procedure calling for each record.
    Any help would be greatly appreciated.
    Thank you,
    Regards,
    Gowtham Sen

    Hi,
    U can use MAP-INPUTS operator to give the inputs to the procedure and use a PRE_MAPPING operator to call the procedure. this way even if u feel u want to make the mapping running thru an scheduler u can still use it without changing the code.
    Regards
    Bharath

  • Formula for comparing string and setting text object to visable?

    I have a report that is pulling data from a database and listing multiple records, one on each page. I am wanting to compare a value that is stored in a database field for each record and setting a text object visible based on the text.
    I'm very new to Crystal Reports and not quite sure on the type of syntax needed to perform what I'd like below and can't find much information online about it. The type of formula I want would be something like:
    if (vDetailReport.BoardAction = "Board Action w/Committee Action")
        txtBox1.Visible = True;
    else if (vDetailReport.BoardAction = "Board Action w/o Committee Action")
        txtBox2.Visible = True;
    else if (vDetailReport.BoardAction = "Committee Discussion Only")
        txtBo3.Visible = True;
    etc.
    The txtBoxes are text objects with an "X" as the string that are inside the boxes to appear as a checkbox. I'm wanting this to work for every record in the report.
    Example:
    http://img.photobucket.com/albums/v57/kaje103/boardaction.png
    Any help would be much appreciated!

    I believe that what you want to do here is place an text item consisting of an "X" at each location you want. Then select "Format Text", go to the Common Tab, and click on the button next to "Suppress". That allows you to put in a formula such as:
    {vDetailReport.BoardAction} &lt;> "Board Action w/Committee Action"
    that will suppress the X unless it's the value you want checked.

  • Formula for ascending column of numbers

    Hi,
    I never use Numbers so forgive a crazy simple question.
    I have a list of names and other details in Numbers. I'd like to add a column to the very left that, for each row, has a number corresponding to each "record".
    These numbers would ascend from 1, as each row ascends.
    What would the formula for this be? I hate to have to enter each manually. There are hundreds of records.
    Thanks so much for your help.

    Is this what you are wanting to do:
    Autofill cells
    You can quickly add the content from selected cells to adjacent cells without typing it. You can also fill a row or column with a logical sequence of data—for example, a series of digits, dates, or letters.
    Do any of the following:
    Autofill the content from one or more cells into adjacent cells: Select the cells with the content you want to copy, then move the pointer over a border of the selection until a yellow autofill handle appears. Drag the handle over the cells where you want to add the content.Any data, cell format, formula, or fill associated with the selected cells is added, but comments aren’t. Autofilling overwrites existing data with the value you’re adding.
    Autofill sequential content or patterns into adjacent cells: Type the first two items in the series in the first two body cells of the row or column you want to fill; for example, type A and B. Select the cells, move the pointer over a border of the selection until a yellow autofill handle appears, then drag the handle over the cells you want to fill.You can also autofill cells using a pattern of values. For example, if two selected cells contain 1 and 4, the values 7 and 10 are added when you drag over the adjacent two cells (values are incremented by 3).
    Autofilling doesn’t set up an ongoing relationship among cells in the group. After autofilling, you can change the cells independently of each other.
    When you autofill cells, any formulas that refer to those cells are updated automatically to use the new value.

  • ADI not working for multiple records

    Hi,
    We currently have an issue with ADI. The ADI we have produces an MS Word letter based on a custom view and custom integrator.
    On the person form, when I query for an employee and the resultset is 1 our ADI is working fine and the letter/word document is generated.
    When the query returns more than one employee, the Web ADI errors. It does not download any records into the excel file and then when it tries to open the word document it asks for Header Record Delimiters?
    In the excel document I get a Run-Time error '5922' Method 'Run' of object '_Application' failed.
    Is there a setting that only restricts ADI to return one row from this form?
    Any help would be greatly appreciated.
    Many thanks
    Martin

    Hi,
    We currently have an issue with ADI. The ADI we have produces an MS Word letter based on a custom view and custom integrator.
    On the person form, when I query for an employee and the resultset is 1 our ADI is working fine and the letter/word document is generated.
    When the query returns more than one employee, the Web ADI errors. It does not download any records into the excel file and then when it tries to open the word document it asks for Header Record Delimiters?
    In the excel document I get a Run-Time error '5922' Method 'Run' of object '_Application' failed.
    Is there a setting that only restricts ADI to return one row from this form?
    Any help would be greatly appreciated.
    Many thanks
    Martin

  • Now to define new formulas for pricing?

    can any one please tell me a business scenario where one needs to define a new pricing formula, and how can one can do that in the system?
    points will be rewarded immediately.
    thanks
    PR

    Hi,
        As our friends suggested you can create new formulas for pricing with the Transaction code VOFM.
    Process is use VOFM(Transaction code)------>in top menu you can see Formulas, select appropriate option in Formulas lke.. Condition base value, Condition Value etc.,
    Please go through detail information:-
    Formulas are represented as FORM routines. They are used in pricing and influence the determination of prices according to predefined rules. You can specify them in pricing control. The following groups of formulas exist:
    Scale base value
    The scale base value includes FORM routines which determine the scale base value according to criteria that are not defined in the standard system. You enter the scale base value in the Scale formula field. A formula for the scale base value can define, for example, that partial quantities are taken into account.
    Condition base value
    Formulas for the condition base value take into account criteria not defined in the standard system. You enter them in the Alternative formula for condition base value field in the pricing procedure. A formula for the condition base value can define, for example, that the condition determination is based on net value or volume.
    Condition value
    Formulas for determining of the condition value include routines which determine the condition value according to criteria not defined in the standard system. You enter the formulas for the determination of the condition value in the Condition formula for alternative calculation type field in the pricing procedure. A formula for the condition value can define, for example, that the system determines the best price for the customer.
    Structure of group key
    Using this menu entry, you can edit routines that determine the base value for the scale value if group conditions are used in pricing. The system then calculates the base for the scale value from more than one document item. You can enter the routines in the Group condition routine field on the screen for defining condition types. A routine for the determination of the scale valuecan define, for example, that only a particular condition type is taken into acount.
    Rounding rules
    Using this entry, you can create and edit FORM routines that carry out a particular type of rounding in the condition record during a price change. A rounding rule could round a price that was increased by 1% to the last two places behind the decimal point, for example.
    Procedure
    To define your own formulas, proceed as follows:
    1. First check whether you can use the formulas delivered with the standard system.
    2. Either overwrite an existing formula or select a group number from the number range reserved for customer modifications (600-699) and enter the corresponding description.
    3. Program the formula in the editor.
    4. Activate the formula.
    5. Enter a long text that describes the meaning of the formula in more detail.
    6. Enter an application if you want to use the formula in a particular application area only (pricing, for example).
    7. Enter the formula in the appropriate place of the control
    NOTE:- to create new routine get Access key from Basis.
    I hope it will help you to define formulas for pricing.
    Regards,
    Venkat

  • Crystal Report Formula to select Record  of only MAX Value

    hi Everyone,
    i need a simple crystal report formula to select one department whose recived quantity Maximum.
    for example:
    itemcode    dscription      departmen   op       recived       issue        
      1                   a                ab               2              2              2         
      1                   a                bb              0             2              2          
      1                   a                bc               4             8              2         
      1                   a                cc              2              2              2
    i group by item  the item show just once but i want a formula to show one department who's recived quantity is maximum.i suppress the detail section.and just show the group footer/
    itemcode    dscription      departmen   op       recived       issue        
      1                   a                  bc                 8             14             8 

    Thanks
    Re: Crystal Report Formula to select Record  of only MAX Value
    Abhilash Kumar

  • How to asighn Formula to condition Record

    hi gurus
    i have small problem , in  pricing  procedure i see some leftside of condition type  there is a zoom tab and it has a codition caculation formula , and same formula i can see in condition record ,
          can you tell me how and where you can do this assignment to condtion type so its visible in pricing procedure , and we can you it for calculation,
    thanks
    Rajeev

    hi
    thanks for the inputs, but the requirment is how i can assighn calculation formula to Conditype or Condition record , might i am not able to expain my question in a proper way ,
    but i got the answer , thsi requireemtn is use for IS OIL only and that formula is availble when u change your Calulation type in Condition type to "Q" , then if u check or creat condition , you will get a formula tab on you top righthand side where you can maitain the formula for calucutaion the complex pricing
    thanks all of you
    Rajeev

Maybe you are looking for

  • Vista glass effect in JFrame

    Hi, I try to get the vista glass effect working in JFrame via calling DwmExtendFrameIntoClientArea over JNI It basically works but the problem is, that the jrootpane draws an opaque rect over the client area. So I hacked the jframe a little bit to se

  • Restatement Functionality when reporting is in different box then consol

    Hello All, We want to achieve restatement functionality but our reporting is in different box meaning consolidation is in one box & reporting is in BI box where virtual multiprovider will not exist. Question is what are the possible ways to achieve t

  • EHS for OSHA reports

    Hello Gurus - I am on an SAP HR project.  Our client is having us implement EHS for the single purpose of being able to generate OSHA reports.  What sub modules of EHS do we need to implement at minimum to generate the reports?  I am a little confuse

  • Running Snow Leopard and having issues syncing.  Are there any donwload/upgrades that can help?

    ...besides Lion, which I am unable to download because it is telling me I don't have enough memory on my Mac.  I am looking for a way toset up iCloud on my desktop. I still get the mobileme logo oin my system preferences???

  • Batch coupon code

    In bcc, i can preview the batch coupon codes. Is this generated coupon stored in some table? If so where can i see all the generated coupon codes 'before claiming'.