Chinaunix首页 | 论坛 | 博客
  • 博客访问: 668341
  • 博文数量: 194
  • 博客积分: 7067
  • 博客等级: 少将
  • 技术积分: 2008
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-09 14:48
个人简介

我很好

文章分类

全部博文(194)

文章存档

2019年(1)

2018年(1)

2017年(3)

2015年(2)

2012年(2)

2011年(1)

2010年(27)

2009年(15)

2008年(142)

分类: WINDOWS

2008-04-14 09:46:37

 
有时候需要在用户登录时sap时触发一特定程序去执行,sap提供了两种方法t.
1) 使用函数 'NAVIGATION_SET_START_TCODE' ,用该函数可以设置用户和一个TCODE,该TCODE当用户登录sap系统后就可以自动执行。sap对应的程序:ADMIN_SET_START_TRANSACTION_FO
2)使用用户出口
该用户出口的模块名称是:SUSR0001,你可以在该单元里增加你的代码进行相应的控制。.
ADMIN_SET_START_TRANSACTION_FO  程序如下:
  *& Report  ADMIN_SET_START_TRANSACTION_FO                              *
REPORT  ADMIN_SET_START_TRANSACTION_FO.
tables: usr02, tstc.
data: start_tcode_dummy like sy-tcode.
data: i_usr02 like usr02 occurs 0 with header line.
parameters: sttcd like sy-tcode.
parameters: over as checkbox.
parametersall as checkbox.
parameters: user1 like sy-uname.
parameters: user2 like sy-uname.
parameters: user3 like sy-uname.
parameters: user4 like sy-uname.
parameters: user5 like sy-uname.
parameters: user6 like sy-uname.
parameters: user7 like sy-uname.
parameters: user8 like sy-uname.
parameters: user9 like sy-uname.
parameters: user10 like sy-uname.
data: hex01 type x value '01'.

AUTHORITY-CHECK OBJECT 'S_USER_GRP'
         ID 'CLASS' FIELD '*'
         ID 'ACTVT' FIELD '02'.
if sy-subrc <> 0message i203(s#). exitendif.

select single * from tstc where tcode = sttcd.
if ( sy-subrc <> 0 or tstc-cinfo o hex01 ) and sttcd <> space.
  MESSAGE S466(SF) WITH sttcd. exit.
endif.
if all = 'X'.
  select * from usr02 into table i_usr02.
else.
  select single * from usr02 where bname = user1.
  if sy-subrc = 0. i_usr02-bname = user1. append i_usr02. endif.
  select single * from usr02 where bname = user2.
  if sy-subrc = 0. i_usr02-bname = user2. append i_usr02. endif.
  select single * from usr02 where bname = user3.
  if sy-subrc = 0. i_usr02-bname = user3. append i_usr02. endif.
  select single * from usr02 where bname = user4.
  if sy-subrc = 0. i_usr02-bname = user4. append i_usr02. endif.
  select single * from usr02 where bname = user5.
  if sy-subrc = 0. i_usr02-bname = user5. append i_usr02. endif.
  select single * from usr02 where bname = user6.
  if sy-subrc = 0. i_usr02-bname = user6. append i_usr02. endif.
  select single * from usr02 where bname = user7.
  if sy-subrc = 0. i_usr02-bname = user7. append i_usr02. endif.
  select single * from usr02 where bname = user8.
  if sy-subrc = 0. i_usr02-bname = user8. append i_usr02. endif.
  select single * from usr02 where bname = user9.
  if sy-subrc = 0. i_usr02-bname = user9. append i_usr02. endif.
  select single * from usr02 where bname = user10.
  if sy-subrc = 0. i_usr02-bname = user10. append i_usr02. endif.
endif.
loop at i_usr02 where bname <> space.
  clear start_tcode_dummy.
  if over = space.
    CALL FUNCTION 'NAVIGATION_GET_START_TCODE'
         EXPORTING
              UNAME       = i_usr02-bname
         IMPORTING
              START_TCODE = start_tcode_dummy.
  endif.
  if start_tcode_dummy = space.
    CALL FUNCTION 'NAVIGATION_SET_START_TCODE'
         EXPORTING
              UNAME       = i_usr02-bname
              START_TCODE = sttcd.
  endif.
endloop.
阅读(572) | 评论(0) | 转发(0) |
0

上一篇:cl_gui_list_tree实例

下一篇:函数列表

给主人留下些什么吧!~~