通过角色管理跳转的例子

1.背景

通过权限从一个程序到另外一个程序,则通角色管理方法来实现,我通过是alv(ALV函数里的REUSE_ALV_GRID_DISPLAY这个command有如下的代码)展示来实现.

2.关于submit的解释

The SUBMIT statement accesses an executable program rep. The executable program is executed as described under Flow of an Executable Program. If the called program contains a syntax error, an exception is raised that cannot be handled.

The program name rep can either be specified directly or as the content of a character-like data object name. The data object name must contain the name of the program to be accessed in uppercase letters. If the program specified in name is not found, a non-handleable exception is raised.

SUBMIT是在SAP中,是调用另外一个程序的时候用,相应的代码是在user_command,关于用户相关的操作都在这里。

3. 以下是权限跳转的例子(zhcym006是跳转的程序)

 DATA:gt_cond TYPE TABLE OF rsparams,    
     wa_cond LIKE LINE OF  gt_cond
  SELECT SINGLE *  FROM agr_users WHERE uname = sy-uname AND agr_name = 'Z_AU_ZRMM148'.  (role code)
      IF sy-subrc = 0.         
        wa_cond-selname = 'P_BUKRS'.       (某个个工厂)
        wa_cond-sign    = 'I'.
        wa_cond-option  = 'EQ'.
        wa_cond-low     = itab-bukrs."item-bukrs.
        APPEND wa_cond TO gt_cond.
        CLEAR:wa_cond.
         wa_cond-selname = 'P_ZJYDH'.   (某个订单号码)
        wa_cond-sign    = 'I'.
        wa_cond-option  = 'EQ'.
        wa_cond-low     = itab-zjydh.
        APPEND wa_cond TO gt_cond.
        CLEAR:wa_cond.
        SUBMIT zhcym006 WITH SELECTION-TABLE gt_cond AND RETURN.

猜你喜欢

转载自blog.csdn.net/beyond911/article/details/114372357
今日推荐