Posted: Sat Mar 08, 2008 11:11 am Post subject: ABAP Quick Tool to view last objects edited (Darren Moore)
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.
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 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.
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.