FUNCTION zfm_get_auth_value.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" REFERENCE(OBJECT1) TYPE USR12-OBJCT DEFAULT 'ZBP_CHECK'
*" REFERENCE(USER) TYPE USR04-BNAME DEFAULT 'SY-UNAME'
*" EXPORTING
*" REFERENCE(EV_MESSAGE) TYPE STRING
*" REFERENCE(RT_RANGE) TYPE ZRANGES_T "ZRANGES_T参考的行类型是/IWFND/RANGES
*"----------------------------------------------------------------------
DATA ls_values TYPE us335.
DATA lt_values TYPE TABLE OF us335.
DATA rs_range TYPE /iwfnd/ranges.
CALL FUNCTION 'GET_AUTH_VALUES'
EXPORTING
object1 = object1
user = user
TABLES
values = lt_values
EXCEPTIONS
user_doesnt_exist = 1
OTHERS = 2
.
IF sy-subrc <> 0.
ev_message = '没有读取到权限对象值,清检查'.
ENDIF.
CLEAR RT_RANGE[].
LOOP AT lt_values INTO ls_values.
IF ls_values-lowval IS NOT INITIAL AND ls_values-highval IS NOT INITIAL.
rs_range-sign = 'I'.
rs_range-option = 'BT'.
rs_range-low = ls_values-lowval.
rs_range-high = ls_values-highval.
APPEND rs_range TO rt_range.
ELSEIF ls_values-lowval NA '*'AND ls_values-highval IS INITIAL."Ls_values-lowval IS NOT INITIAL AND
rs_range-sign = 'I'.
rs_range-option = 'EQ'.
rs_range-low = ls_values-lowval.
rs_range-high = ls_values-highval.
APPEND rs_range TO rt_range.
ELSEIF Ls_values-lowval CA '*'.
rs_range-sign = 'I'.
rs_range-option = 'CP'.
rs_range-low = ls_values-lowval.
rs_range-high = ls_values-highval.
APPEND rs_range TO rt_range.
ENDIF.
CLEAR Ls_values.
ENDLOOP.
ENDFUNCTION.
阅读(755) | 评论(0) | 转发(0) |