星期五, 六月 25, 2010

(fixed)如何清空/删除 SAP MMC SYSLOG?


如何清空/删除 SAP MMC SYSLOG?

清空文件:usr\sap\<SID>\DVEBMGS00\log\SLOG00.LOG
使用Ultraedit 打开文件删除里面的所有内容保存空文件即可



如何清空/删除 SAP MMC SYSLOG?

如何清空/删除 SAP MMC SYSLOG?

清空文件:usr\sap\<SID>\DVEBMGS00\log\SLOG00.LOG

ABAP 动态定义select help

主要利用了,AT SELECTION-SCREEN ON  VALUE-REQUEST
编写自己的 trigger POV 事件.更加灵活

*&---------------------------------------------------------------------*
*& Report  Z_SEARCH_HELP
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  Z_SEARCH_HELP NO STANDARD PAGE HEADING.

TABLES: pa0001.
parameters: ppernr type pa0001-pernr .

DATA: i_return TYPE ddshretval OCCURS WITH HEADER LINE,
      TYPE VALUE 'S'.

* Search Help for Ppernr-low
AT SELECTION-SCREEN ON  VALUE-REQUEST   for ppernr.
 message 'request value?' type 'I'.
  TYPES: BEGIN OF t_pernr,
    pernr LIKE pa0001-pernr,
    ename LIKE pa0001-ename,
  END OF t_pernr.

  DATA: it_pa0001 TYPE STANDARD TABLE OF t_pernr WITH HEADER LINE.

  SELECT pernr ename from pa0001
    INTO CORRESPONDING FIELDS OF TABLE it_pa0001
    where pa0001~endda = '99991231' .
*    WHERE zsdo~kunnr IN sokunnr.

  DELETE it_pa0001 WHERE pernr = '00000000'.
  SORT it_pa0001 BY pernr.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'PERNR'
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'PERNR'
      value_org   = c
    TABLES
      value_tab   = it_pa0001
      return_tab  = i_return.

如何在用户登录时sap时自动执行一特定程序

sap提供了两种方法t.
1)SE37然后如图操作
使用函数 'NAVIGATION_SET_START_TCODE' ,用该函数可以设置用户和一个TCODE,该TCODE当用户登录sap系统后就可以自动执行。sap对应的程 序:ADMIN_SET_START_TRANSACTION_FO




2)使用用户出口(user Exit)
该用户出口的模块名称是:SUSR0001,你可以在该单元里增加你的代码进行相应的控制。.
SAP用户登录增强示例
* Transaction CMOD -> Utiliteis -> SAP Enhancements
* Exit Name SUSR0001
* Double click EXIT_SAPLSUSF_001
* Double click ZXUSRU01
* Insert -> include zsesschk.
** zsesschk limits the number of login sessions per user
* in a certain client
* It runs from user exit SUSR0001 after the SAP Login
* n-1 is the number of concurrent sessions allowed
TABLES: UINFO.
DATA: N TYPE I VALUE 2.              "Upper limit of login sessions
DATA: OPCODE TYPE X VALUE 2, I TYPE I, A(60).
DATA: BEGIN OF BDC_TAB1 OCCURS 5.
        INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDC_TAB1.
DATA: BEGIN OF USR_TABL OCCURS 10.
        INCLUDE STRUCTURE UINFO.
DATA: END OF USR_TABL.
* Exclude Limit login by Users
IF  SY-UNAME <> 'XXX'
AND SY-UNAME <> 'XXX'.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE
  ID 'TAB' FIELD USR_TABL-*SYS*.
LOOP AT USR_TABL.
  IF SY-UNAME = USR_TABL-BNAME AND SY-MANDT = USR_TABL-MANDT.
    I = I + 1.
  ENDIF.
ENDLOOP.
IF I >= N.
A = 'You have already '.
A+17(2) = I - 1.
A+19(25) = 'login sessions in client '.
A+44(4) = SY-MANDT.
  CALL FUNCTION 'POPUP_TO_INFORM'
       EXPORTING
            TITEL = 'UNSUCCESSFUL LOGIN'
            TXT1  = A
            TXT2  = 'You are not allowed to log in'.
  MOVE: 'SAPMSSY0' TO BDC_TAB1-PROGRAM,
          '120' TO BDC_TAB1-DYNPRO,
          'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/nex' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  CALL TRANSACTION 'SM04' USING BDC_TAB1 MODE 'N'.
ENDIF.
ENDIF.

星期一, 六月 14, 2010

Emacs Lisp 如何配置. macrs 文件 c-x -c-f

(add-to-list 'load-path "D:/slime-2010-06-13")
(setq inferior-lisp-program "d:\\sbcl\\1.0.37\\sbcl.exe")
(require 'slime)
(slime-setup)

(add-to-list 'load-path "D:\\color-theme-6.6.0")
(require 'color-theme)
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-hober)))

星期六, 六月 12, 2010

Lisp 提示在read之后才出来

(defun ask-number ()
(format t "Please enter a number. ")
(let ((val (read)))
(if (numberp val)
val
(ask-number))))

(defvar val)
(setf val (ask-number))
(defparameter *s* (open "f:\\temp\\mytest.txt" :direction :output :if-does-not-exist :create :if-exists :append))
(format *s* "your input:~A~%" val)
(close *s*)

原因:
format 需要输出一个新行后,才会刷新,所以,加入~%

(format t "Please enter a number. ~%")

星期五, 六月 04, 2010

ABAP处理所有异常

语法,


TRY.

  ...                       " TRY block (application coding)

CATCH cx_... cx_... ...

    ...                     " CATCH block (exception handler)

CATCH cx_... cx_... ...

    ...                     " CATCH block (exception handler)

  ...

  CLEANUP.

    ...                     " CLEANUP block (cleanup context)

ENDTRY.

如果想处理所有异常,使用

catch cx_root.


  1. A TRY block, in which exceptions can occur.
    This exception block consists of all the statements between the TRY and the CATCH statement.
  2. One or more CATCH blocks for catching exceptions.
    These exception blocks are initiated with CATCH and ended with a further CATCH, CLEANUP, or ENDTRY.
  3. A CLEANUP block for cleanup work after the exceptions have been caught.
    This statement block is initiated by CLEANUP and ended with ENDTRY. A TRY-ENDTRY structure must not contain more than one CLEANUP block in precisely this position.