SM30 表视图维护工具
先要se55 创建一下,
在程序中可以使用以下function调用SM30.
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
ACTION = 'U'
* CORR_NUMBER = ' '
* GENERATE_MAINT_TOOL_IF_MISSING = ' '
* SHOW_SELECTION_POPUP = ' '
VIEW_NAME = 'ZLL_TEST'
* NO_WARNING_FOR_CLIENTINDEP = ' '
* RFC_DESTINATION_FOR_UPGRADE = ' '
* CLIENT_FOR_UPGRADE = ' '
* VARIANT_FOR_SELECTION = ' '
* COMPLEX_SELCONDS_USED = ' '
* TABLES
* DBA_SELLIST =
* EXCL_CUA_FUNCT =
* EXCEPTIONS
* CLIENT_REFERENCE = 1
* FOREIGN_LOCK = 2
* INVALID_ACTION = 3
* NO_CLIENTINDEPENDENT_AUTH = 4
* NO_DATABASE_FUNCTION = 5
* NO_EDITOR_FUNCTION = 6
* NO_SHOW_AUTH = 7
* NO_TVDIR_ENTRY = 8
* NO_UPD_AUTH = 9
* ONLY_SHOW_ALLOWED = 10
* SYSTEM_FAILURE = 11
* UNKNOWN_FIELD_IN_DBA_SELLIST = 12
* VIEW_NOT_FOUND = 13
* OTHERS = 14
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
function:VIEW_MAINTENANCE_CALL
功能:维护表视图等
The function module calls the extended table maintenance (View maintenance).
参数:
import:ACTION S = Display U = Change T = Transport
CORR_NUMBER 传送号(上面的action是t)
SHOW_SELECTION_POPUP 是否弹出选择画面
VIEW_NAME 视图名
NO_WARNING_FOR_CLIENTINDEP 跨集团是否现实警告
VARIANT_FOR_SELECTION 变式名
CHECK_DDIC_MAINFLAG 察看是否为可维护对象
其他的参数暂时没有用到
文章转自 http://blog.csdn.net/pely122/article/details/8125472
数据表维护是单纯的维护数据功能,要是给用户赋予权限的话只能用T-CODE LEVEL控制。
如果一个维护表里有 工厂,物料,物料名 (简单的举例子),
而我们要根据SAP ID来判断这个人有没有全校修改特定工厂的数据。
比如ABAP01用户只能修改1000工厂的数据。
ABAP02只能修改2000工厂的数据。
表如下:
这时候我们可以用 VIEW_MAINTENANCE_CALL 这个函数来实现这个功能。
首先生成一个程序 ZDEV005,然后在此程序里我们调用VIEW_MAINTENANCE_CALL 这个函数。
REPORT ZDEV005.
DATA:GT_VIMSELLIST TYPE TABLE OF VIMSELLIST WITH HEADER LINE.
DATA:GV_WERKS TYPE WERKS_D.
CASE SY-UNAME.
WHEN 'ABAP01'.
GV_WERKS = '1000'.
WHEN 'ABAP02'.
GV_WERKS = '2000'.
ENDCASE.
GT_VIMSELLIST-VIEWFIELD = 'WERKS'.
GT_VIMSELLIST-OPERATOR = 'EQ'.
GT_VIMSELLIST-VALUE = GV_WERKS.
APPEND GT_VIMSELLIST.
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
ACTION = 'U'
VIEW_NAME = 'ZDEV001T'
COMPLEX_SELCONDS_USED = 'X'
TABLES
DBA_SELLIST = GT_VIMSELLIST.
用ABAP01登陆的时候:
用ABAP02登陆的时候:
文章转自 http://blog.csdn.net/chbvb4302/article/details/4376838
前段时间需要做一个用户交互的程序,自己先创建一个表,然后调用 VIEW_MAINTENANCE_CALL 函数即可,
值的说明是用se11创建表时,需要将表se54生成对象才可以这样做。如图所示:
然后在se11程序中进行调用如下:
REPORT zmmtest.
"end-of-selection.
perform zview_maintance using '表名'.
*&---------------------------------------------------------------------*
*& FORM ZVIEW_MAINTANCE
*&---------------------------------------------------------------------*
" 维护自定义视图过程
*----------------------------------------------------------------------*
" -->p_VIEW_NAME TEXT
*----------------------------------------------------------------------*
form zview_maintance using p_view_name like dd02v-tabname.
call function 'VIEW_MAINTENANCE_CALL'
exporting
action = 'U'
view_name = p_view_name
exceptions
client_reference = 1
foreign_lock = 2
invalid_action = 3
no_clientindependent_auth = 4
no_database_function = 5
no_editor_function = 6
no_show_auth = 7
no_tvdir_entry = 8
no_upd_auth = 9
only_show_allowed = 10
system_failure = 11
unknown_field_in_dba_sellist = 12
view_not_found = 13
maintenance_prohibited = 14
others = 15.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform.