2013-11-03

用robocopy复制数据到映射的网络盘

公司的电脑应用了组策略,复制数据到连接到本地的USB设备时要求USB必须是加密过的设备,否则拒绝复制数据。这给备份数据时带来了点麻烦。我把一个外接硬盘(文件系统为NTFS)挂载到了一个Android设备上,用samba共享出来供备份数据,没想到用robocopy复制数据时总是得到错误:
"ERROR 5 (0x00000005) Changing File Attributes ... Access is denied".

For the error (ERROR 5), you need to turn off the attribute copying. Robocopy uses the /COPY:DAT by default, which means to copy data, attributes and timestamp. You should turn off attribute copying by explicit setting /COPY:DT.

使用/COPY:DT仅仅复制D(data)和T(timestamp)

robocopy source target /MIR /COPY:DT /UNICODE

当复制一个文件失败时,默认的重试次数是一万次。这个对于我来说基本是浪费时间,所以还是加上一个retry的参数吧

robocopy source target /MIR /COPY:DT /UNICODE /R:3 

2013-07-23

save message version in PI 7.31

xiadapter.stage.conf

This property defines the persistence mode for the XI protocol handler.
Its value is given as a comma-separated list of persistence mode configurations at specific stages.
Stages:
 BI - Before inbound processing
 VI - After inbound schema validation
 MS - Between receiver determination and mapping step
 AM - Between mapping and schema validation
 VO - After outbound schema validation
 Modes:
 1 - Store on error
 2 - Store and continue
 3 - Store and return (to queue)
 Example:
 BI=1,MS=3

xiadapter.logger.conf 

This property defines the logging mode for the XI protocol handler.
Its value is given as a comma-separated list of logging mode configurations at specific stages.
Stages:
 BI - Before inbound processing
 MS - Between receiver determination and mapping step
 AM - Between mapping and schema validation
 Modes:
 2 - Synchronous messages are logged
 6  - Only synchronous error messages are logged
 10 - As mode 2, with the business content hidden
 14 - As mode 6, with the business content hidden
 Example:
 BI=6,AM=2

2013-06-13

SAP PI 7.31 SOAP receiver adapter不能正常发送数据

在SAP PI 7.31 AEX (SP4)下一个简单的IDoc ->SOAP 的应用场景,其中SOAP receiver adapter使用HTTPS,验证使用用户名和密码的方式。在测试环境中运行正常,但是移到生产环境就不能发送数据到接收方了。

在没有部署接收方的SSL证书之前,得到错误:
Peer certificate rejected by ChainVerifier。
在导入SSL证书链(一共三个)并重启SSL provider之后,这个错误没有了,不过却得到另一个错误:

Failed to call the endpoint: Error in call over HTTP: HTTP 400 Bad Request
SOAP: call failed: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request
SOAP: error occured: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request
MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request

尝试修改SOAP adapter指向测试环境的接收方和相应的用户名+密码,一切正常。在SAP PI的测试环境下发送数据到接收方的生产环境,得到的错误与上面一样。可是用SOAP UI 4.51却能正常发送同样payload的数据到接收方。

正常工作:
SAP PI QA   -->  Receiver QA
SAP PI Prod --> Receiver QA
SOAP UI       --> 
Receiver Prod

不能工作:
SAP PI QA   -->  Receiver Prod
SAP PI Prod --> Receiver Prod


查看了SOAP FAQ note 856597,里面提到:
For SOAP adapter initialization problem, component com.sap.aii.af.mp.soap must be set to DEBUG. For runtime problem, additionally component com.sap.aii.messaging must be set to DEBUG.
可是找半天却不知如何设置com.sap.aii.af.mp.soapcom.sap.aii.messaging成DEBUG模式。网上提到的多是使用visual adaministrator,适用于低一点版本的PI。

自己无法设置tcp gateway去查看SOAP请求,请求接收方安装了一个程序来查看SOAP adapter发出的请求,发现了问题的原因。接收方返回的应答是:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html>
<head>
    <title>400 Bad Request</title>
</head>
<body>
    <h1>Bad Request</h1>
    <p>
        Your browser sent a request that this server could not understand.
        <br />
        Request header field is missing ':' separator.
        <br />
        <pre>OA==</pre>
    </p>
    <hr>
    <address>Apache/2.2.16 (Debian) Server at hostname Port 443</address>
</body>
</html> 


查看HTTP的头:
    User-Agent: SAP-Messaging-com.sap.aii.af.sdk.xi/1.0505
    CallingType: SJM
    Authorization: Basic c3RuX2FwL3N0bl9hcF9pbnRlZ3JhdGlvbjo1Zjg1MTljNzk4NjQ0YjI0OGZiOTFkY2ZkY2VjNDBk
    OA==

在Authorization这个字段,值因为太长被错误地截断了,变成了两行,导致请求无法被接收方服务器接受。
SAP note 1153210提到了类似的问题:
The base64 encoding was implemented according to rfc2045, where there is a
limitation on line length. So the encoded user:password string has been
separated by a CRLF chars and this breaks the request

2013-06-04

vim下选择文本

有人在superuser问,如何在vim下实现sublime text的Expand selection to scope功能,http://superuser.com/questions/586076/vi-vim-alternative-to-sublimetexts-expand-selection-to-scope。运用vim下的text objects可以很轻松地实现这种功能。不过在这个帖子的回复中学了一招,如何选择当前文字所在的标签文本及其父标签。vat会选择光标所在文字和标签,v2at则会选择包括父标签在内的文本,依此类推。

vaw means a word
vas means a sentence
vap means a paragraph
va< means a <> block
va' means a single-quoted string
va" means a double-quoted string
vat means a tag

2013-05-21

SAP PI post installation steps

After a PI installation you have to configure your system. This is a mandatory post installation step called "Running the Configuration Wizard".

Before running the Wizard, it is recommended to update the following Java Software Components (SCs) to the highest available Support Package and Patch Level:

Life Cycle Management:

    LM CONFIGURATION (LMCFG)

    LM CONFIGURATION WIZARD (LMCTC)


Process Integration:

    MESSAGING SYSTEM SERVICE (MESSAGING)

    XI ADAPTER FRAMEWORK (SAPXIAF)

    XI TOOLS (SAPXITOOL)

    PI GUI (SAPXIGUI, only 7.11)

    PI GUILIB (SAPXIGUILIB, since 7.30)

    ESR (SAPXIESR)


The ABAP stack must have the same Support Package level as Java.

This Wizard Template is available since Release 7.10.

A prerequisite to run the Wizard is that the system was installed with the PI Installer (SAPInst). All PI services must be up and running.

For further information about the Configuration Wizard, see the following collective notes:

    SAP note 0923359 - Collective Note: Configuration Wizard (Release 7.0x)

    SAP note 1107808 - Collective Note: Configuration Wizard (Release 7.1x)

    SAP note 1362909 - Collective Note: Configuration Wizard (Release 7.3x)

    SAP note 1286428 - Configuration Wizard: PI Wizard Templates overview (Releases 7.1 and higher).

Solution

To run the CTC Wizard, start the SAP NetWeaver Administrator and navigate to "Configuration Management --> Scenarios --> Configuration Wizard". Depending on your release do the following:
Releases 7.10 / 7.11:

Select in the drop down list "Initial Configuration" or "All Configuration tasks -> NetWeaver initial setup".
Releases 7.30 / 7.31 and higher:

Click on link "Functional Unit Configuration UI". Select Functional Unit "SAP NetWeaver Process Integration (PI)". All required Functional Units are selected automatically. Press button "Enable automatically" to start the CTC Wizard. Pay attention to FAQ 1e and 1f.

FAQs:



Questions and Answers


Question 1: It is a prerequisite that 'all PI services must be up and running'. How can I check this?

Answer: Log on to NetWeaver Administrator and navigate to "Operation Management -> Systems -> Start and Stop" and select "Java JEE Services". Filter for Services with name "XPI". All of them must be started.


Question 1a: How can I check whether installation and configuration was successful?

Answer: With 7.10 SP7 and higher you can execute the "PI Self Test for NetWeaver" CTC Wizard template. See note 1286149 how to do that.


Question 1b: Can I execute the configuration steps manually? Where is this described?

Answer: Yes. This is described in the online documentation. For <your release> select "PI/Mobile/IdM 7.1" or "7.0(2004s)" or "2004".

http://help.sap.com/
-> SAP NetWeaver
-> SAP NetWeaver <your release>
-> <your language>
-> SAP NetWeaver Process Integration Library
-> Administrator's Guide
-> Configuration of SAP NetWeaver
-> Configuration Wizard
-> Wizard-Based Configuration
-> Usage Type Process Integration (PI)

For Release 7.3:
http://help.sap.com/saphelp_nw73/helpdata/en/57/f47fd4fe534a1a948476afb65dd983/content.htm

Question 1c: Where do I find the log files?

Answer: Start the NetWeaver Administrator and navigate to "Configuration Management --> Scenarios --> Configuration Wizard" and select in the drop down list "History of executed configuration tasks". You can download the protocol there. Attach this zip file an OSS ticket in case of deeper problems.


Question 1d: Is it mandatory to apply the highest available Support Package after a new installation (before running the CTC Wizard)?

Answer: Yes. Typically the installation is shipped with SP0. Before running any CTC configuration task, you have to update to the latest (currently) available Support Package. Especially in Release 7.3 this can lead to problems.


Question 1e: How can I restart the CTC Setup from the Functional Unit UI?

Answer: Select Functional Unit "SAP NetWeaver Process Integration (PI)" and press "Disable". Refresh the screen after that. Select the Functional Unit again and press "Enable automatically". Pay attention to FAQ 3.

Question 1f: Functional Unit "SAP NetWeaver Process Integration (PI)" has status "Running" and cannot be changed. What can I do?

Answer: Select in the drop-down menu of the Configuration Wizard UI (NWA --> Configuration Management --> Scenarios --> Configuration Wizard) entry 'Running Configuration Tasks'. Check whether another session is already running. Cancel or take over this session. If there is no entry, disable Function Unit "SAP NetWeaver Process Integration (PI)" directly in the Function Unit UI by pressing the "Disable" button. Restart from there.


Question 2: Does CTC support the usage of a remote SLD?

Answer: Yes, a remote SLD is supported. See note 954820 regarding the supported release dependencies. Pay attention to questions (2a)-(2d).


Question 2a: Do I have to execute any manual steps to run my PI system against a remote (central) SLD?

Answer: Yes. You have to create the PI Service users PIAFUSER, PIRWBUSER, PIISUSER, PIDIRUSER, PIREPUSER and PIAPPLUSER on the remote SLD manually and assign role/group SAP_SLD_CONFIGURATOR to them. To make the names unique, it is recommended to add the SID of the system, which connects, to the user name, e.g. PIAFUSER<SID>. Note that length of user names is restricted to 12 characters for an ABAP UME. Therefore you may also use the following short user names (which are also used as default names since 7.30):

    PIAF<SID>, PIRWB<SID>, PIIS<SID>, PIDIR<SID>, PIREP<SID> and PIAPPL<SID>


See notes 768148 and 939592 for further information (e.g. LDAP) and question (2b). For security reasons remote SLD user creation is on purpose not automated via the PI CTC Wizard.


Question 2b: I want to connect several PI systems to a central SLD. Must all PI service users have same name/password?

Answer: No. It is recommended to change the usernames of the PI service users in a way that they are unique in the landscape, e.g. by adding the SAP system ID (SID). See note 999962 how to do that.


Question 2c: During setup of the remote SLD I am asked for the password of users SLD_DS_<SID> and SLD_CL_<SID>, where SID is my local SID and not the one of the remote system. What do I have to enter here?

Answer: You have to change the user name into SLD_DS_<SID_remoteSLD> and SLD_CL_<SID_remoteSLD>. The input screen displays the local SID as default value, which is not correct in this context. You have to enter the SID of the remote SLD. The Wizard checks the user credentials when you press 'next'. Pay attention that for SLD Host and Port also the remote SLD's values have to be entered. See question (2d) regarding the Gateway configuration.


Question 2d: During setup of the remote SLD I am asked for the "Bridge Gateway Instance ID". What do I have to enter here?

Answer: You have to enter the 2-digit instance number of the gateway instance. It is assumed that it runs on the remote SLD host. The Gateway is used by the SLD Data Supplier Configuration (RZ70). Pay attention to note 1172161 how your SLD Gateway must be configured, especially if your SLD runs on WebAS Java (without ABAP stack). On plain AS Java systems the Gateway runs on the SCS instance whereas on double stack systems usually the central instance (CI) is used.

Example: SLD on double stack C11 with CI on 00 and SCS on 01

        SLD HTTP Host = <hostname>

        SLD HTTP Host = 50000

        Bridge Gateway InstanceID = 00

        Data Supplier User = SLD_DS_C11

        SLD Client User = SLD_CL_C11



Example: SLD on WebAS Java C11 with CI on 00 and SCS instance on 01.

        SLD HTTP Host = <hostname>

        SLD HTTP Host = 50000

        Bridge Gateway InstanceID = 01

        Data Supplier User = SLD_DS_C11

        SLD Client User = SLD_CL_C11



Question 2e: How can I check whether the SLD Self Registration of the PI components was successful?

Answer: Start the SLD, navigate to "Technical Systems" and select in the drop down list "Process Integration". There must be 6 entries for your new PI system. On a central SLD you may filter for the DB Host name:

    Adapter Engine on <db_host>

    Domain <db_host>

    Integration Directory on <db_host>

    Integration Repository on <db_host>

    Integration Server on <db_host>

    RWB on <db_host>



Question 2f: I am running NetWeaver PI 7.1. Can I connect it to a SLD with Release 7.0?

Answer: Yes. See SAP note 954820 regarding SLD compatibility and known incompatibilities. Note that you have to update your SLD "Component Repository Content" (CR Content), which is release independent. See SAP note 669669 for details.


Question 2g: My local SLD is not using the default HTTP port. The initial setup fails. What can I do?

Answer: Select "remote" SLD during the initial setup of the functional unit SLD and enter the respective port.


Question 3: Can I re-execute the "NetWeaver initial setup" template?

Answer: Yes. Pay attention that not all configuration steps are really re-executed in this case, for example the SLD and ESR Content import. If you have already done manual configuration changes, be aware that they might be overwritten.


Question 3a: I cannot execute the "NetWeaver initial setup" template on a Business by Design (ByD) system. When I select the drop down list 'All configuration tasks', a task "NetWeaver initial setup" is not displayed. Is this correct?

Answer: Yes. The "NetWeaver initial setup" template is only executed on NetWeaver systems. ByD systems have own configuration templates, which call the PI initial configuration on their own.


Question 4: I want to run my Integration Server not in the default client 001, but in a different one. Is this automated?

Answer: Yes. Since Release / Support Package

    SAP NetWeaver 7.10 SP08

    SAP NetWeaver 7.11 SP01, Patch Level 02 of Software Component "LM CONFIGURATION" (LMCFG01P Patch 02)

    SAP NetWeaver 7.30


this is fully automated. Prerequisite is that you have manually performed a client copy and changed the ABAP UME to the new client. This must have been done before (!) the CTC Wizard is executed. See questions (4a) and (4b) how to do that. For lower Support Packages this is different: There you have to execute first the CTC Wizard on default client 001 and after that the client copy. Further manual steps are required. See note 1115280 how to proceed in that case.


Question 4a: How can I change the UME Client in a 7.1 System?

Answer: Please refer to the online documentation:
http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03e11edc6a6e99e10000000a11466f/frameset.htm


Question 4b: Which source client and profile do I have to use for a client copy?

Answer: You have two options:

    copy client 001 (transaction SCCL) and use profile "SAP_UCUS"

    copy client 000 with profile "SAP_UCUS" and after that client 001 with profile "SAP_USER". The later is required to insure that j2ee_admin and SAPJSF user have correct role assignment in the new client.


Further details about the copy process are described in the installation guide (post installation step "Performing the Client Copy").


Question 4c: Can I change the Integration Server client for a PI system that already runs on client 001?

Answer: For already running, productive systems this is not supported. On freshly installed systems you can change the default client. This is also possible if you have already executed the PI initial setup Wizards accidentally on client 001. To do so the following steps have to be executed:

    Make a client copy (see FAQ 4b).

    Change the UME client (see FAQ 4a).

    On the old client (001): Start transaction 'SXMB_ADM --> Integration Engine Configuration' and change the 'Role of Business System' back to 'Application System' or 'Not Yet Configured'.

    Logon to the SLD (can be remote or local). Navigate to 'Technical Systems --> Technical System Types' and delete the respective 'AS Java' and 'AS ABAP' entities.

           Navigate to 'Technical Systems --> Process Integration' and delete the respective XI domain.

           Navigate from the SLD start page to 'Business Systems' and delete Business System INTEGRATION_SERVER_<SID>.

    Reboot the double stack system.

    Execute the Initial Setup again.

Question 5: Are there additional steps required to configure a "High Availability" setup?

Answer: Yes. See note 1052984 how to do that.

Question 6: Are there Demo Scenarios available for PI?

Answer: Yes, there are "Simple Use Case" and "Demo Example" scenarios for PI available in SDN:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/
b030691f-8b8b-2a10-5d94-8dd064dc2aa7
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/
00de46da-8b8b-2a10-a1a0-c328b2034b5e

Question 7: Do you provide a "Trouble Shooting Guide" for PI?

Answer: Yes. See note 1060264 how to find this guide.

Question 8: The Configuration steps

    'Configures the Product of the Technical System in the SLD' (sub step 'Configure product and component SAP_BASIS')

    'Configures the Integration Server in the SLD'

fail with error message:
"Error: ABAP technical system '<SID> on <DB host>\<SID>' not found."
This happens on a Microsoft SQL Server.

Answer: This problem is described in note 1237816. Please adjust the "j2ee/dbhost" profile parameter as described there and restart the CTC Wizard.

Question 9: I want to connect a Business Suite system with an XI/PI system. Are there any configuration templates available?

Answer: Yes, please refer to note 1178800.

Question 10: On "Business By Design" (ByD) Systems the PI CTC Wizard creates a Logical Web Service Port. How can I check whether the creation was successful?

Answer: Logon to clients 001 and 002 and start transaction SRT_TOOLS. Select "Display Web Service Runtime Configuration in Current Client" and mark the radio button "Web Service Consumer". In section "Search by Proxy Name and Logical Port" search with input field "Proxy Name" for "CO_THIRDPARTY_INT_SCNRIO_OUT".

Question 11: After the initial setup I receive the error message "Unable to log on to system xxx in language yyy with user PIRWBUSER" in the Runtime Workbench (RWB). Why this?

Answer: The logon language yyy is not activated in the ABAP system. Start transaction I18N and activate the language. Language activation is a separate post installation task that should have been executed before the CTC initial setup.

Question 12: I execute the "PI initial setup" CTC Wizard and get an error in step "Create Company Address in client 000". What to do?

Answer: See SAP note 1476425. Very likely your ABAP Administrator doesn't exist in client 000, has a different password or is locked.


Question 13: Why does the PI Initial Setup not set fully qualified host names (FQHN) by default?

Answer: This is implemented with Release 7.30 SP1 and higher. See SAP note 1476359 for further information. For lower Releases you can use the PI Full Qualified Host Name CTC Wizard (see SAP note 1320707) to set FQHN afterwards.


Question 14: Does the PI Initial Setup configure SSO?

Answer: It configures "Java --> Java" SSO, but not "Java --> ABAP" and "ABAP --> Java" SSO. The latter is required if you e.g. call ABAP transaction SXMB_IFR. To configure these directions between the stacks you have to execute Configuration Task "PI SSO Configuration". See SAP note 1473556 for details about this CTC Template.


Question 15: I install my PI system in a federated landscape. Are there any release dependencies?

Answer: Yes. The general rule is that your PI hub should have the highest release. See SAP note 1043047 for details.


Question 16: Does the PI NetWeaver Initial Setup configure SSL/HTTPS?


Answer: No. Your AS Java system must first be configured to support HTTPS/SSL. After that Exchange Profile property

    com.sap.aii.connect.secure_connections = messaging


has to be set. For further information access the SAP Library:

Release 7.10:
http://help.sap.com/saphelp_nwpi71/helpdata/en/e8/1f1041a0f6f16fe10000000a1550b0/frameset.htm

Release 7.11:
http://help.sap.com/saphelp_nwpi711/helpdata/en/48/a9bb457e28674be10000000a421937/frameset.htm

Release 7.30
http://help.sap.com/saphelp_nw73/helpdata/en/48/a9bb457e28674be10000000a421937/frameset.htm


Question 17: Step "Executing BAPI SWF_XI_BPM_AUTO_CUSTOMIZE" fails with message: "Error: BAPIRET2 SWF_XI_ADAPTER Error 203 Error  in BPM-Autocustomizing". What can I do?

Answer: See SAP note 1580460.

Question 18: Step "Imports the master XML" fails with message "Error: Profile locked by another local session, please retry later". What can I do?

Answer: See SAP note 1602945. You have to to deploy the latest available Patches of the Software Components:

    J2EE ENGINE LM-CORE (LM-CORE)

    MESSAGING SYSTEM SERVICE (MESSAGING)

    XI TOOLS (SAPXITOOL)

    XI ADAPTER FRAMEWORK (SAPXIAF)

    ESR (SAPXIESR)

Question 19: Can I execute the "PI Initial Setup" after a System Copy?

Answer: Yes. If you work with Release 7.3 you have to use the "Functional Unit UI" (http://<host>:<port>/sld/fun). Pay in that case attention to 'disable' the following FUNs before enabling "SAP NetWeaver Process Integration (PI)" again:

    "System Landscape Directory"

    "Java Foundation"

    "SAP NetWeaver Process Integration (PI)"

All three Functional Units have to be enabled from scratch.

2013-03-02

女儿23个月

女儿满23个月了,身高89厘米,体重12.5公斤,U7安排在了4月份。