BP -> Customer

CRM中客户的双向同步是老话题了,Note 1541354介绍了CRM -> ECC 方向Debug的方法:

  1. Display the BDOC in SMW01
  2. Enter /h in the transaction code field
  3. Press the ‘retry to process message’ button.
  4. In the debugger – select the Settings button and ‘In background task  do not process’ (Classical debugger)  // 新的叫TRFC(In Background Task): Block Sending
  5. Enter F8
  6. Create a new session for the outbound queue (/osmq1) there will be an entry R3AUBUPA*** or CSA_BUPA**
  7. Double-Click on this queue entry twice and choose Debug for the CRM_UPLOAD_TRIGGER
  8. In the debugger, set a breakpoint at statement ‘CALL TRANSACTION’ and then press F8.
  9. At this statement double-click on the statement CALL_TRANSACTION and change the variable CALL_TRANSACTION_MODE from N to A, press the ‘change field content’ button and then press F8
  10. Now you will be in the R/3 System and you can see the batch input screen for this customer and you will then be prompted for the missing field in the BDOC.

BTE及ECC、CRM主数据同步增强

Note 1156808提供了产品主数据同步增强的范例,其核心是采用Business Transaction Events(BTE)的增强方式。该方式同样适用于客户、设备等主数据的同步。

其中ECC到CRM方向,由FM: CRS_SEND_TO_SERVER出发,编辑Table: TPS34,添加Process Interface: CRM0_200。CRM到ECC方向,由FM: CRM_UPLOAD_TRIGGER触发,Process Interface: CRM0_300。

关于BTE,参考这里 >>

 

BAPI_GOODSMVT_CREATE

客户用BAPI_GOODSMVT_CREATE批量创建物料移动凭证,报M7 022错误。Note 369518说是Buffer的原因。我不是开发,也不懂什么是roll area。不过Note也提出了一个挺特别的解决方案,对这个BAPI是可行的,能否作用在其他场景呢?或者值得一试。

[code]
Example:
————————————————————————
Program Test.

LOOP.
….
CALL FUNCTION func1 DESTINATION ‘NONE’.
CALL FUNCTION RFC_CONNECTION_CLOSE.
….
ENDLOOP.
————————————————————————
FUNCTION func1.
….
CALL FUNCTION ‘BAPI_GOODSMVT_CREATE’.

IF ‘no errors’.
CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT’.
ELSE.
CALL FUNCTION ‘BAPI_TRANSACTION_ROLLBACK’.
ENDIF.

ENDFUNCTION.

[/code]

另外对这个BAPI感兴趣的可以参考SCN Wiki: How To Goods Movements with BAPI

组织传输

为了保证Org Unit号码的一致性,Organizational Structures是可以传输的。当然Org的传输没有这么简单,精要写在两篇Notes里头:327908、548202。

  1. OOCR中设置传输模式,其中X用报表程序RHMOVE30传,T用报表程序RHMOVE50传。个人认为T省事一些,每次编辑Org会自动产生传输记录,然后用程序RHMOVE50生成传输请求。
  2. 在目标系统中用OOTR给CP、Position加锁。因为RHMOVE50生成的传输请求只包含Org,没有Position分配的CP信息。如果不加锁,目标系统手工生成的信息会被覆盖掉。
    Object type – Infotype Subtype
    O 1001 B207
    CP 1000
    CP 1001 B207
    CP 1001 B008
    CP 1001 B208
    CP 1001 B209
    S 1001 A008
  3. 用RHMOVE50生成传输请求,然后传输。
  4. 在目标系统用程序HRALXSYNC生成/修复BP。

 

Log texts

留意到CRM中有些长文本是带log的,从上到下记录了更改人的用户名、更改时间和内容。这不是开发的结果,而是可配置的。

简单来说,在Text Procedure中,需要log的Text Type中Control里头设置Change为P。同时额外配一个Text Type用于记录Log,Control里头设置Change为R。

使用的时候,第一个Text Type输入内容,保存后 该Text Type会清空,同时内容拷贝到第二个Type,并添加用户名、时间等记录信息。

Notes: 773432, 910735, 942771

CUSTOMER_REL

Adapter Object: CUSTOMER_REL有两个功能:

  • 同步Contact Person,以Relationship的方式
  • 同步Partner Function,同样以Relationship的方式

注意,像Ship-to,Bill-to等等,如果是自身的话(叫做self-reflection),在CRM中是不会产生Relationship的,因为CRM不允许self-reflection。而对于自定义的Partner Function,需要在CRM中配置:

  • Distribution of Partner Functions from SAP ECC into CRM
  • Distribution of Partner Functions from CRM into SAP ECC

针对self-reflection,其实在Define Partner Functions中Block选项就是干这个的,如果不勾选的话,意味着在Partner Determination过程中,可选自身作为任意的Partner Function。详见Note: 417022

在CRM中,self-reflection用BP Role来体现。但是CRM中,BP Role没有什么特殊功能,只是UI的集合,参见Note: 596334

再引用一段话:

The self reflexive partner function by design are not replicated to CRM
from R/3, because in the CRM system they do not make sense as per the
design and data model of the CRM system.

In R/3 when a customer is created in a particular sales area under a
particular account group self reflexive partner functions like
Ship-to-party, Bill-to-party and so on are added.

This information is represented in CRM in terms of roles because in CRM
partner functions refer only to the ones that a BP has with another BP
and not itself. All the information related to a BP in CRM are stored
in the BP data itself and never through partner functions.

Similarly, these partner functions will not be displayed in the
[RELATIONSHIPS] tab. Please note that self-reflecting partner
functions are not allowed in CRM because it’s physically not possible
for a Business Partner to have a relationship or a partner function
with himself. Such partner functions are subject of partner
determination process in CRM, and by default Ship-to-party, Payer and
Bill-to-Party functions are assumed for all Business Partners.
During data exchange such Partner Functions are simply ignored.