ABAP statement to find total no. of recs

Hi,
There is a table with two fields f1 and f2.
f1 is the primary key of the table.
For a particular value of f2 I want to know the total no of records in the above table.
What is the most efficient way to do it.
Please guide me,
Thanks,
CD

select count * into l_recs from dbtable where f2 = value.
regards,
Advait

Similar Messages

  • Quer to find total no of rec

    query to find total number of peoples in a office and also number of peoples who were in the year 1991, 1992, 1993, 1994
    eg:
    Table
    Name_ DOJ_
    aaa 21-05-92
    bbb 03-10-93
    ccc 30-12-93
    ddd 28-05-91

    SQL> create table t (name,doj)
      2  as
      3  select 'aaa', date '1992-05-21' from dual union all
      4  select 'bbb', date '1993-10-03' from dual union all
      5  select 'ccc', date '1993-12-30' from dual union all
      6  select 'ddd', date '1991-05-28' from dual
      7  /
    Tabel is aangemaakt.
    SQL> select count(*) "No_Of_Staff"
      2       , count(decode(extract (year from doj),1991,1)) "Joined_On_1991"
      3       , count(decode(extract (year from doj),1992,1)) "Joined_On_1992"
      4       , count(decode(extract (year from doj),1993,1)) "Joined_On_1993"
      5    from t
      6  /
    No_Of_Staff Joined_On_1991 Joined_On_1992 Joined_On_1993
              4              1              1              2
    1 rij is geselecteerd.Regards,
    Rob.

  • T-code or Table to find total errors in SAP APO like ST22 in ABAP

    hi all,
    Could please tell me the T-code or Table to find total errors in SAP APO like ST22 t-code in SAP ABAP.
    Thanks.
    Suryam S

    Hello Venu,
    Do you mean other functional errors?
    You can check SLG1, /SAPAPO/C3, STAD
    Best Regards,
    R.Brahmankar

  • How to find total recs in a local table for a particular condition

    Hi,
    How to find total recs in a local table for a particular condition?
    Thanks,
    CD

    Well, you may want to try this as well, and compare to the LOOP way.  Not sure what kind of overhead you may get doing this way. Here ITAB is our main internal table, and ITAB_TMP is a copy of it.  Again I think there may be some overhead in doing the copy.  Next, delete out all records which are the reverse of your condition.  Then whatever is left is the rows that you want to count.  Then simply do a LINES operator on the internal table, passing the number of lines to LV_COUNT.
    data: itab type table of ttab.
    data: itab_tmp type table of ttab.
    itab_tmp[] = itab[].
    delete table itab_tmp where fld1 <> 'A'.
    lv_count = lines( itab_tmp ).
    Regards,
    Rich Heilman

  • To find Total Operating Expenses , what are all G/L Nodes to be added

    Dear Team,
             I have got requirement to find to Operating Profit Margin Ratio Using ABAP report, I have searched for formula in forums
    I got the formula.
    Operating Profit Margin Ratio = Operating Profits /  Income.
    ::Operating Profits = Gross Profits - Total Operating Expenses.
    but i have calculated Gross Profits Value & Income value.  I am getting problem to find Total Operating Expenses.
    In our Balance sheet they maintain "Direct Operating Expenses"
                                                             "General Administration Expenses"
                                                             "Financial Expenses"
                                                             "Depreciation".
    To find  total operating Expenses what are all i need to add to find it, please forward ur valuble feed back to me.
    It would help me.
    Thanks in advance..
    Urs,
    Vinay

    in the operating expenses you shall not consider the "Financial Expenses", because they are not caused by the operative part of the company.
    Paolo
    Edited by: Paolo G. on Oct 4, 2011 12:27 PM

  • Obsolete ABAP statements/FM/BAPI in sap 4.7

    dear experts
    pls gv me the details of obsolete ABAP statements/FM/BAPI in sap 4.7 and their replacement in ECC 6.0,the statements should be related to MODULE POOL ,reports

    Hello
    ERP 6.0 implies Unicode as well. Therefore have a look at [ABAP and Unicode|http://help.sap.com/saphelp_nw04/helpdata/en/62/3f2cadb35311d5993800508b6b8b11/content.htm]
    You will find useful documentation in the ABAP keyword documenation (ERP 6.0) as well:
    Obsolete Statements
    The statements described in this subnode are obsolete and are only still available for reasons of compatibility with releases prior to 4.6 or 6.10. You may still come across these statements in old programs but you should not use them in new programs.
    Most of the obsolete statements listed here are syntactically forbidden in ABAP Objects or in Unicode programs. As a result, they can now only be used outside of classes or non-Unicode programs. There are replacement constructions for all obsolete statements which improve the efficiency and readability of programs.
    Apart from the obsolete statements listed in this node, there are also obsolete variants and additions for non-obsolete statements. These cannot be used in ABAP Objects and Unicode programs either. They are detailed in the description of the corresponding statements.
    Regards
      Uwe

  • Performance in ABAP  statement

    hi experts
    in one of my program the performance is getting affected in the abap statement not in the database access
    the program logic goes in this way from the main program 3 performs were called for in the last performa onlythe entire processing starts
    in that last perform it s callin for a report through submit and return statement , the called report s again refering to one include program.
    in se30 the highest % it showssthe last perform that s said and the program that s called through submit statement the include program is not affecting the performance please tell mehow to change the report insucha wayi can improve the performance
    please reply
    will assign marks for sure
    thanks in advance

    From your as I understand your original message, your report is calling another report and it is taking a very long time in that step.
    Obviously, the second program is taking time and that is the one to be analyzed. So, you put a break-point on the SUBMIT statement and see what are the parameters that being sent to the second program. Then, run the second program all by itself using the parameters you have noted down and analyze what the problem is.
    If my response is totally off of your question, please clarify the question.

  • ABAP statement for deleting the content of a infocube

    Hello,
    does someone know a abap statement or Babi to delete all data from a info cube?

    the abap statement how to delete all data from a specific cube.
    There is a FM " RSDPW_INFOCUBE_DELETE_ALL_DATA". This will delete data in the cube. You need to put this in a program and run it process chain.
    ALso, there is a process type to delete requests from info provider, and you can use appropriately.
    The abap statement how i find out what the highest extraction point data is.
    Define a variable like this:
    DATA: HIGEXT_POINT like data_package_extrpoint (whatever the field name is )
    HIGEXT_POINT = max(data_package_extrpoint).
    Delete data_package where extrpoint < HIGHEXT_POINT.
    Ravi Thothadri

  • Same ABAP statements for SY-SUBRC 0 or 4

    Hi,
    I have a READ TABLE statement and if the SY-SUBRC is equal to 0 or 4, the same ABAP statements should be giving to both. What would be the most efficient way of writing this? Should I just not check for for the SY-SUBRC?
    Thanks,
    RT

    You can simply check for 0 and 4, or if there is no chance of sy-subrc being anything other 0 or 4, simply don't check it..
    clear itab.
    read table itab with key....
    check sy-subrc = 0
        or sy-subrc = 4.
    Regards,
    Rich Heilman

  • Hw to find total number of records

    Hi All,
    Can anyone help from these
    1. how to find total number of reports for a particular cube/ods... need step - step solution
    2. how to find total number of records for a particular Cube and ODS and Aggr's to till date.
    3.what is sandbox,mirror sys,instance of a sys..?
    4.what r TWS(Tivoli Workload Scheduler) jobs? how these r different to standard schedulers?
    Thanks in ADv
    Linda

    Hello Linda,
    As you have lots of answers on first 2 so i'll start from 3rd onward.
    3. Sandbox is mostly practice system where you can do all kind of R&D, mirror sys can be mirror image of any system depends on the organization and instance of system is again mirror image of one system.
    4. TWS is third party tool for scheduling which doesn't come along with SAP like standard scheduler as TWS has been prepared specially for this purpose so it has some more features than standard.
    Hope it helps.
    San.

  • Need to find total no fo  tables/index/m.views in my database

    Hello Everyone ;
    How can i find total no fo  tables/index/m.views in my database ?
    when i  google  i have seen  following  command ;
    SQL> Select count(1) from user_tables where table_name not like '%$%' /
      COUNT(1)
             but i dont understand  what  '%$%'  indicates ?
    Thanks all ;

    Hello Everyone ;
    How can i find total no fo  tables/index/m.views in my database ?
    when i  google  i have seen  following  command ;
    SQL> Select count(1) from user_tables where table_name not like '%$%' /
      COUNT(1)
             but i dont understand  what  '%$%'  indicates ?
    Thanks all ;
    consider to simply Read The Fine Manual YOURSELF!
    Oracle Database Search Results: like

  • Need to Find Total number of InfoPart form in our Web application

    Hello,
    We have to find total number of Infopath forms in our web application. IS there any Power sheell Scripts or anuthing which can output the Infopath Forms location and file count .
    Thanks
    Kundan

    How about something like:
    Get-SPWebApplication http://yourWebAppUrl |
    Get-SPSite -Limit All |
    Get-SPWeb -Limit All |
    Select -ExpandProperty Lists |
    Where { $_.GetType().Name -eq "SPDocumentLibrary" -AND -NOT $_.Hidden } |
    Select -ExpandProperty Items |
    Where { $_.Name -LIKE "*.xsn" }
    Select {$_.Web.Url}, Url
    The above will list all of the files. Do you need counts by library, by site or other?
    Mike Smith TechTrainingNotes.blogspot.com

  • How to find total no of record in cube

    Hi Experts,
    How to find total no of records in a cube.
    Thanks in Advance.

    Hi
    If you want total number of records in a CUBE then you have to check in both F Table and E table.
    Go to LISTSCHEMA tcode in your system, give your CUBE name and execute.
    You will fine two table E and F table
    goto SE16 -->give the table name and click on number of entries.You will get number of records.
    Check the below thread
    No of records in /size of Info cube
    Regards,
    Venkatesh

  • To find total number of files inside folder

    Hai,
       In knowledge management is there any option to find total number of files inside folder...
        I also want to see the recently uploaded and modified documents in a seperate iview...
        Iam using NW2004s SP8..
        Very urgent..
        Waiting for a positive reply..
        Thanks&regards,
         Kiruthika.S

    Hi Kiruthika,
    1. You only need the configarchive if you don't want create all the KM configuration objects mentioned in the guide manually. So, just create the objects mentioned there and you don't need the configarchive
    Also, the scenario works also on 2004s.
    2. Please check this thread on how to show the total number of files inside a folder:
    https://forums.sdn.sap.com/thread.jspa?threadID=19610
    3. It would be nice if you would consider rewarding the time people like Saravanan spend to investigate and answer your question by assigning points via the colored stars.
    Best regards,
    Robert

  • How to find total in-use connection of a connection pool in Sun apps 8.1 ur

    Hi
    Thank you for reading my post.
    how i can find total open (in-use)connection of a connection pool ?
    sometimes my application take some longer time to do an specefic job , now i want to see how much connection of the pool is open and in use
    thanks

    Hi,
    Sun app.server provides monitoring facility using which we can find how many connections are in use, how many clients are in wait-queue etc.,
    You can refer the following URL of
    Sun Java System Application Server 8 - Administration guide.
    http://docs.sun.com/app/docs/doc/819-2554/6n4r8s7ti?a=view
    for enabling monitoring and getting monitoring values for a particular conn. pool
    Thanks,
    -Jagadish

Maybe you are looking for

  • Absolute navigation using post parameters

    Hi All I am navigating from WD4A iview to WD4J iview through absolute navigation and passing some parameters. I am expecting that these parameters size might be large. Is there is any restriction on the size of the parameters that i can pass in these

  • TDS advance adjustement effect in invoice

    hai, Regarding WHT, while doing advance payment to vendor for Rs.50000.00, system will calculate TDS for Rs.50000.00. Then we received the bill from vendor for Rs.100000.00, then the system will calculate TDS for Rs.100000.00. But system want to dedc

  • Not importing RAW files

    used aperture 2 for a good while. Using the update to ap3 now. Seems like lots of great new updates, really liking the program so far. I went for my first shoot this morning. I used RAW+JPG on the camera. during import, I checked all to be imported.

  • Exchanging Data with Styles in JTextPane

    Is there any way to exchange data between two JTextPanes via a single object? (e.g., extracting Strings or byte[]s which contain both textual data and the corresponding Styles?) Thank you! Brad

  • How to protect multi-logon..

    Dear Experts, I want to protect multi-logon for business. Although I knew how to handling on SAP GUI, (using SUSR0001 - enhancement). But I can't handle it on BSP. Please, tell me how to protect multi-logon... (only one instance by id) Thank you in a