Find number of logs archived

I know how to change the number of SQL Server Logs archived but is there a table that stores the number of logs archived? I need to read from this table to perform some conditional statements.
Ex. SELECT @archive_log_number = logs_archived from [schema.table_name]
if (@archive_log_number = 6)
begin
end
else
begin...
end

Is there a table that holds the number of SQL Server logs?
Hi,
There is an Undocumented command
fn_dblog which has information about SQL server logs.There are others as well dbcc loginfo() ,sp_readerrorlog but none would give you information about transaction apart from fn_dblog
Edit:
http://blogs.msdn.com/b/dfurman/archive/2009/11/05/reading-database-transaction-log-with-fn-dump-dblog.aspx
http://blogs.msdn.com/b/vijaybk/archive/2009/04/29/query-fn-dblog-for-the-list-of-operation-in-active-transaction-of-the-current-session.aspx
select * from fn_dblog(null,null)
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
My TechNet Wiki Articles

Similar Messages

  • How to find number of logged in users on NW04s?

    Ah, the fantastic search on sdn!!!
    I'm sure this has been asked before but I can't find it... (either the question or the answer)
    We have a J2EE application on NW2004s and I want to find how many users are logged on to the system.
    (it's not EP)
    Any quick answers will be appreciated and awarded.
    thnx
    kev

    Hello,
    to get list of active user in J2EE start telnet
    telnet <host> <telnet port>
    log in as j2ee_admin, administrator or with any user with administrator priviledges.
    to get list of available server nodes use command LSC.
    You can choose any node by using jump command followed by node id.
    execute for each node following commands:
    add servlet_jsp
    http_sessions full
    List of telnet commands:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/4e/6e723964c11d45ad3aeca71482f084/frameset.htm
    Drabik Radovan

  • How to find number of logged in users, using servlet

    Hello all,
    How can I find out how many users are successfully looged in on Tomcat server using JAVA technology ????
    Earliest suggestions are appreciated .............
    thnks in advance.......
    PhadkeA

    Maybe http://sourceforge.net/projects/big-brother/ could give you some hints.
    Haven't tried it yet.

  • Finding the order of archive logs in RAC to NON-RAC manual cloning

    Hi,
    I am in the process of automating a RAC to NON-RAC clone using traditional method [ not using RMAN ].
    Here are the steps:
    On Source:
    Record the sequence number and thread of the instance
    put the database in begin backup mode
    copy the files
    disable the backup mode
    record the sequence number and thread of the instance
    prepare the order of the archive logs which will be needed for recovery ==> Here is where I need help
    On Target:
    Restore the backup
    Issue recovery using the order of archive logs identified ==> Failing as order is not correct.
    I am finding the archive logs based on FIRST_TIME# and preparing the order which is not correct. I think i should be using SCN but not sure what should be the criteria.
    Could you please let me know on what basis we can find the order of the archive logs which will be asked during the recovery ?
    Your quick response is appreciated. Thanks in advance for your help.
    Thanks
    Suneel

    Yes, When we execute recover database using backup controlfile until cancel, will prompt for the redo log sequences.
    But as i mentioned before, I am trying script everything and cannot manually enter the sequence numbers required. I need to know the archives and thread it is going to ask [ in what order as well ] so that recovery command can be scripted in shell.
    Please let me know if there is a away to find the order of archive logs which needs to be applied to recover [ if this is a NON-RAC, we can simply go with the sequence numbers but since it is a RAC, i should know the thread number as well ].
    Thanks

  • Find Number of Users Currently Logged on to a SharePoint 2013 on premise server?

    Hello,
    We would like to know which current users are logged in our SharePoint farm.
    Is there a simple powershell script which we can run? or enable a feature
    Thanks,
    Dennis

    SharePoint is a web technology, which means it is connectionless by design.  So there really isn't such a thing as the number of users being logged on being tracked by the server.  The closest you can come is to have the server report how many
    active sessions haven't timed out yet.  Not quite the same thing since some of the sessions will be people who stopped using the system during the last half hour or so who's sessions haven't expired yet.  But its the closest you can come. Here's
    a deeper explanation and one potential solution.
    http://blog.furuknap.net/find-number-of-users-currently-logged-on-to-a-sharepoint-site
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • How to find number of files in a folder using pl/sql

    please someone guide as to how to find number of files in a folder using pl/sql
    Regards

    The Java option works well.
    -- results table that will contain a file list result
    create global temporary table directory_list
            directory       varchar2(1000),
            filename        varchar2(1000)
    on commit preserve rows
    -- allowing public access to this temp table
    grant select, update, insert, delete on directory_list to public;
    create or replace public synonym directory_list for directory_list;
    -- creating the java proc that does the file listing
    create or replace and compile java source named "ListFiles" as
    import java.io.*;
    import java.sql.*;
    public class ListFiles
            public static void getList(String directory, String filter)
            throws SQLException
                    File path = new File( directory );
                    final String ExpressionFilter =  filter;
                    FilenameFilter fileFilter = new FilenameFilter() {
                            public boolean accept(File dir, String name) {
                                    if(name.equalsIgnoreCase(ExpressionFilter))
                                            return true;
                                    if(name.matches("." + ExpressionFilter))
                                            return true;
                                    return false;
                    String[] list = path.list(fileFilter);
                    String element;
                    for(int i = 0; i < list.length; i++)
                            element = list;
    #sql {
    insert
    into directory_list
    ( directory, filename )
    values
    ( :directory, :element )
    -- creating the PL/SQL wrapper for the java proc
    create or replace procedure ListFiles( cDirectory in varchar2, cFilter in varchar2 )
    as language java
    name 'ListFiles.getList( java.lang.String, java.lang.String )';
    -- punching a hole in the Java VM that allows access to the server's file
    -- systems from inside the Oracle JVM (these also allows executing command
    -- line and external programs)
    -- NOTE: this hole MUST be secured using proper Oracle security (e.g. AUTHID
    -- DEFINER PL/SQL code that is trusted)
    declare
    SCHEMA varchar2(30) := USER;
    begin
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.io.FilePermission',
    '<<ALL FILES>>',
    'execute, read, write, delete'
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.lang.RuntimePermission',
    'writeFileDescriptor',
    dbms_java.grant_permission(
    SCHEMA,
    'SYS:java.lang.RuntimePermission',
    'readFileDescriptor',
    commit;
    end;
    To use:
    SQL> exec ListFiles('/tmp', '*.log' );
    PL/SQL procedure successfully completed.
    SQL> select * from directory_list;
    DIRECTORY FILENAME
    /tmp X11_newfonts.log
    /tmp ipv6agt.crashlog
    /tmp dtappint.log
    /tmp Core.sd-log
    /tmp core_intg.sd-log
    /tmp da.sd-log
    /tmp dhcpclient.log
    /tmp oracle8.sd-log
    /tmp cc.sd-log
    /tmp oms.log
    /tmp OmniBack.sd-log
    /tmp DPISInstall.sd-log
    12 rows selected.
    SQL>

  • C000000* Folder in log archive directory

    Hi,
    We use db2 9,5 + ecc 6.0 in our landscape
    We see the folders C0000<number> created in the log_archive path and some log files inside this
    We wanted to know the following
    Is this folders created after particular size of log archive files in the directory
    Is this folders created after restart etc
    Please assist

    Hi Balaji,
    Yes, the C...number represents the log chains.
    Please see page 11 of the db admin guide:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50c7d3ef-5a59-2a10-a3ab-fb3b0887f479?quicklink=index&overridelayout=true
    The log chain with the highest number contains the active log files.
    For example:
    If we restore from backup and only go to a point in time, instead of all the way to the latest logs, in the old log file management, the subsequent logs, left over after the point in time we restored to would be dropped. But in new logfile management, they are kept as a generation of log files and the log file chain is increased and new logs then created under the new chain number.
    regards,
    Paul

  • FAQ: How do I find my install logs?

    Installation logs are very helpful for us in troubleshooting installation issues, if you're having installation issues, we'll likely ask you to provide the installer log to us.
    To find your installer logs, navigate to the following directories.
    Install Logs
    For Mac: (one of these two locations)
    /Library/Logs/Adobe/Installer
    /Users/<currentUser>/Library/Logs/Adobe/Installers/
    For Win\Program Files\Common Files\Adobe\Installer

    Hi,
    Your Home Folder/Library/Messages
    Access using Finder > Go Menu > Hold down ALT key > Select the Library that appears > Open Messages
    You will then need the Archive folder.
    11:01 PM      Sunday; September 9, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Unable to find moniker information for archive collection ArchiveCollection

    In attempting to setup archive transfer between PROD and DEV I needed to rename an existing outgoing provider and the only way I found I could do this is to delete the existing provider and recreate it with a new name. I think by doing this it has caused and issue and now the CS log displays an error similar to below:
    Unable to find moniker information for archive collection ArchiveCollections. The collection ecmprd2 has no information associated with it. It no longer exists in the system. [ Details ]
    An error has occurred. The stack trace below shows more information.
    !csMonikerUnableToFindArchiveInfo,ArchiveCollections!csArchiverCollectionNotFound,ecmprd2
    intradoc.data.DataException: !csArchiverCollectionNotFound,ecmprd2
         at intradoc.server.archive.ArchiveUtils.getCollection(ArchiveUtils.java:492)
         at intradoc.server.MonikerWatcher.parseMonikerInfo(MonikerWatcher.java:325)
         at intradoc.server.MonikerWatcher.computeMonikers(MonikerWatcher.java:248)
         at intradoc.server.MonikerWatcher.notifyWatched(MonikerWatcher.java:154)
         at intradoc.server.Service.notifyWatched(Service.java:710)
         at intradoc.server.Service.updateSubjectInformation(Service.java:670)
         at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1128)
         at intradoc.server.Service.executeActions(Service.java:433)
         at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:635)
         at intradoc.server.Service.doRequest(Service.java:1707)
         at intradoc.server.ServiceManager.processCommand(ServiceManager.java:359)
         at intradoc.server.IdcServerThread.run(IdcServerThread.java:197)
    Does anyone know if this is caused by deleting the existing outgoing provider and if it is how can I resolve it?
    Regards,
    Andrew

    I misspoke when I said to recreate the outgoing provider because an outgoing provider only provides the "connection" from DEV to PROD. What I meant is that if the provider is deleted and the automated archives are left alone, they would fail because that connection is gone. Since you recreated an outgoing provider (even with a different name), that connection should be there again.
    I highly doubt each archive "stores" the name of the outgoing provider in its configuration, so I doubt either of those options would work. The only thing that makes sense is that the collection is "gone" (ie. DEV cannot find 'ecmprd2') or the PROD collection isn't called 'ecmprd2' anymore. I'm assuming "ecmprd2" is the instance name of your PROD instance, right? If you can, try deleting all archives and see if the error exists afterwards.
    Why did you have to "rename" the provider to begin with?

  • How do I download the previous version of Firefox (3) as my system won't support Firefox 4 (can't find the older versions archives anywhere on your site).

    I already had Firefox version 2 on my mac (OS 10.4) and tried to upgrade to version 4. Couldn't find any details on system requirements, so just went ahead and tried to download latest version. By the time the process informed me that it wouldn't work on my system, the old version 2 had somehow been deleted. Now I have no Firefox browser at all and cannot find any older versions archived.

    I think you can run version 3.6:
    http://www.mozilla.com/firefox/all-older
    I just read today about a separately maintained, unofficial version of Firefox for 10.4 users called TenFourFox. They are somehow repackaging the latest Firefox to work on 10.4 (''on non-Intel Macs''). You might want to research it and see whether it makes sense for you: http://www.floodgap.com/software/tenfourfox/

  • How to find number of lines in an internal table

    Dear all,
    how to find number of records present in an internal table.

    DESCRIBE TABLE
    Syntax
    DESCRIBE TABLE itab [KIND knd] [LINES lin] [OCCURS n].
    Extras:
    1. ... KIND knd
    2. ... LINES lin
    3. ... OCCURS n
    Effect
    This statement determines some properties of the internal table itab and assigns them to the specified variables. The various additions enable you to determine the table type, the number of currently filled rows and the initial memory requirement.
    In addition, the system fields sy-tfill and sy-tleng are filled with the current number of table rows and the length of a table row in bytes.
    Notes
    For detailed information about an internal table, you should use the methods of RTTS of the DESCRIBE TABLE statement.
    Without the specification of an addition, the statement DESCRIBE TABLE only sets the system fields sy-tfill and sy-tleng.
    Addition 1
    ... KIND knd
    Effect
    The table type of the internal table itab is determined and a corresponding one-digit identification is assigned to the data object knd. A character-type data type is expected for the data object. The identifications are "T" for standard tables, "S" for sorted tables and "H" for hashed tables. These values are also defined as constants sydes_kind-standard, sydes_kind-sorted, and sydes_kind-hashed in the type group SYDES.
    Addition 2
    ... LINES lin
    Effect
    The current number of table rows of the internal table itab is determined and is assigned to the data object lin.The data type i is expected for the data object.
    Note
    As of release 6.10, the current number of rows of an internal table can also be determined using the in-built function lines.
    Addition 3
    ... OCCURS n
    Effect
    The initial memory requirement defined during the creation of the internal table with the addition INITIAL SIZE or the obsolete addition OCCURS is determined and assigned to the data object n. The data type i is expected for the data object.
    Example
    Descending sorting of a generically typed internal table in a subprogram. Since sorted tables cannot be sorted in a descending order, the table type is checked to avoid an exception that cannot be handled.
    TYPE-POOLS sydes.
    FORM sort_descending CHANGING itab TYPE ANY TABLE.
      DATA tabkind(1) TYPE c.
      DESCRIBE TABLE itab KIND tabkind.
      IF tabkind = sydes_kind-standard OR
         tabkind = sydes_kind-hashed.
        SORT itab DESCENDING.
      ELSEIF tabkind = sydes_kind-sorted.
        MESSAGE '...' TYPE 'E'.
      ELSE.
        MESSAGE '...' TYPE 'E'.
      ENDIF.
    ENDFORM.
    DESCRIBE FIELD INTO
    Note
    This statement is for internal use only.
    It cannot be used in application programs.
    Syntax
    DESCRIBE FIELD dobj INTO td.
    Effect
    All characteristics of the field f, its components , sub-components etc. are displayed in the field td (type description). td has to be of the type SYDES_DESC, defined in Type Group SYDES. Because of this, the type group SYDES must be integrated into the ABAP-program with a TYPE-POOLS statement .
    The structure SYDES_DESC has two table-type components TYPES and NAMES:
    In TYPES, the tree structure of the type belonging to f is displayed. The components of a node are stored in the table TYPES in a continuous manner. Beginning and end of the line area that represents the components are stored in TYPES-FROM and TYPES-TO. The reference to the superior node can be found in TYPES-BACK. If no superior resp. subordinate node exists, then this is marked by the value 0 (For the relevance of further components, refer to the following sections).
    The names of components, types etc. are not stored directly in TYPES. Instead, the components TYPES-IDX_... hold an index in the name table NAMES. The value 0 indicates that there is no reference to the name table.
    NAMES contains the possibly fragmented names in the component NAMES-NAME. If a name continues in the following line, this is indicated by an asterisk ('*') in the component NAMES-CONTINUE.
    The type description table (TYPES) not only stores information about the tree structure but also further information about the type of f resp. its components. This includes especially all information that can be determined using the usual additions to DESCRIBE FIELD. In detail, TYPES contains the following columns:
    IDX_NAME
    Component Name
    IDX_USER_TYPE
    Name of a user-defined type, i.e., a type that was defined through its TYPES-statement. Derived types (... TYPE A-B) and structures from the ABAP-Dictionary are not considered to be user-defined types.
    CONTEXT
    For user-defined types only: The context, in which the type is defined. Possible values are defined in the constant SYDES_CONTEXT of the type group SYDES. Please only use these constants to carry out a comparison. In detail, we distinguish between the following type contexts:
    SYDES_CONTEXT-PROGRAM: Program-global type
    SYDES_CONTEXT-FORM   : FORM-local type
    SYDES_CONTEXT-FUNCTION: FUNCTION-local type
    SYDES_CONTEXT-METHOD : METHOD-local type
    IDX_CONTEXT_NAME
    For user-defined types only:
    With a local context: The name of the FORM or FUNCTION, whose type was defined. The name of the associated program is then the first entry in the name table.
    With a global context: The name of the program in which the type was defined.
    IDX_EDIT_MASK
    Conversion routine from the ABAP-Dictionary, is in accordance with the addition EDIT MASK at simple DESCRIBE.
    IDX_HELP_ID
    Help-Id when referencing to fields from the ABAP-Dictionary
    LENGTH
    Internal length, corresponds to the addition LENGTH at simple DESCRIBE
    OUTPUT_LENGTH
    Output length, corresponds to the addition OUTPUT-LENGTH at simple DESCRIBE
    DECIMALS
    Number of decimal digits, corresponds to the addition DECIMALS at simple DESCRIBE
    TYPE
    ABAP-Type, corresponds to the addition TYPE at simple DESCRIBE
    TABLE_KIND
    A table type is stored here for the components which represent an internal table. The same values are returned as with the variant DESCRIBE TABLE itab KIND k. Components which do not represent a table get the return value set to SYDES_KIND-UNDEFINED (see type group SYDES).
    Example
    Example definition of the complex data type EMPLOYEE_STRUC:
    PROGRAM DESCTEST.
    TYPES: BEGIN OF name_struc,
             first  TYPE c LENGTH 20,
             last   TYPE c LENGTH 20,
           END OF name_struc,
           BEGIN OF absence_time_struc,
             day        TYPE d,
             from       TYPE t,
             to         TYPE t,
           END OF absence_time_struc,
           phone_number TYPE n LENGTH 20,
           BEGIN OF employee_struc,
             id         LIKE sbook-customid,
             name       TYPE name_struc,
             BEGIN OF address,
               street  TYPE c LENGTH 30,
               zipcode TYPE n LENGTH 4,
               place   TYPE c LENGTH 30,
             END OF address,
             salary_per_month TYPE p LENGTH 10 DECIMALS 3,
             absent           TYPE STANDARD TABLE OF absence_time_struc
                                   WITH NON-UNIQUE DEFAULT KEY,
             phone            TYPE STANDARD TABLE OF phone_number
                                   WITH NON-UNIQUE DEFAULT KEY,
           END OF employee_struc.
    You can determine the structure of the type EMPLOYEE_STRUC by collecting the type group SYDES as follows:
    TYPE-POOLS: sydes.
    DATA: employee TYPE employee_struc,
          td       TYPE sydes_desc.
    DESCRIBE FIELD employee INTO td.
    The following table shows a few selected columns of the type description table TD-TYPES. For a better overview, the names of the columns IDX_NAME, IDX_UERR_TYPE and IDX_EDIT_MASK have been shortened:
        |FROM| TO |BACK|NAME|UTYP|EMSK|TYPE
    |--||||||--
      1 |  2 |  7 |  0 |  0 |  2 |  0 |  v
      2 |  0 |  0 |  1 |  6 |  0 |  4 |  N
      3 |  8 |  9 |  1 |  7 |  5 |  0 |  u
      4 | 10 | 12 |  1 |  8 |  0 |  0 |  u
      5 |  0 |  0 |  1 |  9 |  0 |  0 |  P
      6 | 13 | 13 |  1 | 11 |  0 |  0 |  h
      7 | 17 | 17 |  1 | 12 |  0 |  0 |  h
      8 |  0 |  0 |  3 | 13 |  0 |  0 |  C
      9 |  0 |  0 |  3 | 14 |  0 |  0 |  C
    10 |  0 |  0 |  4 | 15 |  0 |  0 |  C
    11 |  0 |  0 |  4 | 16 |  0 |  0 |  N
    12 |  0 |  0 |  4 | 17 |  0 |  0 |  C
    13 | 14 | 16 |  6 |  0 | 18 |  0 |  u
    14 |  0 |  0 | 13 | 20 |  0 |  0 |  D
    15 |  0 |  0 | 13 | 21 |  0 |  0 |  T
    16 |  0 |  0 | 13 | 22 |  0 |  0 |  T
    17 |  0 |  0 |  7 |  0 |  0 |  0 |  N
    Please note that the entries in rows 6 and 7 represent internal tables (ABAP-Type h). There is always an entry for the corresponding row type (rows 13 and 17) to an internal table.
    The indices in the rows 5 to 7 refer to entries in the name table TD-NAMES. If you look, e.g., at row 3, you find the corresponding component name in TD-NAMES from row 7 (NAME) onward and the corresponding user type from row 5 (NAME_STRUC) onward.
    In the name table TD-NAMES you find the following entries. Note that the names SALARY_PER_MONTH and ABSENCE_TIME_STRUC are stored in two parts:
        |CONTINUE|NAME                   |CONTINUE|NAME
    |--|     -||--
      1 |        |DESCTEST            12 |        |PHONE
      2 |        |EMPLOYEE_STRUC      13 |        |FIRST
      3 |        |SBOOK-CUSTOMID      14 |        |LAST
      4 |        |==ALPHA             15 |        |STREET
      5 |        |NAME_STRUC          16 |        |ZIPCODE
      6 |        |ID                  17 |        |PLACE
      7 |        |NAME                18 |   *    |ABSENCE_TIME_ST
      8 |        |ADDRESS             19 |        |RUC
      9 |   *    |SALARY_PER_MONT     20 |        |DAY
    10 |        |H                   21 |        |FROM
    11 |        |ABSENT              22 |        |TO

  • How can i reduce the number of calls archived in recents

    How can i reduce the number of calls archived in recents

    You can't change that.  It's a function of the OS and cannot be altered.

  • The file structure online redo log, archived redo log and standby redo log

    I have read some Oracle documentation for file structure and settings in Data Guard environment. But I still have some doubts. What is the best file structure or settings in Oracle 10.2.0.4 on UNIX for a data guard environment with 4 primary databases and 4 physical standby databases. Based on Oracle documents, there are 3 redo logs. They are: online redo logs, archived redo logs and standby redo logs. The basic settings are:
    1. Online redo logs --- This redo log must be on Primary database and logical standby database. But it is not necessary to be on physical standby database because physical standby is not open. It doesn't generate redo log. However, if don't set up online redo log on physical standby, when primary failover and switch standby as primary. How can standby perform without online redo logs? In my standby databases, online redo logs have been set up.
    2. Archived redo logs --- It is obviously that primary database, logical and physical standby database all need to have this log file being set up. Primary use it to archive log files and ship to standby. Standby use it to receive data from archived log and apply to database.
    3. Standby redo logs --- In the document, it says A standby redo log is similar to an online redo log, except that a standby redo log is used to store redo data received from another database. A standby redo log is required if you want to implement: The maximum protection and maximum availability levels of data protection and Real-time apply as well as Cascaded destinations. So it seems that this standby redo log only should be set up on standby database, not on primary database. Am my understanding correct? Because I review current redo log settings on my environment, I have found that Standby redo log directory and files have been set up on both primary and standby databases. I would like to get more information and education from experts. What is the best setting or structure on primary and standby database?

    FZheng:
    Thanks for your input. It is clear that we need 3 type of redo logs on both databases. You answer my question.
    But I have another one. In oracle ducument, it says If you have configured a standby redo log on one or more standby databases in the configuration, ensure the size of the current standby redo log file on each standby database exactly matches the size of the current online redo log file on the primary database. It says: At log switch time, if there are no available standby redo log files that match the size of the new current online redo log file on the primary database. The primary database will shut down
    My current one data gurard envirnment setting is: On primary DB, online redo log group size is 512M and standby redo log group size is 500M. On the standby DB, online redo log group size is 500M and standby redo log group size is 750M.
    This was setup by someone I don't know. Is this setting OK? or I should change Standby Redo Log on standby DB to 512M to exactly meatch with redo log size on primary?
    Edited by: 853153 on Jun 22, 2011 9:42 AM

  • Find number of occurances of a particular character

    Hi,
    is there any keyword to determine number of times a particular character is present in the string,
    E.g. VAR1 = 'ghghj#ghjgjgh#ghjghjg#ghjg#'.
    I want to find number of occurances of # in VAR1.
    Regards,
    Raghavendra

    Hi,
           use folowing logic.
           data:begin 0f itab,
                    var1 type c,
                     var2 type c,
                     var3 type c,
                      var4 type c,
                  end of itab.
      split var1 at '#' into itab-var1 itab-var2 itab-var3 itab-var4.
        if not itab-var1 is initial.
            count = count + 1.
        endif.
           if not itab-var2is initial.
            count = count + 1.
        endif.
        if not itab-var3is initial.
            count = count + 1.
        endif.
        if not itab-var4is initial.
            count = count + 1.
        endif.
    write count.
    regards
    amole

  • To Find the user log off date

    Hello Gurus
          I need to find the user log off and log on details.Suppose if the user logs of today and Logs on tommmorow...Then I need to get both those log off and log on details.The log details can be found from USR02 table..Plz help me in finding out the log off date of the user..IThanks
    Ganesh
    Edited by: Ganesh Kumar on Mar 9, 2009 6:57 PM

    Explore SM19 and SM20 tcodes for your requirement.

Maybe you are looking for