本文主要是介绍BW/BPS Authority Where-Used List,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
BW/BPS权限管理用的到,用户、权限、组织、表单各种正查反查。
ECC的拿去改改也能用。
*&---------------------------------------------------------------------*
*& Report ZUSER_AUTH
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZUSER_AUTH.
TABLES : AGR_USERS , USER_ADDR ,AGR_1251,AGR_TEXTS,RSECVAL..
TYPE-POOLS: slis.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv.
DATA: i_layout TYPE slis_layout_alv.
DATA: I_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA GT_USERROLE LIKE TABLE OF AGR_USERS WITH HEADER LINE.
DATA GT_USERNAME LIKE TABLE OF USER_ADDR WITH HEADER LINE.
DATA GT_ROLES LIKE TABLE OF AGR_TEXTS WITH HEADER LINE.
DATA GT_1251 LIKE TABLE OF AGR_1251 WITH HEADER LINE.
DATA GT_FORMS LIKE TABLE OF UPB_PS_NAME_T WITH HEADER LINE.
DATA GT_QUERYS LIKE TABLE OF RSZELTTXT WITH HEADER LINE.
DATA GT_QUERYS_TMP LIKE TABLE OF RSRREPDIR WITH HEADER LINE.
DATA GT_TCDS LIKE TABLE OF TSTCT WITH HEADER LINE.
DATA GT_RSECVAL LIKE TABLE OF RSECVAL WITH HEADER LINE.
DATA GT_RSECTXT LIKE TABLE OF RSECTXT WITH HEADER LINE.
DATA GT_RSDIOBJT LIKE TABLE OF RSDIOBJT WITH HEADER LINE.
DATA BEGIN OF R_FORMS OCCURS 0.
DATA NAME LIKE UPB_PS_NAME_T-NAME.
DATA END OF R_FORMS.
DATA BEGIN OF R_QUERYS OCCURS 0.
DATA COMPID LIKE RSRREPDIR-COMPID.
DATA END OF R_QUERYS.
DATA BEGIN OF R_TCDS OCCURS 0.
DATA TCODE LIKE TSTCT-TCODE.
DATA END OF R_TCDS.
DATA BEGIN OF R_ANA OCCURS 0.
DATA TCTAUTH LIKE RSECVAL-TCTAUTH.
DATA END OF R_ANA.
DATA: BEGIN OF GT_ALV OCCURS 0.
INCLUDE STRUCTURE GT_1251.
DATA BNAME LIKE USER_ADDR-BNAME.
DATA NAME_LAST LIKE USER_ADDR-NAME_LAST.
DATA TEXT LIKE AGR_TEXTS-TEXT.
DATA AUTH_TEXT_LOW(40) TYPE C.
DATA AUTH_TEXT_HIGH(40) TYPE C.
DATA TCTIOBJNM TYPE RSIOBJNM.
DATA TCTSIGN TYPE RALDB_SIGN.
DATA TCTOPTION TYPE RSZ_OPERATOR.
DATA TCTLOW TYPE RSCHAVL.
DATA TCTHIGH TYPE RSCHAVL.
DATA TXTSH TYPE RSDIOBJT-TXTSH.
DATA END OF GT_ALV.
SELECTION-SCREEN BEGIN OF BLOCK blk01 WITH FRAME TITLE TEXT-001.
PARAMETERS P_USER TYPE C RADIOBUTTON GROUP R0.
SELECT-OPTIONS:S_BNAME FOR USER_ADDR-BNAME.
PARAMETERS P_AUTH TYPE C RADIOBUTTON GROUP R0 DEFAULT 'X'.
SELECT-OPTIONS: S_ROLE FOR AGR_TEXTS-AGR_NAME ."DEFAULT 'Z*'.
SELECT-OPTIONS: S_LOW FOR AGR_1251-LOW ."DEFAULT 'Z*'.
PARAMETERS P_LANG LIKE AGR_TEXTS-SPRAS OBLIGATORY DEFAULT SY-LANGU.
SELECTION-SCREEN END OF BLOCK blk01.
SELECTION-SCREEN BEGIN OF BLOCK blk02 WITH FRAME TITLE TEXT-002.
PARAMETERS P0 TYPE C RADIOBUTTON GROUP R1 DEFAULT 'X'."ALL
PARAMETERS P1 TYPE C RADIOBUTTON GROUP R1 ."QUERY
PARAMETERS P2 TYPE C RADIOBUTTON GROUP R1 ."FORM
PARAMETERS P3 TYPE C RADIOBUTTON GROUP R1 ."TCODE
PARAMETERS P4 TYPE C RADIOBUTTON GROUP R1 ."Analysis
PARAMETERS P5 TYPE C RADIOBUTTON GROUP R1 ."HR COMP
SELECT-OPTIONS P_OBJ FOR AGR_1251-OBJECT NO-DISPLAY.
SELECT-OPTIONS P_FLD FOR AGR_1251-FIELD NO-DISPLAY.
PARAMETERS P4_DTL TYPE C AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK blk02.
AT SELECTION-SCREEN.
PERFORM CHECK_VAR.
START-OF-SELECTION.
IF P_USER EQ 'X'.
PERFORM GET_USER_AUTH.
IF GT_USERROLE[] IS INITIAL.
MESSAGE 'NO-DATA' TYPE 'S' .
EXIT.
ENDIF.
ENDIF.
PERFORM INITIAL_VAR.
PERFORM select_data.
PERFORM PROCESS_DATA.
PERFORM show_data.
FORM INITIAL_VAR .
IF P1 = 'X'.
P_OBJ-LOW = 'S_RS_COMP'.
P_FLD-LOW = 'RSZCOMPID'.
ENDIF.
IF P2 = 'X'.
P_OBJ-LOW = 'R_PM_NAME'.
P_FLD-LOW = 'PM_NAME'.
ENDIF.
IF P3 = 'X'.
P_OBJ-LOW = 'S_TCODE'.
P_FLD-LOW = 'TCD'.
ENDIF.
IF P4 = 'X'.
P_OBJ-LOW = 'S_RS_AUTH'.
P_FLD-LOW = 'BIAUTH'.
ENDIF.
IF P5 = 'X'.
P_OBJ-LOW = 'ZBUKRS'.
P_FLD-LOW = 'ZCOMP_CODE'.
ENDIF.
IF P_OBJ-LOW NE ''.
P_OBJ-SIGN = 'I'.
P_OBJ-OPTION = 'EQ'.
APPEND P_OBJ.
P_FLD-SIGN = 'I'.
P_FLD-OPTION = 'EQ'.
APPEND P_FLD.
ENDIF.
ENDFORM. " INITIAL_VAR
FORM select_data .
IF P_USER EQ 'X'.
SELECT * INTO TABLE GT_ROLES FROM AGR_TEXTS
FOR ALL ENTRIES IN GT_USERROLE
WHERE AGR_NAME = GT_USERROLE-AGR_NAME
AND AGR_NAME LIKE 'Z%'
AND AGR_NAME IN S_ROLE
AND SPRAS EQ P_LANG.
SELECT * INTO TABLE GT_1251 FROM AGR_1251
FOR ALL ENTRIES IN GT_USERROLE
WHERE AGR_NAME = GT_USERROLE-AGR_NAME
AND AGR_NAME LIKE 'Z%'
AND AGR_NAME IN S_ROLE
AND OBJECT IN
('R_PM_NAME','S_RS_AUTH','S_RS_COMP','S_RS_ICUBE','S_RS_ICUBE','S_TCODE','ZBUKRS')
AND OBJECT IN P_OBJ
AND FIELD IN
('PM_NAME','BIAUTH','RSZCOMPID','TCD','ZCOMP_CODE')
AND FIELD IN P_FLD
AND LOW IN S_LOW.
ELSE.
SELECT * INTO TABLE GT_ROLES FROM AGR_TEXTS
WHERE AGR_NAME LIKE 'Z%'
AND AGR_NAME IN S_ROLE
AND SPRAS EQ P_LANG.
SELECT * INTO TABLE GT_1251 FROM AGR_1251
WHERE AGR_NAME LIKE 'Z%'
AND AGR_NAME IN S_ROLE
AND OBJECT IN
('R_PM_NAME','S_RS_AUTH','S_RS_COMP','S_RS_ICUBE','S_RS_ICUBE','S_TCODE','ZBUKRS')
AND OBJECT IN P_OBJ
AND FIELD IN
('PM_NAME','BIAUTH','RSZCOMPID','TCD','ZCOMP_CODE')
AND FIELD IN P_FLD
AND LOW IN S_LOW.
ENDIF.
IF GT_1251[] IS NOT INITIAL.
LOOP AT GT_1251 .
IF GT_1251-FIELD = 'PM_NAME'.
R_FORMS-NAME = GT_1251-LOW.
APPEND R_FORMS.
CLEAR R_FORMS.
IF GT_1251-HIGH NE ''.
R_FORMS-NAME = GT_1251-HIGH.
APPEND R_FORMS.
CLEAR R_FORMS.
ENDIF.
ENDIF.
IF GT_1251-FIELD = 'RSZCOMPID'.
R_QUERYS-COMPID = GT_1251-LOW.
APPEND R_QUERYS.
CLEAR R_QUERYS.
ENDIF.
IF GT_1251-FIELD = 'TCD'.
R_TCDS-TCODE = GT_1251-LOW.
APPEND R_TCDS.
CLEAR R_TCDS.
ENDIF.
IF GT_1251-FIELD = 'BIAUTH'.
R_ANA-TCTAUTH = GT_1251-LOW.
APPEND R_ANA.
CLEAR R_ANA.
ENDIF.
ENDLOOP.
ENDIF.
IF R_FORMS[] IS NOT INITIAL.
SELECT * INTO TABLE GT_FORMS FROM UPB_PS_NAME_T
FOR ALL ENTRIES IN R_FORMS
WHERE PTYPE = 'UPS'
AND LANG = P_LANG
AND NAME = R_FORMS-NAME.
ENDIF.
IF R_QUERYS[] IS NOT INITIAL.
SELECT * INTO TABLE GT_QUERYS_TMP FROM RSRREPDIR
FOR ALL ENTRIES IN R_QUERYS
WHERE COMPID = R_QUERYS-COMPID
AND OBJVERS = 'A'.
ENDIF.
IF GT_QUERYS_TMP[] IS NOT INITIAL.
SELECT * INTO TABLE GT_QUERYS FROM RSZELTTXT
FOR ALL ENTRIES IN GT_QUERYS_TMP
WHERE ELTUID = GT_QUERYS_TMP-COMPUID
AND OBJVERS = 'A'
AND LANGU = P_LANG.
ENDIF.
IF R_TCDS[] IS NOT INITIAL.
SELECT * INTO TABLE GT_TCDS FROM TSTCT
FOR ALL ENTRIES IN R_TCDS
WHERE TCODE = R_TCDS-TCODE
AND SPRSL = P_LANG.
ENDIF.
IF R_ANA[] IS NOT INITIAL.
SELECT * INTO TABLE GT_RSECVAL FROM RSECVAL
FOR ALL ENTRIES IN R_ANA
WHERE TCTAUTH = R_ANA-TCTAUTH.
SELECT * INTO TABLE GT_RSECTXT FROM RSECTXT
FOR ALL ENTRIES IN R_ANA
WHERE TCTAUTH = R_ANA-TCTAUTH
AND TCTLANGU = P_LANG.
ENDIF.
IF GT_RSECVAL[] IS NOT INITIAL.
SELECT * INTO TABLE GT_RSDIOBJT FROM RSDIOBJT
FOR ALL ENTRIES IN GT_RSECVAL
WHERE IOBJNM = GT_RSECVAL-TCTIOBJNM
AND LANGU = P_LANG.
ENDIF.
ENDFORM.
FORM process_data.
SORT GT_ROLES BY AGR_NAME.
SORT GT_FORMS BY NAME.
SORT GT_QUERYS_TMP BY COMPID.
SORT GT_QUERYS BY ELTUID.
SORT GT_TCDS BY TCODE.
SORT GT_RSECTXT BY TCTAUTH.
SORT GT_RSDIOBJT BY IOBJNM.
SORT GT_USERNAME BY BNAME.
SORT GT_USERROLE BY UNAME AGR_NAME.
IF P_USER EQ 'X'.
LOOP AT GT_USERROLE.
LOOP AT GT_1251 WHERE AGR_NAME EQ GT_USERROLE-AGR_NAME.
MOVE GT_1251 TO GT_ALV .
GT_ALV-BNAME = GT_USERROLE-UNAME.
READ TABLE GT_USERNAME WITH KEY BNAME = GT_ALV-BNAME BINARY SEARCH.
IF SY-SUBRC EQ 0.
GT_ALV-NAME_LAST = GT_USERNAME-NAME_LAST.
ENDIF.
READ TABLE GT_ROLES WITH KEY AGR_NAME = GT_ALV-AGR_NAME BINARY SEARCH.
IF SY-SUBRC = 0.
GT_ALV-TEXT = GT_ROLES-TEXT.
ENDIF.
CASE GT_1251-FIELD.
WHEN 'PM_NAME'.
READ TABLE GT_FORMS WITH KEY NAME = GT_1251-LOW BINARY SEARCH .
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_LOW = GT_FORMS-TEXT.
ENDIF.
IF GT_1251-HIGH NE ''.
READ TABLE GT_FORMS WITH KEY NAME = GT_1251-HIGH BINARY SEARCH .
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_HIGH = GT_FORMS-TEXT.
ENDIF.
ENDIF.
GT_ALV-FIELD = 'FOLDER'.
APPEND GT_ALV.
WHEN 'RSZCOMPID'.
READ TABLE GT_QUERYS_TMP WITH KEY COMPID = GT_1251-LOW BINARY SEARCH .
IF SY-SUBRC = 0.
READ TABLE GT_QUERYS WITH KEY ELTUID = GT_QUERYS_TMP-COMPUID BINARY SEARCH.
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_LOW = GT_QUERYS-TXTLG.
ENDIF.
ENDIF.
GT_ALV-FIELD = 'REPORT'.
APPEND GT_ALV.
WHEN 'TCD'.
READ TABLE GT_TCDS WITH KEY TCODE = GT_1251-LOW BINARY SEARCH .
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_LOW = GT_TCDS-TTEXT.
ENDIF.
GT_ALV-FIELD = 'T-CODE'.
APPEND GT_ALV.
WHEN 'BIAUTH'.
READ TABLE GT_RSECTXT WITH KEY TCTAUTH = GT_1251-LOW BINARY SEARCH .
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_LOW = GT_RSECTXT-TCTTXTSH.
ENDIF.
GT_ALV-FIELD = 'ORGAUTH'.
IF P4_DTL EQ 'X' AND GT_1251-LOW NE '0BI_ALL'.
LOOP AT GT_RSECVAL WHERE TCTAUTH = GT_1251-LOW.
MOVE-CORRESPONDING GT_RSECVAL TO GT_ALV.
CLEAR GT_ALV-TXTSH.
READ TABLE GT_RSDIOBJT WITH KEY IOBJNM = GT_RSECVAL-TCTIOBJNM BINARY SEARCH.
IF SY-SUBRC = 0.
GT_ALV-TXTSH = GT_RSDIOBJT-TXTSH.
ENDIF.
APPEND GT_ALV.
ENDLOOP.
ELSE.
APPEND GT_ALV.
ENDIF.
WHEN OTHERS.
APPEND GT_ALV.
ENDCASE.
ENDLOOP.
ENDLOOP.
ELSE.
LOOP AT GT_1251.
MOVE GT_1251 TO GT_ALV .
READ TABLE GT_ROLES WITH KEY AGR_NAME = GT_ALV-AGR_NAME BINARY SEARCH.
IF SY-SUBRC = 0.
GT_ALV-TEXT = GT_ROLES-TEXT.
ENDIF.
CASE GT_1251-FIELD.
WHEN 'PM_NAME'.
READ TABLE GT_FORMS WITH KEY NAME = GT_1251-LOW BINARY SEARCH .
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_LOW = GT_FORMS-TEXT.
ENDIF.
IF GT_1251-HIGH NE ''.
READ TABLE GT_FORMS WITH KEY NAME = GT_1251-HIGH BINARY SEARCH .
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_HIGH = GT_FORMS-TEXT.
ENDIF.
ENDIF.
GT_ALV-FIELD = 'FOLDER'.
APPEND GT_ALV.
WHEN 'RSZCOMPID'.
READ TABLE GT_QUERYS_TMP WITH KEY COMPID = GT_1251-LOW BINARY SEARCH .
IF SY-SUBRC = 0.
READ TABLE GT_QUERYS WITH KEY ELTUID = GT_QUERYS_TMP-COMPUID BINARY SEARCH.
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_LOW = GT_QUERYS-TXTLG.
ENDIF.
ENDIF.
GT_ALV-FIELD = 'REPORT'.
APPEND GT_ALV.
WHEN 'TCD'.
READ TABLE GT_TCDS WITH KEY TCODE = GT_1251-LOW BINARY SEARCH .
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_LOW = GT_TCDS-TTEXT.
ENDIF.
GT_ALV-FIELD = 'T-CODE'.
APPEND GT_ALV.
WHEN 'BIAUTH'.
READ TABLE GT_RSECTXT WITH KEY TCTAUTH = GT_1251-LOW BINARY SEARCH .
IF SY-SUBRC = 0.
GT_ALV-AUTH_TEXT_LOW = GT_RSECTXT-TCTTXTSH.
ENDIF.
GT_ALV-FIELD = 'ORGAUTH'.
IF P4_DTL EQ 'X' AND GT_1251-LOW NE '0BI_ALL'.
LOOP AT GT_RSECVAL WHERE TCTAUTH = GT_1251-LOW.
MOVE-CORRESPONDING GT_RSECVAL TO GT_ALV.
CLEAR GT_ALV-TXTSH.
READ TABLE GT_RSDIOBJT WITH KEY IOBJNM = GT_RSECVAL-TCTIOBJNM BINARY SEARCH.
IF SY-SUBRC = 0.
GT_ALV-TXTSH = GT_RSDIOBJT-TXTSH.
ENDIF.
APPEND GT_ALV.
ENDLOOP.
ELSE.
APPEND GT_ALV.
ENDIF.
WHEN OTHERS.
APPEND GT_ALV.
ENDCASE.
ENDLOOP.
ENDIF.
ENDFORM .
FORM show_data .
PERFORM build_fieldcat.
PERFORM build_layout.
PERFORM build_sort.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'FRM_USER_COMMAND'
is_layout = i_layout
it_fieldcat = it_fieldcat
IT_SORT = I_SORT
TABLES
t_outtab = GT_ALV[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
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.
FORM build_layout .
i_layout-zebra = 'X'.
i_layout-colwidth_optimize = 'X'.
i_layout-detail_popup = 'X'.
i_layout-detail_initial_lines = 'X'.
ENDFORM.
FORM build_fieldcat .
IF P_USER = 'X'.
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING '' '' 'BNAME' 'User' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING '' '' 'NAME_LAST' 'User_Name' '' 'L' .
ENDIF.
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING 'AGR_TEXTS' '' 'AGR_NAME' 'Role_Name' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING 'AGR_TEXTS' '' 'TEXT' 'Role_Text' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING 'AGR_1251' '' 'FIELD' 'Auth_Type' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING 'AGR_1251' '' 'LOW' 'Auth_From' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING 'RSZELTTXT' 'TXTLG' 'AUTH_TEXT_LOW' 'Auth_From_Text' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING 'AGR_1251' '' 'HIGH' 'Auth_To' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING 'RSZELTTXT' 'TXTLG' 'AUTH_TEXT_HIGH' 'Auth_To_Text' '' 'L' .
*PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING '' 'OBJECT' 'OBJECT' '' 'L' .
*PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING '' 'AUTH' 'AUTH' '' 'L' .
*PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING '' 'VARIANT' 'VARIANT' '' 'L' .
IF P4_DTL EQ 'X'.
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING 'RSDIOBJT' 'IOBJNM' 'TCTIOBJNM' 'InfoObj' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING 'RSDIOBJT' 'TXTSH' 'TXTSH' 'Obj_Text' '' 'L' .
*PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING '' 'TCTSIGN' 'SIGN' '' 'L' .
*PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING '' 'TCTOPTION' 'OPTION' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING '' '' 'TCTLOW' 'Org_From' '' 'L' .
PERFORM sub_fill_fieldcat_alv TABLES it_fieldcat USING '' '' 'TCTHIGH' 'Org_To' '' 'L' .
ENDIF.
ENDFORM.
FORM sub_fill_fieldcat_alv TABLES lt_fieldcat TYPE slis_t_fieldcat_alv
USING ref_tabname ref_fieldname fieldname fieldlabel p_hotspot p_just.
DATA: ws_fieldcat TYPE slis_fieldcat_alv .
DATA: w_col_pos TYPE i.
* ws_fieldcat-tabname = 'GT_ALV'.
w_col_pos = w_col_pos + 1.
CLEAR ws_fieldcat.
IF ref_tabname <> space.
ws_fieldcat-ref_tabname = ref_tabname.
ENDIF.
IF ref_fieldname <> space.
ws_fieldcat-ref_fieldname = ref_fieldname.
ENDIF.
ws_fieldcat-fieldname = fieldname.
IF fieldlabel <> space.
ws_fieldcat-seltext_l = fieldlabel.
ws_fieldcat-seltext_m = fieldlabel.
ws_fieldcat-seltext_s = fieldlabel.
ws_fieldcat-ddictxt = 'M'.
ws_fieldcat-reptext_ddic = fieldlabel.
ENDIF.
ws_fieldcat-key = space.
ws_fieldcat-do_sum = space.
ws_fieldcat-col_pos = w_col_pos.
ws_fieldcat-no_out = space.
ws_fieldcat-hotspot = p_hotspot.
ws_fieldcat-just = p_just.
APPEND ws_fieldcat TO lt_fieldcat .
ENDFORM. " sub_fill_fieldcat_alv
FORM set_pf_status USING extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD_FULLSCREEN' .
ENDFORM. "SET_PF_STATUS
FORM frm_user_command USING r_ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&F03' OR '&F15' OR '&F12'.
WHEN OTHERS.
ENDCASE.
***&刷新
* selfield-refresh = 'X'.
ENDFORM.
FORM BUILD_SORT .
DATA L_SORT TYPE slis_sortinfo_alv .
L_SORT-spos = 0 .
IF P_USER = 'X'.
ADD 1 TO L_SORT-spos .
L_SORT-fieldname = 'BNAME' .
APPEND L_SORT TO I_SORT.
ADD 1 TO L_SORT-spos .
L_SORT-fieldname = 'NAME_LAST' .
APPEND L_SORT TO I_SORT.
ENDIF.
L_SORT-fieldname = 'AGR_NAME' .
APPEND L_SORT TO I_SORT.
ADD 1 TO L_SORT-spos .
L_SORT-fieldname = 'TEXT' .
APPEND L_SORT TO I_SORT.
ADD 1 TO L_SORT-spos .
L_SORT-fieldname = 'FIELD' .
APPEND L_SORT TO I_SORT.
ADD 1 TO L_SORT-spos .
L_SORT-fieldname = 'LOW' .
APPEND L_SORT TO I_SORT.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_USER_AUTH
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GET_USER_AUTH .
SELECT * INTO TABLE GT_USERROLE
FROM AGR_USERS
WHERE UNAME IN S_BNAME.
SELECT * INTO TABLE GT_USERNAME
FROM USER_ADDR
WHERE BNAME IN S_BNAME.
ENDFORM. " GET_USER_AUTH
*&---------------------------------------------------------------------*
*& Form CHECK_VAR
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM CHECK_VAR .
IF P_USER = 'X'.
IF S_BNAME IS INITIAL AND
( S_ROLE IS INITIAL AND S_LOW IS INITIAL ).
MESSAGE '什么都不填,查询结果过多,性能可能不好' TYPE 'W' .
ENDIF.
ENDIF.
ENDFORM. " CHECK_VAR
这篇关于BW/BPS Authority Where-Used List的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!