hege 发表于 2015-9-18 07:27:08

SAP使用技巧

  
用DOS命令循环解压SAR CAR文件

   昨天从SAP网站DOWN了一堆补丁包,全放在一个目录中,到了打补丁时有点犯难了.SAPCAR好像不支持手工批量解,一个个解吧,太麻烦了,一共三四百个文件啊.
   我们还是用DOS的FOR命令来搞定它吧.
    for %a in (*.sar *.car) do sapcar -xvf %a
   这样,就可以在当前目录循环查找所有的sar和car文件,查到后,就使用sapcar对其进行解压.
   如果你还想解压完后将原始的car或sar文件删除,你可以用下列命令:
    for %a in (*.sar *.car) do sapcar -xvf %a del -y %a

SAP中禁止特定用户更改密码

    在SAP管理中,有时一些账号因为是提供给大家作查询用的,受密码强度策略限制,密码不能为空。故密码设为通用后在公司内发布,为避免有些用户更改后造成其他用户无法登陆,我们可在使用TC-SU01,在登录数据中,将该用户的用户类型更改为 S-服务用户。

1 关于SAP的menu现实tcode实现
   菜单 “extras”---"setting" ,选择 “display technical names”,回车。
2 设定一个输入框的默认值
光标在该输入框(栏位--台湾人叫法),F1,单击“Technical information”,记住“Paramter ID”的值。然后顶端菜单,”system“---"user profile"----"own data",单击”parameters“标签页,输入参数的名字和值,然后保存。

3 查看当前窗口的事物码
实现方法一:从顶端菜单,"system"--"status"
实现方法二:窗口右下脚的SAP数据---”transaction"

4 后台作业的处理
顶端菜单。"system"---"service"--"job"--"job overview"或者事物码SM37

5 自定义事物码
SE93

6 修改数据元素的字段描述
事物码:SE11,选择”search for data element",单击“chage",单击”field label“,然后修改长描述

7 查看字段的数据元素 ,表
光标定位在字段,F1,单击”Technology information",双击“data element"或者”table“

8 变式种类和定义方法
种类一:选择变式(select variant)
种类二:显示变式或者屏幕变式(display variant)
通过F1,”techinial information“找到”program“程序名字,然后在SE38,输入程序名字,选择”variant“按钮,单击”change",输入自定义变式名字,单击“create",输入参数后,保存

9 打印
SP01SP02同时选择多个表,用"print with changed parameters"打印一个或者多个表

10 从SAP的GUI屏幕拷贝数据到excel等
   用CTRL+Y 选择拷贝区域,然后CTL+C ,然后在excel里面CTRL+V

11 message的类型
   S----Success
   I----informaiton
   W----Warning 警告,可以继续保存资料
   E----Error   错误 ,不能继续保存资料
   A----Abend(Termination)

12 SAP帮助的定制
   SR13可以定制在线帮助,脱机帮助

13 查找数据库中表和字段的方法
   SE15 ,单击“ ABAP Directory",单击”field“,数据”table field",输入简单描述,执行
14 查看表空间(table space)
   用tcodeDB02   然后点detail analysis-----这个是ecc5,ecc6有单独的单表分析
   就可以查透明表即实际的数据库中表,逻辑表就可以查询不可以分析性能的(SE11)

  

    
Logging Using Change ocuments

记录对Object的修改
Business data objects are changed frequently. We recommend that you log these changes for objects that are critical or susceptible to audits. You may find it helpful, and sometimes necessary, to be able to trace or reconstruct such changes later, for example for investigating or auditing purposes. SAP Systems log changes to business data objects in change documents.
SAP Systems do not automatically use change documents for business objects. You must activate the process yourself.
To activate a change document for an object, perform the following steps:
Create the change document. (Use the transaction SCD0.)
Activate the change document for the object. (Use data element maintenance: transaction SE11.)
Generate an update for the object. (Use the transaction SCD0.)
Insert the appropriate calls in the corresponding programs.
To view change documents for an object, also use the transaction SCD0.
  
  
Logging Changes Made Using the Change & Transport System
记录request number,也就是对SAP R/3系统的修改
It is important to keep track of all changes made to your productive system. In addition to application logging,
change documents, and table recording, all changes that you make to your productive system using the Change & Transport
System are documented in the CTS and TMS logs.
The table below shows the logs created by the Change & Transport System.
Change & Transport System Logs
  Log (File or SAP System Table) Description
--------------------------------------------------------------------------
<transport_directory>/data Data files containing the contents of the transport

<transport_directory>/cofiles Status files containing a list of the transport steps

<transport_directory>/log Logs containing the keys of the transported objects

Table E070 in the SAP System Header information for the transport request

Tables E071 and E071K in the SAP System Object list and keys from table entries
  
  
  
Logging Changes to Table Data in SAP R/3

本文详细介绍如何在SAP R/3中记录对TABLE修改的历史记录
As with business objects, we recommend that you activate the logging of changes to table data for those tables that are
critical or susceptible to audits. (See the SAP - Audit Guidelines R/3 FI, in Section 4.3.5, for examples of important
tables.) You must also explicitly activate this logging. Note the following:
You must start the SAP System with the rec/client profile parameter set. This parameter specifies whether the SAP System logs changes to table data in all clients or only in specific clients. We recommend setting this parameter to log all clients in your productive system.
In the technical settings (use transaction SE13), set the Log data changes flag for those tables that you want to have logged.
If both of these conditions are met, the database logs table changes in the table DBTABPRT. (Setting the Log data changes flag only does not suffice in recording table changes; you must also set the rec/client parameter.)
You can view these logs using the transaction SCU3.
Although we do deliver pre-defined settings, you generally have to modify them to meet your own requirements. Use the report RSTBHIST to obtain a list of those tables that are currently set to be logged. Use transaction SE13 to change the Log data changes flag for these or other tables.
For more information, also see SAP Notes 1916 and 112388.


SAP R/3 Audit log configuration
How to configrate the audit log in SAP R/3
1. Audit Log Profile Parameters:
********************************************************************************
Profile Parameter Description
--------------------------------------------------------------------------------
rsau/enable Enable the security Audit Log
rsau/local/file Names and locations of the audit files
rsau/max_diskspace/local Maximum space to allocate for the audit files
rsau/selection_slots Number of filters to allow for the Security Audit log
---------------------------------------------------------------------------------
2. To access the Security Audit Log configuration screen from the SAP standard menu,
choose Tools -> Administration -> Monitor -> Security Audit Log -> Configuration.
The Security Audit: Administer Audit Profile screen appears with the Static
configuration tabstrip activated. If an active profile already exists, it is displayed in the
Active profile field.
3. Enter the name of the profile to maintain in the Displayed profile field.
4. If you are creating a new audit profile, choose Profile ® Create. To change an existing
profile, choose Profile -> Display <-> Change.
rsau/enable 1
rsau/local/file F:auditlog++++++++.AUD
rsau/max_diskspace/local 50000000
Related Transaction Code:
sm18
sm19
sm20


  The number of BTC in SAP system
  
How to set the value of rdisp/wp_no_btc is a difficult things, a article about it.
Symptom
Request: How are background jobs distributed to the servers?
Other terms
Target server
Reason and Prerequisites
There is some ambiguity as to what is processed when and where. Jobs are hanging in the status 'released'.
Solution
Processing of jobs with a predefined start time:
On every server with at least one background work process, a background processing scheduler runs periodically (the period is defined by the parameters rdisp/btctime): On every run, this checks whether background work processes are free on its application server. If this is the case, pending jobs are selected from table TBTCS (job queue) and are distributed to the processes according to the following criteria (in order of priority):
1. Jobs with class A have priority over jobs with class B, which has priority over class C.
2. Jobs that are especially scheduled for this server have priority over jobs of the same class that are not scheduled for a particular server.
3. If two jobs are equal after having applied the criteria mentioned above, jobs with a longer waiting time have priority. This gives a maximum job throughput per hour per server (only for short-running jobs) of:
Jobs/Hour = No. of background processes * 3600 / 'rdisp/btctime'
The background processing schedulers work independently of each other. If a background work process is free on more than one background processing server, the server chosen is the one whose background processing scheduler is randomly activated first.
Processing of jobs with start time "immediately:"
§         Job with target host: The target host is checked immediately, to see whether at least one background work process is free for the required job class. If so, a request then is sent to the host to start the job immediately. If no work process is free, the job is put in the job queue with the current date/time, in the same way as any other job with a predetermined start time.
§         Job without target hosts: A host is randomly chosen from the list of all available hosts where free background work processes are available for the required job class. If no free work processes can be found, the job is also put in the job queue with the current date and time.
Processing of event-started jobs:
§         If an event is triggered in the SAP system, the event scheduler is immediately started. The event scheduler runs on a particular application server (see below). It selects all jobs that have been waiting for the triggered event. The event scheduler can only start jobs on the server on which it is running. If there are insufficient background processing resources on this server, the system changes the remaining jobs to time-controlled jobs.
Even jobs that have a different target server are changed to time- controlled jobs.
There are three ways of triggering an event in the SAP System. When an event is triggered, the server on which the event scheduler is running is also specified (explicitly or implicitly):
1. BP_EVENT_RAISE function
The TARGET_INSTANCE parameter specifies the server on which the event scheduler is running. If this parameter is empty, the event scheduler runs on the server specified in the rdisp/btcname profile parameter. In this case, the profile parameter is analyzed on the server on which BP_EVENT_RAISE was called.
2. Transaction SM64
The system calls BP_EVENT_RAISE internally with an empty TARGET_INSTANCE parameter (see 1).
In future releases, it may be possible to specify the TARGET_INSTANCE parameter.
3. sapevt program
This is a program written and executed in C; it is located by default in the same directory as the kernel executables. If an event is triggered using sapevt, the event scheduler runs on the application server that has been active for the longest time.
Processing of jobs with start time 'After job' or 'At operation mode'.
§         Both start conditions are executed using events, so the system behaves in exactly the same way as with event-started jobs.
Note:
§         When defining operation modes (RZ04), you can reserve one or more background work processes for jobs with class A.
This is done as follows: RZ04 -> "New operation mode" -> save -> doubleclick on the name of the operation mode -> "New instance" -> "Current settings" -> cursor to "Job-Cl.-A" -> "More" -> save.
The individual background work processes will still be equal. Reserving n background work processes for jobclass A means that jobs of class B and C will only run on this server if there are at least n+1 free background work processes.
The number of background work processes reserved for job class A must of course be smaller than the total number of background work processes (shown on the same screen); otherwise jobs of classes B and C won't run. The new operation mode can only be activated if it is scheduled with Transaction SM63.
§         Note concerning the workload:
Since the job schedulers run independently on each application server, a job WITHOUT a target computer can be taken from any scheduler and run on the corresponding application server. Thus, the workload is distributed equally on all servers.
If the jobs you plan always have a defined start time and want free work processes on several servers, it is possible that one server is used more than the others. Imagine this situation: The batch scheduler on two separate servers is set to 60 seconds. When the scheduler on server A always becomes active at xx:xx:10 and the one on server B at xx:xx:20, server A will always come to the fore, since background jobs are planned for full minutes. If, for any reason, you want to divide the jobs equally between two servers, you will need to change the parameter rdisp/btctime: e.g., 61 seconds for server A and 62 seconds for server B.

Each scheduler distributes as many jobs as there are background work processes on the corresponding application server. When the scheduler is running, the system load on the respective application server is not considered. Therefore the number of configured background work processes should not cause any performance problems - even if all background processes are used
  

升级到sapdba 620后,不能运行
在升级到Oracle 9i后, sapdba 4.6d不能识别Oracle Version; 但是安装完sapdba 620后,运行出现如下错误:
dragon:oradsp 1> sapdba
/usr/lib/pa20_64/dld.sl: Unable to find library 'libclntsh.sl.9.0'.
Killed

找了半天原因,原来是环境变量的设置问题:
在 .dbenv_dragon.csh 中添加:
setenv LD_LIBRARY_PATH /oracle/DSP/920_64/lib
setenv SHLIB_PATH /oracle/DSP/920_64/lib64:/usr/sap/DSP/SYS/exe/run
  
  
给SAP系统安装联机帮助(事务码SR13)
新安装好的SAP系统,联机帮助是不能用的,通过菜单中的“帮助-应用程序帮助” 和“帮助-SAP库”都打不开任何帮助页面。这并不是因为SAPgui安装不完整,而是因为SAP的帮助系统本身就不包含在GUI中,而是需要单独配置的功能。

使用事务码SR13,打开“更改视图"管理:显示SAP库"”功能。可以看到里面有四个选项卡,我们只需要使用其中第二个——PlainHtmlHttp,这是通过Web服务器访问SAP帮助的方法。
由于SAP的官方网站提供了联机帮助站点 http://help.sap.com ,我们可以直接通过连接这个站点来访问联机帮助。

点“新条目”按钮,下面的内容栏就可以填写了,按照下面规则填写:
变式:任意的唯一名字
平台:WN32
区域:IWBHELP
服务器名称:help.sap.com,SAP的官方帮助站点
路径:根据你的SAP版本,在 http://help.sap.com 里面找,我用的是ECC5,所以路径为 saphelp_erp2004/helpdata
语言:EN,因为SAP只提供了英语和德语,我们只好选英语了。
缺省值:勾上,这就是缺省的联机帮助设置。
然后保存即可。

再到某一个功能里,用菜单中的“帮助-应用程序帮助”看看,可以定位到当前操作的帮助页面了!

  
记录的是我日常SAP维护的一些东西。
环境:WIN2K(SAP APP) + HPUNIX11I(SAP ORACLE DB) + SAP 4.6C

1> prevents login with password PASS when SAP* has been deleted
    /usr/sap/DSD/SYS/profile/_DVEBMGS00_中设置:login/no_automatic_user_sapstar = 1
2> if you want to block your password from being forced to change every XX days, you can execute this simple SQL request at DB level
    Update sapr3.USR02 set BCDA1 = '99991231' where BNAME = 'Your_ID' and mandt='100';
    commit;
    This only affects Your_ID in client '100'.
3> work process trace file grows rapidly pipe connect error
    Symptom
    The size of the trace file of an individual work process grows very quickly, due to the following error message:
    ERROR => Pipe connect error: 535
    Affected components: Dispatchers, work processes, gateway, message server
    Additional key words
    Cause and preconditions
    The pipe is stopped by another process.
    Solution
    The problem is eliminated by regenerating the pipe. The following options are available:
    1.Stop the R/3 System with MMC and delete the large trace file. Then restart the R/3 System.
    2.If this problem occurs in a work process, you can avoid restarting the entire system as follows:
      Call transaction sm50.
      Reset the relevant work process under 'start' from 'Yes' to 'No'.
      Stop the work process and delete the trace file.
      Reset the value under 'Start' in transaction sm50 to 'Yes'.
4> Some time admin met some process hang on SAP(NT).Using T-code SM50, we can't stop the process. Therefor SAP can't use this process.
   If you want kill process on the NT, use the Task Manager.
   1. Find the SAP Process Number on SM50(PID)
   2. On the Task Manager, find the process number(PID)
   3. Choose the pid and then press End Process Button.
   It's all..! very simple.But SAP is nor recommanded this action.
   Tool name is pskill. You extract this file on NT SAP server, and directory.And then on the command mode, run pskill PID(SAP)
   It will terminate the garbage process!!
5> For some users, logging into the system takes very long time(aftergiving ID & Pwd). Sometimes the process is terminated with TIME_OUT
      dump. Our BASIS Supportpack level is 4.6D
      While analyzing, we found the following.
   1. This above said situation is, even in the low system load in application servers.
   2. In SM50, we are able to see the program SAPLSTXKis running for a very long time.
   3. There is no improvement in login time, even afterremoving all activity groups attached for theproblematic user.
   4. If we copy the specified user to a new one,there isno problem in logging with that new ID.
       ( The problematic users do not have anything common otherthan Office authorisations - which is also available
       to other non-problematic users )
       In this situation we are not able to identify the problem. Does anyoneknow how to deal with this problem. }

  
  
本文是日常维护中非常有用的一些小技巧。
·         在OS级通过命令获得SAP的一些信息。
·         不登陆SAP系统,用批处理来检查SAP系统是否在运行
·         在DB中查看SAP系统的版本
·         锁某个特定的CLIENT
等等

1.      不登陆SAP SYSTEM,在命令行下检查系统是否正常运行。
         这是个极其有用的技巧。能帮助你判断系统运行的状态。在这个脚本中最重要的一个命令是SAPINFO.EXE,在SAPFRONTEND CD中能找到这个命令。如果你找不
         到可以个我EMAIL。SAPINFO使用语法是:
         sapinfo ashost=hostname sysnr=nn
    我的PC是WIN2K,SAPGUI 6.2, SAP 安装在主机名为:horse, bull, cock的三台机器上
    STEP1:    在C:WINNTsystem32driversetc,编辑hosts文件,建立SAP 系统APP所在机器的IP与HOSTNAME地对应。如
            127.0.0.1      localhost
            109.104.81.3   horse
            109.104.81.5   bull
            109.104.81.11cock
   STEP 2: 将sapinfo.exe拷到winntsystem32下,并在这个目录下建立checksap.bat批处理文件;如下
            @echo off
                rem
                rem script: CheckRFC.BAT
                rem It uses SAPINFO from the RFC-SDK(SAPGUI) to check an RFC destination
                rem It needs two parameters: 1. Hostname 2.Instance Number
                rem A ping is sent to the host. If successful an Rfc check is carried out.
                if "%2"=="" goto Noparameter
                echo Pinging %1 ...
                ping %1 -n 2 | find /i "reply" > nul && goto CheckRFC
                echo System does not exist on the network! & goto Bye
               :CheckRFC
               sapinfo ashost=%1 sysnr=%2 & if errorlevel 1 goto System_Down
               echo ----------------------------------------------------------
               echo System is up. RFC checks OK!
               echo ----------------------------------------------------------
               goto Bye
               :System_Down
               echo ----------------------------------
               echo System is down!
               echo ----------------------------------
               goto Bye
            :NoParameter
            echo ----------------------------------
            echo You did not specify at least on parameter!
            echo Synatx: checkrfc "hostname" "instance number"
            echo Example: checkrfc mydev 00
            echo ------------------------------------
            :Bye
2. lock a client to prevent logons
    Do you need to do maintenance on a system and want to make sure nobody logs on to it while you are
    working it?
You can lock a system at the OS level by running : tp locksys <SID> pf=tpprofile
Example: To lock your DEV system enter this command: tp locksys DEV pf=saptranshostsapmnttransbintp_domain_dev.pfl

Userss will get this message if thery attempt to log on: "Upgrade still running.Logon not possible"

Notice that the message is not exactly accurate. TP locksys is mainly used during release upgrade
so the message is kink of generic. But, it works!
To unlock the system, run: tp unlocksys <SID> pf=tpprofile
Only SAP* and DDIC can log on to any of the clients in the system that has been locked.
3. SAP table with Version and Instance name
USAP R/3 stores its version, instance name and OS platform in tables!
This is excellent as you can then query the <SID> database to get the
R/3 version, Instance Name and OS platform as follows:
select * from SVERS
select * from TSLE4
You do not even have to log on to the application to get this info.The
above query gives it to you in less than 1 second
4. Locking/Unlocking accounts
User accounts can be locked/unlocked via SU01(User Maintenance)
But, what goes on behind the scenes?What does the system do to actually set this?
The table USR02 gets updated. The field UFLAG determines if the user account is
locked or unlocked. The value "64" indicates that the user account is locked,
The value "0" indicates that the user account is unlocked.
Knowing this, you can then issue an update statement at the database level that
locks all users in mass
Do not lock yourself out,though!Use exceptions for super user accounts in your
update statement
5.Getting technical info at the OS level
It is very easy to obtain the patche level of some core R/3 executables such as:
disk+work, tp and r3trans
Many people woule like to know how to do this,Here show you how to do it for R/3 systems
running on Windows a:
STEP1: Go to the command prompt
STEP2: Change to the "run" directory of your SAP instance(cd usrsap<SID>sysexerun).
STEP3: Run the following three commands
       dsp+work -V |find "patch number"
       tp -V |find "patch number"
       r3trans -V|find "patch number"
If you want to see all the release infomation, then do not filter for the patch number.
  
  
  
页: [1]
查看完整版本: SAP使用技巧