大多数系统设置的最大掉线时间是30分钟.当一个程序前台时间运行需要30分钟以上时,就会掉线,解决办法是让BASIS把这时间搞大,但这也不是好的解决办法,
以下是一个程序 ,可以先运行此程序,然后在另外一窗口中运行长费时的程序,这样来保证不会超时掉线.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
*&---------------------------------------------------------------------* *& Report ZROUTER *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* report zrouter. data: text type string, time type i, gt_info type table of uinfo2. if sy-langu = '1'. concatenate '请使用其他会话进行工作...' '!' into text. else. concatenate 'Please use another session for working' '!' into text. endif. "获取当前用户的会话数 call function 'TH_LONG_USR_INFO' exporting user = sy-uname tables user_info = gt_info. if lines( gt_info[] ) = 1. call function 'TH_CREATE_FOREIGN_MODE' exporting client = sy-mandt user = sy-uname * TCODE = * RETURN_ERROR = 1 * CREATE_EXCLUSIVE = 0 exceptions user_not_found = 1 cant_create_mode = 2 others = 3. endif. time = 1. do. call function 'SAPGUI_PROGRESS_INDICATOR' exporting percentage = time text = text exceptions others = 1. time = time + 25. if time >= 101. time = 1. endif. wait up to 10 seconds. enddo. |