1. determine whether the permission to print:
1 * 打印权限 2 AUTHORITY-CHECK OBJECT 'ZPP_AUTH' 3 ID 'ZACTVT' FIELD '07' 4 ID 'TCODE' FIELD 'ZPP007' 5 ID 'ZWERKS' DUMMY 6 ID 'ZDISPO' DUMMY 7 ID 'ZFEVOR' DUMMY. 8 IF sy-subrc = 0. 9 gv_print = 'X'. 10 ENDIF.
Gv_print will have authority assigned to 'X'.
2. When you set the status bar, if you do not have permission to hide the corresponding button:
1 * ------------------------------------------------ * ---------------------- 2 FORM frm_set_status the USING rt_extab the TYPE slis_t_extab. 3 the DATA lt_exfcode the TYPE TABLE OF SY- ucomm. 4 5 * hide print without a print authority button . 6 the IF gv_print the IS the INITIAL . . 7 the APPEND ' ZPrint ' the TO lt_exfcode. . 8 the APPEND ' & PRIN ' the TO lt_exfcode. . 9 ENDIF. 10 11 SET PF-STATUS 'STANDARD' EXCLUDING lt_exfcode. 12 13 ENDFORM. 14 *&---------------------------------------------------------------------*
carry out