cancel
Showing results for 
Search instead for 
Did you mean: 

Replication of Z table from CRM to R/3 - No mBDoc Created

Former Member
0 Kudos

I need to transfer the contents of a bespoke customer table from CRM into R/3, off the back of delta changes being made to the CRM table. To help us to achieve this we have performed the following steps so far:

1. Created the customer table in both systems.

2. Created a new messaging BDoc in CRM and linked it to the R/3 Site Type.

3. Created a new mapping module in CRM that takes the data from the BDoc and maps it to the BAPI structure.

4. Created a new Adapter Object that links to my BDoc, contains the new customer table as the source table in CRM and contains the mapping Module mentioned above.

5. Created a new Replication Object based on my new BDoc.

6. Created a new Publication and assigned it to the Replication Object.

7. Created a new Subscription and assigned to the Publication and Replication Object. Also assigned it to my R/3 site.

On the R/3 side we have created a mapping module to map the data from the BAPI structure into the equivalent R/3 table. We also have an entry in table CRMSUBTAB.

However when I insert an entry in the customer table in CRM no BDoc is being created. In fact I cannot see anything at all in the system that indicates that it has even tried to capture the change and invoke the Middleware process.

What am I doing wrong?

Do I need anything else (some sort of delta program?) that picks up the parameters from the table update and feed them into my process? The literature that I have found (and it is not much) does not mention anything like this though.

Any help would be greatly appreciated as this is now a very urgent requirement.

Regards

Ian

Edited by: IAN HAWLEY on Aug 21, 2008 9:42 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Ian,

Check below steps, I have explained with an example of your case:

CRM tables involved: ZCRM

R/3 tables to be updated: ZECC

Development details:

System: CRM

Adaptor Object: ZADAPTOR

Object Class: ZCLASS

Mapping Modules R/3->CRM: ZMAP_BAPIMTCS_TO_MBDOC

Mapping Modules CRM->R/3: ZMAP_MBDOC_TO_BAPIMTCS

Extractor: Z_EXTRACT_MODULE (this calls the FM u2018CRS_SEND_TO_SERVERu2019)

Customizing entries:

Table: CRMSUBTAB

CONSUMER EXT

OBJNAME ZADAPTOR

UP OR DOWN D

MOD NAME Z_EXTRACT_MODULE

OBJCLASS ZCLASS

Table: SMW3FDCUST

BDOC TYPE ZMBDOC

FCTXT MO4

CNTR 10

FNAME SMOH_REPLICATION_WRAPPER_MSG

ACTIV X

BDOC TYPE ZMBDOC

FCTXT MO4

CNTR 20

FNAME SMW3_OUTBOUNDADP_CALLADAPTERS

ACTIV X

Proxy Module to receive the data: Z_LOAD_PROXY_FINAL.

Table: CRMSUBTAB

CONSUMER CRM

OBJNAME ZADAPTOR

UP OR DOWN U

MOD NAME Z_LOAD_PROXY_FINAL

OBJCLASS ZCLASS

For Initial load, R3AS is the Tcode.

Load Object - ZADAPTOR

Source site - CRM

Destination site - OLTP ECC system

This would check the registered function module in CRMSUBTAB and if finds the function module Z_EXTRACT_MODULE and executes it. This function module calls the standard function module CRS_SEND_TO_SERVER the one triggers the other function modules are called in the following sequence.

ZMAP_BAPIMTCS_TO_MBDOC

ZMAP_ MBDOC TOBAPIMTCS

Z_LOAD_PROXY_FINAL

Z_C_UPDATE_ECC (FM updates data into ECC)

The response would again be processed in CRM through the function module

Z_C_HIER_MAP_BAPIMTCS_TO_MBDOC where the status of BDoc is set.

Hope it will helps, reply me back if problem sovled.

Bobby

Former Member
0 Kudos

Bobby

Many thanks for your reply you are a life saver. However as you probably expect I have some follow up questions. Some may just require a Yes or No answer, some may need explaining to me in more detail.

1. I assume all of the activities performed to date are still valid to supplement your solution, e.g. the BDoc, Replication Object, Publication and Subscription details?

2. The R/3 to CRM Mapping Module. Is this required to allow messages to be sent back from R/3 to update the BDoc, e.g. a sort of validation to prove that the posting has completed ok?

3. The Extractor Module in CRM. Does this get the data out of the table and will it work for deltas?

4. CRMSUBTAB in CRM. I knew that we populated this in R/3, I did not realise we would need it in CRM as I assumed it was R/3 specific.

5. You list the sequences of FM calls at the end. I was confused in the order. As we are initiating data to be sent from CRM to R/3 should some of these be in the reverse order, e.g. ZMAP_MBDOC_TO BAPIMTCS would be called before ZMAPBAPIMTCS_TO_MBOC as would pass data into the BDoc to send it to R/3 before we then received an update message back?

6. Is there a test FM available for the extract, e.g. is CRM_SAMPLE_EXTRACT_MODULE the one to copy?

Many thanks agsin for your time and patience. You really are helping as we have no other source of reference.

Please note that after today I am on leave for two weeks. If you do not mind, in my absence, if we have any further questions would it be for colleagues to contact you via this SDN blog?

Regards

Ian

Former Member
0 Kudos

Ian,

I do expected the follow up questions. Check my explanation below and hope it will answer your queries:

1. I assume all of the activities performed to date are still valid to supplement your solution, e.g. the BDoc, Replication Object, Publication and Subscription details?

2. The R/3 to CRM Mapping Module. Is this required to allow messages to be sent back from R/3 to update the BDoc, e.g. a sort of validation to prove that the posting has completed ok?

FM ZMAP_BAPIMTCS_TO_MBDOC in CRM, to map the BAPIMTCS format data and build the BDoc. This BAPIMTCS format is a temporary one and is not the final data format, that is taken to ECC. This function module also takes care of receiving the response message from ECC, once the BDoc data reaches and updates in ECC. If there is any error occured during the updation, it is captured in the error table of the BDoc and the status of BDoc is set to 'Error'. If no error occurs, the status of BDoc is set to 'Confirmed'.

3. The Extractor Module in CRM. Does this get the data out of the table and will it work for deltas?

Yes , It should work for Delta too.The delta load makes use of the same program and flow for Initial load (SMOF_DOWNLOAD)

4. CRMSUBTAB in CRM. I knew that we populated this in R/3, I did not realise we would need it in CRM as I assumed it was R/3 specific.

5. You list the sequences of FM calls at the end. I was confused in the order. As we are initiating data to be sent from CRM to R/3 should some of these be in the reverse order, e.g. ZMAP_MBDOC_TO BAPIMTCS would be called before ZMAPBAPIMTCS_TO_MBOC as would pass data into the BDoc to send it to R/3 before we then received an update message back?

Step 1: Z_EXTRACT_MODULE will be called.( It calles ZPICK_DATA_FROM_CRM). This function module calls the standard function module CRS_SEND_TO_SERVER the one triggers the other function modules

Setp 2: Creat function module ZDATA_TO_BAPIMTCS(missed to mention earlier) in CRM, to map the data in the final internal table to BAPIMTCS format. This format is temporary and will be used to build the BDoc data.

Step 3: Created function module ZMAP_BAPIMTCS_TO_MBDOC in CRM, to map the BAPIMTCS format data and build the BDoc. This BAPIMTCS format is a temporary one and is not the final data format, that is taken to ECC. This function module also takes care of receiving the response message from ECC, once the BDoc data reaches and updates in ECC. If there is any error occured during the updation, it is captured in the error table of the BDoc and the status of BDoc is set to 'Error'. If no error occurs, the status of BDoc is set to 'Confirmed'

Step 4: Created function module ZMAP_MBDOC_TO_BAPIMTCS in CRM, to build the final BAPIMTCS structure from the BDOC. This BAPIMTCS is the final data structure that goes to ECC. The table name, objectkey, relkey that is relevant for the BAPIMTCS, is filled in this function module..

Step 5: Created function module Z_LOAD_PROXY_FINAL in ECC, to receive the data from CRM. The BAPIMTCS data is received and mapped to local internal tables and then updates to custom tables through the function module Z_UPDATE_ECC. The errors if any are captured in this function module and returned back to CRM using the standard function module CRS_SEND_TO_SERVER.

To reduce the load on the interface, at the final stage, it was decided to fetch the data completely in ECC. So the incoming data from CRM is ignored and is fetched completely from ECC tables.

6. Is there a test FM available for the extract, e.g. is CRM_SAMPLE_EXTRACT_MODULE the one to copy?

No, You have to develop this Extractor FM say ZPICK_DATA_FROM_CRM and should be called in Z_EXTRACT_MODULE.

Apologize for any spelling errors, as I too running to meeting.

Update me the status.

Bobby

Edited by: Bobby on Aug 22, 2008 2:13 PM

Former Member
0 Kudos

Bobby

Thanks again. I will forward your response to colleagues of mine who will pick up the development in my absence. They may be in contact next week !

Thank You once again

Ian

Former Member
0 Kudos

Hello Bobby,

In absence of Ian, I am working o this problem. I did the config as you have advised. I am running initial load using transaction R3AS but getting the following error in CRM.

The following Errors/Warnings occured. Do you want to continue?

Z3PLN_MESG: No active entry in Table SMOFSUBTAB. Read OSS note 339787

Z3PLN_MESG: Object will not be loaded

Here Table SMOFSUBTAB is for R3AC3 or R3AC5 but my question is this program is expecting an entry in this table. This is my bespoke table nothing to do with condition tables or any customizing object. I did some debugging and message is correct. In function module u2018SMOF0_READ_SMOFSUBTAB, program is looking for an entry for my object and object class in table SMOFSUBTAB.

Thanks for your help.

Regards

Sudesh

Former Member
0 Kudos

Hi Sharma,

As far as I know, we have to maintain values in CRMSUBTAB as I mentione in my earlier replies. Make sure you check the below values maintained in tables:

1) System - CRM

Table - CRMSUBTAB

Consumer - CRM

Objname - Your Adaptor Object

Up_or_Down - D

Objclass - Your Class

Mod_name - Your Extractor FM

2) System - ECC

Table - CRMSUBTAB

Consumer - CRM

Objname - Adaptor Object

Up_or_Down - U

Objclass - Your Class

Mod_name - Your Validation module.

You have mantain this in R3AC3.

Bob

Edited by: Bobby on Aug 26, 2008 4:34 PM

Edited by: Bobby on Aug 26, 2008 4:41 PM