SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Example: Get status window information



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Mon Feb 25, 2008 1:41 pm    Post subject: Example: Get status window information Reply with quote

Code:
report zexp_show_status no standard page heading.title
***********************************************************
* Example: Get status window information
*
*   This is freeware. Please read the terms of use.
*   Written by Urs Rohner, Rohner IT Consulting & Engineering
*
*   Contact Author: Urs Rohner
***********************************************************

* Type declarations
  types:
    " status info
    begin of to_stats,
      sap_release(10)      type c,
      machinetype(10)      type c,
      system_id(10)        type c,
      database_host(8)     type c, " sy-host
      database_owner(10)   type c,
      codepage(4)          type c,
      database_text(20)    type c,
      database_release(10) type c,
      servername(20)       type c,
      kernel_version(10)   type c,
      kernel_release(10)   type c,
      license_number(10)   type c,
      expiration_date(8)   type c,
    " db                   type dbrelinfo, " > 4.5B
    end of to_stats.



* Method: m_get_status
* Read status screen values
  define m_get_status>.
    perform m_get_status using &1.
  end-of-definition.

  form m_get_status using s_ type to_stats.
    define m_get_status_val>.
      read table _v[] into _v index &1.
      &2 = _v-val.
    end-of-definition.

    constants:
      " stuff from TSKHINCL
      _o type x value 1,
      _a type x value 0,   " installation number
      _e type x value 1,   " exp. date
      _w type x value 255. " all services
    data:
      begin of _v occurs 1,
        nam(21) type c,
        val(59) type c,
      end of _v,
      _x,
      _s     like msxxlist occurs 1 with header line.

    clear s_.
    " read stuff from kernel
    call 'SAPCORE'
      id 'ID'     field 'VERSION'
      id 'TABLE'  field _v-*sys*.
    if sy-subrc is initial.
      m_get_status_val>:
        1 s_-sap_release,
        3 s_-machinetype,
        5 s_-system_id,
        8 s_-database_host,
        9 s_-database_owner,
        12 s_-kernel_version,
        15 s_-kernel_release.
      call 'ThSysInfo'
        id 'OPCODE' field _o
        id 'TAB'    field _s-*sys*
        id 'TYPES'  field _w.
      if sy-subrc is initial.
        read table _s[] into _s with key host = sy-host.
        s_-servername = _s-name.
        call 'C_SAPGPARAM'
          id 'NAME'  field 'install/codepage/appl_server'
          id 'VALUE' field s_-codepage.
        if sy-subrc is initial.
          call 'DB_GET_REL'
            id 'DBRELEASE' field s_-database_release.
          if sy-subrc is initial.
            if sy-dbsys eq 'DB400'.
              s_-database_text = 'Library'."#EC NOTEXT
            else.
              s_-database_text = 'Owner'."#EC NOTEXT
            endif.
            call 'GET_ACCESS_INFO'
              id 'CODE'    field _a
              id 'LICENSE' field s_-license_number.
            if sy-subrc is initial.
              call  'GET_ACCESS_INFO'
                id 'CODE'               field _e
                id 'LICENSE_EXPIRATION' field s_-expiration_date.
              if sy-subrc is initial.
              " exists after 4.5B
              " call 'C_DB_FUNCTION'
              "    id 'FUNCTION'     field 'DB_DBINFO'
              "    id 'DBMS'         field s_-db-dbsys
              "    id 'DB_SRVREL'    field s_-db-srvrel
              "    id 'DB_CLIREL'    field s_-db-clirel
              "    id 'DB_CHARSET'   field s_-db-charset
              "    id 'DBSL_VERS'    field s_-db-dbsl_vers
              "    id 'DB_RELINFO'   field s_-db-supp_rel
              "    id 'DBSL_PATCHES' field s_-db-patches.
                if sy-subrc is initial.
                  _x = 'X'.
                endif.
              endif.
            endif.
          endif.
        endif.
      endif.
    endif.
    if _x is initial.
      clear s_.
    endif.
  endform.


*
* P A I ( )
*
  data _s type to_stats.


  start-of-selection.
    m_get_status> _s.
    if not _s is initial.
      " have a look at variable _s.
      break-point.
    endif.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.