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

ABAP Quick Tool to view last objects edited (Darren Moore)



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Transport and Upgrade | Транспорт и Обновления
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sat Mar 08, 2008 11:11 am    Post subject: ABAP Quick Tool to view last objects edited (Darren Moore) Reply with quote

Code:
report zedit2
       no standard page heading
       line-count 165
       message-id zz.
************************************************************************
* Program Name   : ZEDIT2
* Creation Date  : 03/02/2005
* Author         : Darren Moore ( [email protected] )
* Description    : Quick tool to pick last objs for edit
************************************************************************
* Modification Log
* SAP-ID      Date       Request#       Description
* dmoore2    02/28/2005               INITIAL VERSION
* notes: this is setup for 1152x864 resolution
*        add tcodes and table names to table:zobjnames
* zobjnames Definition:
* OBJNAME CHAR 30
* OBJTYPE CHAR 3
* example data:
*OBJNAME OBJTYPE
*BD87 TCD
*BKPF TAB
*BSEG TAB
************************************************************************
tables: d010sinf,
        e070,
        e07t,
        e071,
        tfdir,
        trdirt,
        tstct,
        zobjnames.

include <icon>.

ranges: sv_name for trdir-name,
        sv_unam for trdir-unam,
        sv_udat for trdir-udat.

*----------------------------------------------------------------------*
*  DATA                                                                *
*----------------------------------------------------------------------*
data: i_vimsellist like vimsellist occurs 0 with header line.

data: tab_name like dd02v-tabname.


data: view_name like dd02v-tabname.

data: begin of header occurs 1.
        include structure vimdesc.
data: end of header.

data: begin of namtab occurs 50.
        include structure vimnamtab.
data: end of namtab.
data: rangetab type table of vimsellist initial size 50
       with header line.
data: excl_cua_funct like vimexclfun occurs 0 with header line.
data: action(1).
data: begin of i_d010sinf occurs 0,
        prog type d010sinf-prog,
        r3state type d010sinf-r3state,
        subc type d010sinf-subc,
        udat type d010sinf-udat,
        utime type d010sinf-utime,
      end of i_d010sinf,
      begin of i_tables occurs 20,
        objname type zobjnames-objname,
        ddtext type as4text,
      end of i_tables,
      begin of i_codes occurs 20,
        objname type zobjnames-objname,
        ttext type ttext_stct,
      end of i_codes,
      begin of i_requests occurs 0,
        trkorr type e070-trkorr,
        as4user type e070-as4user,
        as4date type e070-as4date,
        as4time type e070-as4time,
        strkorr type e070-strkorr,
        as4text type e07t-as4text,
        trstatus type e070-trstatus,
      end of i_requests.

data: fun_name(9),
      desc(50),
      cursorfield(20),
      row1 type i,
      row2 type i,
      row3 type i,
      row4 type i.


start-of-selection.
  set pf-status '2000'.

  clear: sv_udat[].
  sv_udat-sign   = 'I'.
  sv_udat-option = 'BT'.
  sv_udat-low = sy-datum - 45.
  sv_udat-high = sy-datum.
  append sv_udat.

  clear: sv_unam[].
  sv_unam-sign   = 'I'.
  sv_unam-option = 'EQ'.
  sv_unam-low    = sy-uname.
  append sv_unam.

  perform get_data.

  sort i_d010sinf by udat descending utime descending.
  loop at i_d010sinf.
    if i_d010sinf-subc = 'I'
           and i_d010sinf-prog(1) = 'L'
           and i_d010sinf-prog+5(1) = 'U'. "function
      concatenate 'SAP' i_d010sinf-prog(5) into fun_name.

      select single * from tfdir
        where pname = fun_name
        and include = i_d010sinf-prog+6(2).
      if sy-subrc = 0.
        desc = tfdir-funcname.
      endif.
    else.
      select single * from trdirt
        where name = i_d010sinf-prog.
      if sy-subrc = 0.
        desc = trdirt-text.
      endif.
    endif.
    if i_d010sinf-prog(1) = 'L'.
      format intensified on.
    else.
      format intensified off.
    endif.
    if i_d010sinf-r3state = 'A' and i_d010sinf-subc = '1'.
      write: / icon_execute_object as icon hotspot.
    else.
      write: / icon_not_equal as icon.
    endif.
    write:  i_d010sinf-prog(24) hotspot, desc hotspot.
    hide i_d010sinf-prog.
    position 80. write: sy-vline.
  endloop.

* Output table names
  sort i_tables by objname.
  loop at i_tables.
    row1 = sy-tabix.
    skip to line row1.
    position 82. write: icon_list as icon hotspot.
    position 85. write: i_tables-objname hotspot.
    position 98. write: i_tables-ddtext(25) hotspot.
    hide  i_tables-objname.
  endloop.

* Output tran codes
  sort i_codes by objname.
  loop at i_codes.
    row2 = sy-tabix.
    skip to line row2.

    position 123. write: sy-vline.
*    POSITION 125. WRITE: icon_flight AS ICON HOTSPOT.
    position 125. write: i_codes-objname hotspot.
    position 137. write: i_codes-ttext hotspot.
    hide  i_codes-objname.
  endloop.

* Output Change Requests
  if row1 > row2.
    row3 = row1 + 1.
  else.
    row3 = row2 + 1.
  endif.
  sort i_requests by as4date descending as4time descending.
  loop at i_requests where trstatus <> 'R'.
    row3 =  row3 + 1.
    skip to line row3.
    position 82. write: icon_transport as icon hotspot.
    position 85. write: i_requests-trkorr hotspot.
    position 98. write: i_requests-as4text hotspot.
    hide i_requests-trkorr.
  endloop.

at user-command.
  case sy-ucomm.
*    WHEN 'SE38'.
    when 'CHOOSE'.
      get cursor field cursorfield.

      if cursorfield = 'ICON_EXECUTE_OBJECT'
              and i_d010sinf-r3state = 'A'.
        if i_d010sinf-subc = '1' or i_d010sinf-subc = 'I'.
          submit (i_d010sinf-prog) and return.
        endif.
      elseif cursorfield = 'I_D010SINF-PROG'
           or cursorfield = 'DESC'.
        call function 'EDITOR_PROGRAM'
             exporting
                  program = i_d010sinf-prog
             exceptions
                  others  = 2.
      elseif cursorfield = 'ICON_LIST'.

*      if dd02-mainflag = 'X'.

* fill header info
        refresh: namtab,header,rangetab.
        clear:   namtab,header,rangetab.
        action  = 'U'. "modify
        call function 'VIEW_GET_DDIC_INFO'
             exporting
                  viewname              = i_tables-objname
                  variant_for_selection = ' '
             tables
                  x_header              = header
                  x_namtab              = namtab
                  sellist               = rangetab
             exceptions
                  no_tvdir_entry        = 3
                  table_not_found       = 5.
*  check sy-subrc = 0.


* display table
        call function 'VIEW_MAINTENANCE'
             exporting
                  view_name            = view_name
                  view_action          = action
             tables
                  x_header             = header
                  x_namtab             = namtab
                  dba_sellist          = i_vimsellist
                  excl_cua_funct       = excl_cua_funct
             exceptions
                  no_database_function = 2
                  no_editor_function   = 3
                  missing_corr_number  = 4.
        if sy-subrc ne 0.
*      else.
          call function 'RS_TABLE_LIST_CREATE'
               exporting
                    table_name = i_tables-objname
                    action     = 'ANZE'.

          if sy-subrc <> 0.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          endif.
        endif.
      elseif cursorfield = 'I_TABLES-OBJNAME' or
             cursorfield = 'I_TABLES-DDTEXT'.

        call function 'RS_DD_SHOW'
             exporting
                  objname = i_tables-objname
                  objtype = 'T'
             exceptions
                  others  = 1.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                  with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.
      elseif cursorfield = 'ICON_FLIGHT' or
              cursorfield = 'I_CODES-OBJNAME' or
              cursorfield = 'I_CODES-TTEXT'.
        call transaction  i_codes-objname. "AND SKIP FIRST SCREEN.

      elseif cursorfield = 'ICON_TRANSPORT'  or
               cursorfield = 'I_REQUESTS-TRKORR' or
               cursorfield = 'I_REQUESTS-AS4TEXT'."
        call function 'TR_PRESENT_REQUEST'
             exporting
                  iv_trkorr = i_requests-trkorr.
      endif.
    when 'CANC' or 'BACK' or 'EXIT'.
      leave list-processing." and return.
    when others.

  endcase.

*&---------------------------------------------------------------------*
*&      Form  get_data
*&---------------------------------------------------------------------*
form get_data.

* get program info
  select prog
         r3state
         subc
         udat
         utime
      from d010sinf
      into table i_d010sinf
      where unam   in sv_unam
      and   udat   in sv_udat.

* get common tables
  select zobjnames~objname
         dd02t~ddtext
     into table i_tables
     from ( zobjnames
     inner join dd02t
       on zobjnames~objname = dd02t~tabname )
     where zobjnames~objtype = 'TAB'
     and dd02t~ddlanguage = sy-langu.

* get common tcodes
  select zobjnames~objname
         tstct~ttext
     into table i_codes
     from ( zobjnames
     inner join tstct
       on zobjnames~objname = tstct~tcode )
     where zobjnames~objtype = 'TCD'
     and tstct~sprsl = sy-langu.

* get open change requests
  select e070~trkorr
         e070~as4user
         e070~as4date
         e070~as4time
         e070~strkorr
         e07t~as4text
         e070~trstatus
      into table i_requests
    from ( e070
         inner join e07t
         on  e07t~trkorr = e070~trkorr )
        where e070~strkorr eq ''
        and   e070~trfunction ne 'Q'
        and   e070~trfunction ne 'W'
        and   e070~as4user = sy-uname.

endform.                    " get_data
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 -> Transport and Upgrade | Транспорт и Обновления 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.