cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with testing SyncBO

Former Member
0 Kudos

Hi Guru's,

My client has a requirement for changing characteristics data for functional locations. For this I used following steps:

- create a copy of mam25_030 and changed the mapping for this syncbo.

- copied changed merepmeta.xml to client, and added getters/setters to the methods

- changed mapping.xml and syncbonamelist.properties, to point to the new syncbo

Now I'm having this problem:

When I test the client sending the data back to the middleware, I can see in the monitoring that the changed data is being sent back to the middleware.

I want to unit-test my changed syncbo to write the changed data back to the backend. For this I want to use MEREP_EMULATOR.

<b>I'm having trouble testing my new syncbo using merep_emulator. It seems that most of the time, the change method is not being called.</b>

Furthermore when it is called, all parameter tables are empty, apart from the funclocID.(When I sync from the frontend client to the middleware, the changed data is sent to the middleware)

Can you answer following questions please:

1. What is the right sequence to test the syncbo using merep_emulator. (can I pick any message from any device?)

2. How can I make sure the change method is being called.

3. How can I test AND DEBUG the syncbo using merep_emulator

4. Did I forget something, or make a false assumption on the process?

Many Thanks in advance,

Karst

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Karst,

We can test our syncbo easily by using EMULATOR:

1) Go to transaction se38 and give the program name as MEREP_EMULATOR and press F8

2) Give your syncbo name and Mobile ID (Mobile ID for your client can be obtained from MEREP_PD transaction in MobileID tab(clik the tab) and press F4 and give your deviceID from client-->settings in DEviceGUID and press enter)

3)press F8

A) Checking simple download(whether all data has come to client from middleware)

1) Again press F8

2) go to transaction se16 and give MEREP_10700 table name

3) Press enter and fill the details mobileID and syncbo name against scenario.

4) press no. of entries tab

5) We get the no. of records for that syncbo downloaded from middleware to client

MEREP_10700 is DB for client

MEREP_207 IS db for Middleware

B) Want to add,delete,change records through emulator

1) Click on header to add, delete change records and press synckey editbox and then press generate new synckey button and in "action type" colomn give 'A' for adding, 'M' for modify,'D' for deleting record

c) For modifying

1)Press ctl+f1 to see all data(records) in client, so we can pick up any record and try to modify that(When we pick up any record all data will be filled in the tables(TOP,010,020 etc) and press F8 after modifying data.

And finally we can check in backend to see whether that added,modified,deleted records match in backend

So thus by using EMULATOR we can test syncbo from middleware by using mobileID of our client

Hope this is lengthy but useful

Cheers,

Karthick

Former Member
0 Kudos

Thanks Karthick,

Can I take any of the messages, even ones for another device?

When I tried to debug, the parameters I assigned in the syncbo (getdetail and change) are not filled. What could be the problem?

What could be the problem that the change method is not being called?

Can I set a breakpoint in the change method, to debug? (It seems it is being called in another session)

Thanks for your helpful answer!

Karst

Former Member
0 Kudos

Hi Karst,

<Can I take any of the messages, even ones for another device?>

Ya we can take any valid deviceID to test our syncbo..But it would be safer side if we use our own deviceID(which has been taken from our client>settings>deviceID)

<When I tried to debug, the parameters I assigned in the syncbo (getdetail and change) are not filled. What could be the problem?>

May be the Getdetail bapi is not returning the records properly..Can you explain the problem little bit clearly

<What could be the problem that the change method is not being called?>

What do you mean by change method is not being called?

I am little bit confused here..can you kindly eloberate the quiries....

Cheers,

Karthick

Former Member
0 Kudos

Hi Karthick,

What I am trying to do is following:

1. I take a message and open it in merep_emulator. when opening the message, I change the modification charachter to M - modify

2. I change some entries in the subitems (170 for me)

3. I execute the emulator

What I expect is that when I set a breakpoint in the onChange method I created for this syncbo, It stops for debugging. This does not work. (What I actually do is create an infinite loop, and use sm50 on the backend to tap into the method.)

I also expect that, as I made some changes and the action-type = M (modify) that my syncbo method onChange gets called every time I test this.

When I get debugging to work, then the TABLES of the function module (ZMAM25_030_CHANGE in my case) are empty. The only field filled is the TPLNR in the header import parameter).

As far as I understand the emulator first executes the getDetail method for the header file. It gets the subitems back from the middleware replication database. Then it compares it to the client database, and when changes are there, it calls the onChange method for the syncbo.

cheers,

Karst

Former Member
0 Kudos

Hi Karst,

What you said is correct.

But when you select messege for modify..you would have observered that synckey automatically gets filled.

<b>But you can set a break point at function modules generated for your syncbo...

go to merep_sbuilder and place your syncbo name..GOTO-->Generated function module and you can select T03 which is used to upload data....</b>

You get more info from this

Generally when ever we add,delete records from emulator it will work very fine and we can check the same from backend.

The problem is with modify..we need to select the correct messege from an existing records list on our device?

Generally middleware gets getlist bapi first them based on getlist it will invoke getdetail..same implies to client also..

Lets try this and see

Cheers,

Karthick

Former Member
0 Kudos

> Generally when ever we add,delete records from

> emulator it will work very fine and we can check the

> same from backend.

>

> The problem is with modify..we need to select the

> correct messege from an existing records list on our

> device?

Can you explain what record, and how I can check the correct settings in merep_10700 and merep_207??

> Generally middleware gets getlist bapi first them

> based on getlist it will invoke getdetail..same

> implies to client also..

To use the emulator, do I have to create new syncID's every time I want to use an existing message?

thanks,

Karst

Former Member
0 Kudos

Hi Karst,

Here goes the explanation:

1) MEREP_207 is the middleware DB table name for T01/T51 syncbo types.

MEREP_10700 is the DB table name(LOG) for client.

So we can check both the tables to conform that all records from middleware are getting to client DB.(This is only testing from middleware) Once we sync the client all data from MEREP_10700 will come to client.

So once our syncbo is replicated from backend to middleware.

We can check the no. of records present in middleware using MEREP_207

Go to transaction se16 and place this table name and press enter and we need to fill syncbo name against SCENARIO and TOP or 010 or 020....against STRUCT_ID(This is Optional) and <b>press number of entries</b> tab..we get the no. of records for that syncbo......

Once we download the data by using emulator......all data in middleware should be present in client so we can check even this from middleware itself..

Similarlly as above goto transaction SE16 and fill table name as MEREP_10700 and press enter and fill with your mobileID against MBL_ID and your syncbo name against SCENARIO and TOP or 010 or 020 ....against STRUCT_ID (optional)

and press <b>press number of entries</b> tab and we get the no. of records that has been downloaded..so we can compare the no. of records in table MEREP_207 and no. of records in table MEREP_10700 and we find that both are equal so download to client is succesfull....(Keep in mind that cascade relationship has to be maintained..means if at all child syncbos data should come to client its parent syncbo data should be present in client)

2) We will be using our SYNCBO IDs for emulator.

Coming to synckey if at all we need to add /delete records we need to generate a synckey..as i said earlier..click on the synckey editbox and press generate new synckey button(red in clor...top left)..so it will assign a synckey

If at all we need to modify an existing records we have to click ctlr+F1 to get the list of records already existing in client (as well as middleware) so we can pick any one of them (probably TOP) to modify/add new child records etc ..here synckey will be assigned (no ned to generating it ..) (THIS IS THE CONCEPT OF LOCAL SYNCKEY AND GLOABAL SYNCKEY)

So no need of creating new synckey for an existing messege(record) to get it modified.

Finally MEREP_10100 is the DB table for client in middleware for S01 type of syncbo.

Hope this is little helpful.

Cheers,

Karthick

Former Member
0 Kudos

Hi Karst,

Also the most important thing when using Emulator is that the behaviour of Emulator is different based on Service Packs. If the Service Pack is less than and equal to SP18. You need take care of using the State_id concept and you need to set it during debugging. This important during conflict check.

If ther Service Pack more than SP18 then for the emulator does not need to state_id check as the concept is removed.

Also emulator does not always send the delta data, it is the reponisbility of the user to ensure only the changed records are retained and other records are manually deleted before syncing with the middlware.

The middlware assumes that Client always sends the changed data not all. Hence emulator needs to send only changed data.

Emulator Always works in Synchronous mode and does work in Asynchronous way. And cannot be used for testing Asynchronous behaviour of SyncBOs.

Thanks...

Former Member
0 Kudos

Hi Karst,

When unit testing the syncbo, we use emulator(testing from middleware and backend)

So Emulator can be used to test initial download, delta download,creating records,deleting records,modifying records.

So EMULATOR is used to unit test Syncbo

As Preetham said we need to see the SP s also.

Cheers,

Karthick

Former Member
0 Kudos

Hi Preetham,

> Also the most important thing when using Emulator is

> that the behaviour of Emulator is different based on

> Service Packs. If the Service Pack is less than and

> equal to SP18. You need take care of using the

> State_id concept and you need to set it during

> debugging. This important during conflict check.

> If ther Service Pack more than SP18 then for the

> emulator does not need to state_id check as the

> concept is removed.

We are running SP15. Can you explain to me how the State-id concept works, and where I can set it during debugging?

> Also emulator does not always send the delta data, it

Hmmmm, "not always send th delta". I noticed this behaviour. How is this behaviour invoked? How can I make sure for a testcase that the delta is sent and triggering of the change method is invoked?

> is the reponisbility of the user to ensure only the

> changed records are retained and other records are

> manually deleted before syncing with the middlware.

Also, I started new with clean tables on middleware and client. then I did the replication and syncing with the client. I notices that the data on table MEREP_207 and MEREP_10700 are in sync as well as the data present on the client.

Now I want to test a change. I use merep_emulator, to take a record already synced to the client (Ctrl +F1) and select action modify for all entries. (I understand it takes these records from MEREP_10700)

Then I make some changes to the data. For this to work do you suggest I delete the original record from MEREP_010700 ???

> The middlware assumes that Client always sends the

> changed data not all. Hence emulator needs to send

> only changed data.

So I should only send the data lines that are actually changed, not all, and how about the header record, do I have to send it along when 1 line of a subitem has changed?

> Emulator Always works in Synchronous mode and does

> work in Asynchronous way. And cannot be used for

> testing Asynchronous behaviour of SyncBOs.

Yes, but I'm just trying to test the change behaviour, synchronous i fine for me...

Thank you very much Preetham!

Former Member
0 Kudos

Hi Karthick,

We're SP15.

I'll try to delete all non-changed items from my testcase, and see what happens....

cheers,

Karst

Former Member
0 Kudos

Hi Karst,

Its fine that you are using SP15.

<<<<Also, I started new with clean tables on middleware and client. then I did the <replication and syncing with the client. I notices that the data on table <MEREP_207 and MEREP_10700 are in sync as well as the data present on the <client.

<Now I want to test a change. I use merep_emulator, to take a record already <synced to the client (Ctrl +F1) and select action modify for all entries. (I <understand it takes these records from MEREP_10700)

<Then I make some changes to the data. For this to work do you suggest I delete <the original record from MEREP_010700 ???>>>>>>

<b>According to me i dont think that you need to delete the original record..

And Modifying a syncbo means...modifying some data to header,items OR deleting items OR adding new items...so if we are adding new item records we select action as 'A' for that particular item coloumn.</b>

> The middlware assumes that Client always sends the

> changed data not all. Hence emulator needs to send

> only changed data.

So I should only send the data lines that are actually changed, not all, and how about the header record, do I have to send it along when 1 line of a subitem has changed?

Yes we have to send header record if 1 of its item changes..becaz by using header record only middleware or our bapi wrppers in backend modifies that item record...items are always recognized by its header.......

Only those modified records are send from client to middleware..its true...

Modify means Adding new records,deleting new records,modifying existing records....so all this can be performed by using emulator......

One more thing we need to observe is client DB is MEREP_10700 means all records existing in client will be reflected in outbox of client i.e.merep_10700.....I dont think its required to delete non- changed records...let it be as itis..it should not create any problem

Hope this is clear...:)

Cheers,

Karthick

Former Member
0 Kudos

Thanks Karthick,

Can you explain the "State_id concept" that Preetham was talking about.

It's new to me!

And it seems like I'm doing everything right, but I don't get it to work!

cheers,

Karst

Former Member
0 Kudos

Hi Karst,

Kindly let me know if you have any furthur clarifications regarding your issue.

So I hope MEREP_207 and MEREP_10700 concepts are clear.

Cheers,

Karthick

Former Member
0 Kudos

Hi Karst,

When data is replicate to the middlware in case of T01/T51 syncbos we create a id that is generated using GUID fm. When client downloads the data, this id is transferred to the client.

So when the replicator runs for the second time, we change the id of the records that have already been downloaded on to the client in the table merep_207.

When client sends data to the middleware, we check the if the current id of the data in the table merep_207 is same as the one sent from the client. If different we do conflict check with data present in the Middleware since the data is latest here. IF the state id is same then we fetch data from the backend do the confllict check. This is done T02/T52 FM of the Func Grp of SyncBO.

So in your case the emulator does not generate the state id, and internall it always fetches data from the RDB not the backend, irrespective of the replicator has run or not.

But since your SP is SP15, you will have to put break-point in T02/T52 FM at the below line.

IF ( LDS_WK_RDB_H-STATE_ID <> LDS_H_FROM_MBL-PRESTATE_ID ).

ensure that both values are equal if the data needs to be fetched from BE for conflict check else leave it as it is if conflict checks needs to be done with data in RDB.

Thanks...

Former Member
0 Kudos

Preetham / Karthick,

Finally I can "emulate" my changed syncbo.

Preetham, your last post to change the values in the breakpoint in T02 did the trick.

<u><b>Thank you both very much !! </b></u>

I was already able to debug the entire syncronisation and get it to work.

I'll award you both maximum points.

Cheers,

Karst

Answers (0)