ABAP查詢使用者出口程式

2021-06-20 07:56:30 字數 4270 閱讀 8321

**此程式原創出自哪已經忘了,不過不重要了,重要的是這個程式還挺好用,便於程式設計師查詢使用者的出口和增強,可以直接ctrl+c \ctrl+v拿來用。

report  z_test_001.

tables:tstc,tadir,modsapt,modact,trdir,tfdir,enlfdir,sxs_attrt,tstct.

data : jtab like tadir occurs 0 with header line.

data : field1(30).

data : v_devclass like tadir-devclass.

parameters : p_tcode like tstc-tcode,

p_pgmna like tstc-pgmna .

data wa_tadir type tadir.

start-of-selection.

if not p_tcode is initial.

select single * from tstc where tcode eq p_tcode.

elseif not p_pgmna is initial.

tstc-pgmna = p_pgmna.

endif.

if sy-subrc eq 0.

select single * from tadir

where pgmid = 'r3tr'

and object = 'prog'

and obj_name = tstc-pgmna.

move : tadir-devclass to v_devclass.

if sy-subrc ne 0.

select single * from trdir

where name = tstc-pgmna.

if trdir-subc eq 'f'.

select single * from tfdir

where pname = tstc-pgmna.

select single * from enlfdir

where funcname = tfdir-funcname.

select single * from tadir

where pgmid = 'r3tr'

and object = 'fugr'

and obj_name eq enlfdir-area.

move : tadir-devclass to v_devclass.

endif.

endif.

select * from tadir into table jtab where pgmid = 'r3tr' and

object in ('smod', 'sxsd') and

devclass = v_devclass.

select single * from tstct where sprsl eq sy-langu and

tcode eq p_tcode.

format color col_positive intensified off.

write:/(19) 'transaction code - ',

20(20) p_tcode,

45(50) tstct-ttext.

skip.

if not jtab is initial.

write:/(105) sy-uline.

format color col_heading intensified on.

sort jtab by object.

data : wf_txt(60) type c,

wf_smod type i ,

wf_badi type i ,

wf_object2(30) type c.

clear : wf_smod, wf_badi , wf_object2.

loop at jtab into wa_tadir.

at first.

format color col_heading intensified on.

write:/1 sy-vline,

2 'enhancement/ business add-in',

41 sy-vline ,

42 'description',

105 sy-vline.

write:/(105) sy-uline.

endat.

clear wf_txt.

at new object.

if wa_tadir-object = 'smod'.

wf_object2 = 'enhancement' .

elseif wa_tadir-object = 'sxsd'.

wf_object2 = ' business add-in'.

endif.

format color col_group intensified on.

write:/1 sy-vline,

2 wf_object2,

105 sy-vline.

endat.

case wa_tadir-object.

when 'smod'.

wf_smod = wf_smod + 1.

select single modtext into wf_txt

from modsapt

where sprsl = sy-langu

and name = wa_tadir-obj_name.

format color col_normal intensified off.

when 'sxsd'.

* for badis

wf_badi = wf_badi + 1 .

select single text into wf_txt

from sxs_attrt

where sprsl = sy-langu

and exit_name = wa_tadir-obj_name.

format color col_normal intensified on.

endcase.

write:/1 sy-vline,

2 wa_tadir-obj_name hotspot on,

41 sy-vline ,

42 wf_txt,

105 sy-vline.

at end of object.

write : /(105) sy-uline.

endat.

endloop.

write:/(105) sy-uline.

skip.

format color col_total intensified on.

write:/ 'no.of exits:' , wf_smod.

write:/ 'no.of badis:' , wf_badi.

else.

format color col_negative intensified on.

write:/(105) 'no userexits or badis exist'.

endif.

else.

format color col_negative intensified on.

write:/(105) 'transaction does not exist'.

endif.

at line-selection.

data : wf_object type tadir-object.

clear wf_object.

get cursor field field1.

check field1(8) eq 'wa_tadir'.

read table jtab with key obj_name = sy-lisel+1(20).

move jtab-object to wf_object.

case wf_object.

when 'smod'.

set parameter id 'mon' field sy-lisel+1(10).

call transaction 'smod' and skip first screen.

when 'sxsd'.

set parameter id 'exn' field sy-lisel+1(20).

call transaction 'se18' and skip first screen.

endcase.

sap 的使用者出口

使用者出口,根據我個人的理解,所謂出口就是執行sap標準程式 對應事務碼 其中的某些操作過程必需經過的地方 sap給空出來,但可以給使用者新增 或者實現 使用者也就是所謂的客戶了 合起來,就是客戶可以在其中某些sap預留下來的出口進行個性化的裝飾了 光這一點,我覺得sap做得非常的人性 化,把大眾化...

ABAP 如何實現查詢所有的使用者

背景 以下 實現了如何檢視所有使用者的 就是從usr01這個表中讀取使用者出來.report zjglchello.tables usr01.data fieldcat type slis t fieldcat alv with header line,layout type slis layout...

abap程式優化

程式的效率是每個程式設計師都應該重視的,無論是採用的哪一種語言進行開發.那麼,我們在寫abap程式時,怎樣的語句才能提高到效率呢,下面是我總結到的幾點 1 抽取資料時,避免使用select 盡量使用select a b into table itab這樣的語句。2 不要使用select.endsel...