权限对象(可以通过SU21创建)保存在表tobj和tobjt(文本表)中。下面程序列出了所有权限对象,单击权限对象行能显示,单击空行弹出权限对象创建窗口。
代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
REPORT ZTEST_SU21. TABLES: tobj, tobjt. DATA: itvl type i. FORMAT COLOR 1. WRITE:/1 sy-vline, 3 'Object'(c01), 14 sy-vline, 16 'Description'(c02), 78 sy-vline, 80 'Class', 86 sy-vline. ULINE. itvl = 0. FORMAT INTENSIFIED OFF. SELECT * FROM tobj. IF itvl EQ 0. FORMAT COLOR 4. ELSE. FORMAT COLOR 2. ENDIF. SELECT SINGLE * FROM tobjt WHERE object = tobj-objct AND langu = sy-langu. WRITE:/1 sy-vline, 3 tobj-objct, 14 sy-vline, 16 tobjt-ttext, 78 sy-vline, 80 tobj-oclss, 86 sy-vline. HIDE: tobj-objct. itvl = 1 - itvl. ENDSELECT. ULINE. CLEAR tobj. AT LINE-SELECTION. IF tobj-objct EQ space. CALL FUNCTION 'SUSR_ADD_OBJECT' EXPORTING OBJECT = ' ' OCLASS = ' ' EU_MODE = ' ' * IMPORTING * OBJECT = * OCLASS = . ELSE. CALL FUNCTION 'SUSR_SHOW_OBJECT' EXPORTING object = tobj-objct eu_mode = 'X'. ENDIF. |
运行结果:
点击权限对象行,弹出显示窗口,
点击空行,则跳出创建权限对象窗口,
以上。
发表评论