cancel
Showing results for 
Search instead for 
Did you mean: 

Data in server is not updated

Former Member
0 Kudos

i have modify the data STREET to "ANG MO KIO"

http://i192.photobucket.com/albums/z231/yzme/d1.gif

but the data in server still "HEAVEN ST"

http://i192.photobucket.com/albums/z231/yzme/d2.gif

I am using Time2Way T01, if it is when i sync the data will be uploaded, or do i need to configure somewhere to get the data upload ?

if the data in client and middleware is different, when i sync , the data from the middleware will again download to the client replace the modified values

OR

the data in the client will uploaded to the middleware and trigger the MODIFY bapi wrappers ?

<b>

when i check my MEREP_MON, and MEREP_LOG there is no data inside this meaning after i changed the values and perform the sync, Inbox and Outbox still remain the previous data as well as inside the MEREP_LOG,

is it the bapi wrapper not call by the client ?

</b>

and i find out that my bapi not get called, what additional code should i add instead of the code below.

DO I NEED TO IMPLEMENT SOME CODE FOR UPLOADER ??

do i have to change the reqDirectSync="true", if yes, how do i changed, just change inside the editor, or there is somewhere to configure in sapgui

after i changed the data , i try to sync, and i check on merep_mon

what specific or additional steps i need to configure, on uploader / receiver or synchronizer

<b>i do not implement any syncBoDelta or global reset ?</b>Can someone explain the term "delta" to me and its activities?

if i have upload something, and sync, the Inbox should have something right ??

i just put add this code to modify my records


public String modifyRecord(String eventName,boolean didNavigate){
					String syncBoName="ZCON";
					String syncKey="0001230297";
					tableViewBean.setString(syncBoName +" "+syncKey);
					System.out.println("SyncBoName: " +syncBoName + " syncKey: " +syncKey);
					tcp = TableContentProvider.instance(syncBoName);
 
					tcp.modifyTable(syncBoName,syncKey);							return JSP_DETAIL_SYNCBOINSTANCE;
				}
 
public void modifyRecord(String syncBoName,String syncKey){
SyncBoDescriptor sbd=null;
sbd=descriptorFacade.getSyncBoDescriptor(syncBoName);
SyncBo sb=null;
try{
System.out.println("bp 2");
sb=dataFacade.getSyncBo(sbd,syncKey);
}catch(PersistenceException pex){
System.out.println("Exception in modifyRecordLoc:" +pex.getMessage());
}
		
SmartSyncTransactionManager transactionManager;
try{  transactionManager=dataFacade.getSmartSyncTransactionManager();
if(!transactionManager.isTransactionStarted()){
transactionManager.beginTransaction();
boolean b8=false;
b8=setHeaderFieldValue2(sb,"STREET","ANG MO KIO");
transactionManager.commit();
SetSendType();
listAllOutDelta();
checkInboxConflict();

}
}catch(Exception e){
System.out.println("Exception in modifyRecordAmt2:" +e.getMessage());
		  }
		
	  }

public void checkInboxConflict(){
		ErrorConflictInbox errorConflictInbox= SmartSyncRuntime.getInstance().getInboxNotifier().getErrorConflictInbox();

		MeIterator iter;
		SyncBoResponse resp;
		try {
		iter= errorConflictInbox.getAllSyncBoResponses();
		while(iter.hasNext()){
		resp= (SyncBoResponse)iter.next();
		String bo=resp.getSyncBoDescriptor().getSyncBoName();//SyncBo Name
		String state=resp.getSyncBoResponseState().toString(); 
		String res=resp.getResponseType().toString();//Get the SyncBo response type (conflict or ERROR)
		String msg=resp.getText();// This will return the exact message from the server
		System.out.println("bo:" +bo +" state: " +state +" res: " +res +" msg:" +msg);
		System.out.println("state:" +resp.getSyncBoResponseState().toString());
		if(resp.getSyncBoResponseState().equals(SyncBoResponseState.INITIAL)){
			String a=resp.getSyncBoResponseState().toString();
			resp.acceptClientSyncBo();
			String b=resp.getSyncBoResponseState().toString();
			resp.delete();
			System.out.println("state1: " +a +"state2: " +b);
		
		}

		
		}
		boolean syncStatusComplete= SmartSyncRuntime.getInstance().getInboxNotifier().isSyncStatusComplete();
		System.out.println("syncStatus:" +syncStatusComplete);
		}catch (Exception e) {
		e.printStackTrace();
		}
	}

public void listAllOutDelta(){
		SyncBoOutDeltaFacade deltFac=SmartSyncRuntime.getInstance().getSyncBoOutDeltaFacade();
		MeIterator allDelta;
		try {
			allDelta = deltFac.getAllDelta();
			while(allDelta.hasNext()){
					SyncBoOutDelta outDelta=(SyncBoOutDelta)allDelta.next();
					System.out.println("SyncKey:" +outDelta.getSyncKey() +" Action:" +outDelta.getAction()
							+" State:" +outDelta.getStateId() +" SendType:"+outDelta.getSendType());
			}
		} catch (SmartSyncException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (PersistenceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}	
	}

public void SetSendType(){
		SmartSyncRuntime ssRuntime = SmartSyncRuntime.getInstance();
		SyncBoOutDeltaFacade boDeltaFacade = ssRuntime.getSyncBoOutDeltaFacade();
		SyncBoDescriptorFacade descF = ssRuntime.getSyncBoDescriptorFacade();
		SyncBoDescriptor myBO = descF.getSyncBoDescriptor("ZCON");
		boDeltaFacade.setSendType(myBO, SyncBoOutDeltaSendType.SEND_DIRECT);
//SyncManager.getInstance().synchronizeWithBackend(VisibilityType.USER_SHARED);
	}

	
	public boolean setHeaderFieldValue2(
		SyncBo sb,
		String headerFieldName,
		Object value) {
		SyncBoDescriptor sbd = sb.getSyncBoDescriptor();
		//RowDescriptor trd = sbd.getTopRowDescriptor();
		System.out.println("bp 10");
		RowDescriptor trd=sbd.getRowDescriptor("010");
		System.out.println("bp 11");
		FieldDescriptor fd = trd.getFieldDescriptor(headerFieldName);
		System.out.println("fd:" +fd.getFieldName());
		if (fd != null) {
		BasisFieldType bft = fd.getFieldType();
		//Row header = sb.getTopRow();
		System.out.println("bp 12");
		//Row header = null;
		Row[] header=null;
		//try {
			//header = sb.getRow("0001211181");
			//header=sb.getTopRow();
			header=getItemInstances(sb,"010");
		
			if(header==null){
				System.out.println("is null");
			}else{
				System.out.println("not null");
			}
			
		//} catch (PersistenceException e1) {
			// TODO Auto-generated catch block
		//	System.out.println("Exception getRow:" +e1.getMessage());
		//	e1.printStackTrace();
			
		//}
		System.out.println("bp 13");
		
		try {
//		   Integer operator
		if (bft == BasisFieldType.N) {
			System.out.println("Numeric");
		NumericField nf = header[0].getNumericField(fd);
		if (nf != null) {
		BigInteger ii = new BigInteger(value.toString());
		nf.setValue(ii);
		return true;
		} else {
		return false;
		}
		}
//		   Character operator
		if (bft == BasisFieldType.C) {
			System.out.println("Character");
		CharacterField cf = header[0].getCharacterField(fd);
		if (cf != null) {
		cf.setValue(value.toString());
		return true;
		} else {
		return false;
		}
 
		}
//		   Decimal operator
		if (bft == BasisFieldType.P) {
			System.out.println("Decimal");
		DecimalField df = header[0].getDecimalField(fd);
		System.out.println("bp 1.1");
		if (df != null) {
			System.out.println("bp 1.2");
		BigDecimal bd = new BigDecimal(value.toString());
		System.out.println("bp 1.3");
		df.setValue(bd);
		System.out.println("bp 1.4");
		return true;
		} else {
			System.out.println("bp 1.5");
		return false;
		}
 
		}
//		   Similar operation for time and date operator fields
		if (bft == BasisFieldType.D) {
			System.out.println("Date");
		DateField df = header[0].getDateField(fd);
		if (df != null) {
		if (value.toString().equals("0")) {
		Date dat = Date.valueOf("0000-00-00");
		df.setValue(dat);
		} else if (!value.toString().equals("")) {
		Date dat = Date.valueOf(value.toString());
		df.setValue(dat);
		} else {
		Calendar cal = Calendar.getInstance();
 
		java.sql.Date bd =
		new java.sql.Date(cal.getTime().getTime());
 
		df.setValue(bd);
		}
		return true;
		} else {
		return false;
		}
 
		}
 
//		   Similar operation for time and date operator fields
		} catch (SmartSyncException ex) {
		System.out.println(ex.getMessage());
		} catch (PersistenceException e) {
		System.out.println(e.getMessage());
		}
		}
		return false;
		}



SyncType: T01 Wrapper: GetList,GetDetail,Modify


  <?xml version="1.0" encoding="utf-8" ?> 
- <MeRepApplication schemaVersion="1.1" id="ZCON" version="01">
  <Property name="CLIENT.BUILDNUMBER" /> 
  <Property name="C_APPLRESOLVE" /> 
  <Property name="DATA_VISIBLE_SHARED">X</Property> 
  <Property name="E_APPLRESOLVE" /> 
  <Property name="FACADE_C_CLIENT">X</Property> 
  <Property name="FACADE_E_CLIENT">X</Property> 
  <Property name="HOMEPAGE.INVISIBLE" /> 
  <Property name="INITVALUE" /> 
  <Property name="RUNTIME">JSP</Property> 
  <Property name="TYPE">APPLICATION</Property> 
- <SyncBO id="ZCON" version="1" type="timedTwoWay" allowCreate="false" allowModify="true" allowDelete="false" reqDirectSync="false" downloadOrder="1">
- <TopStructure name="TOP">
- <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">
  <Input type="create">false</Input> 
  <Input type="modify">false</Input> 
  </Field>
- <Field name="PERSNUMBER" type="N" length="10" decimalLength="0" signed="false" isKey="false" isIndex="false">
  <Input type="create">false</Input> 
  </Field>
- <ChildStructure name="010">
- <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">
  <Input type="create">false</Input> 
  <Input type="modify">false</Input> 
  </Field>
- <Field name="PERSNUMBER" type="N" length="10" decimalLength="0" signed="false" isKey="false" isIndex="false">
  <Input type="create">false</Input> 
  </Field>
- <Field name="CITY1" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">
  <Input type="create">false</Input> 
  </Field>
- <Field name="CITY2" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">
  <Input type="create">false</Input> 
  </Field>
- <Field name="STREET" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">
  <Input type="create">false</Input> 
  </Field>
- <Field name="HOUSE_NUM" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">
  <Input type="create">false</Input> 
  </Field>
- <Field name="REGION" type="C" length="40" decimalLength="0" signed="false" isKey="false" isIndex="false">
  <Input type="create">false</Input> 
  </Field>
  </ChildStructure>
  </TopStructure>
  </SyncBO>
  </MeRepApplication>

Message was edited by:

yzme yzme

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

DO i HAVE to implement a sync listener class to upload the data ?

Former Member
0 Kudos

hi yzme,

sorry for not replying to your emails.

regarding your query/post, there's one thing unclear.

first your querying for a syncbo named "ZCON", but this syncbo is not defined

in your metadata.

>if the data in client and middleware is different, when i sync , the data from the >middleware will again download to the client replace the modified values

>OR

>the data in the client will uploaded to the middleware and trigger the MODIFY

> bapi wrappers ?

when the same data is modified in the client and at the same time in the server,

this causes a conflict during the synchronization. if error/conflict handling is not

set to application resolved, the middleware will always win and the modified client

data will be replaced by the server image.

if your data is not displayed in the worklist monitor, it may be that your data was

not uploaded. you can create a functionality in your app to list all syncbooutdelta

data which are to be uploaded there are APIs to do this.

check also if your data is not a local syncbo i.e. suppressUpload attribute is set

to true. which for this case, no modified data will be uploaded for that syncbo.

>DO i HAVE to implement a sync listener class to upload the data ?

not necessarily. it depends if there's a need for your app to do something on the

data prior to upload. but for this basic case, it is not required.

hope this helps.

jo

Former Member
0 Kudos

1)i have changed the above metadata, but in the meta-data i dun have the attribute that you mentioned , <b>suppressUpload </b>.

2)meaning , i have to change the conflict/error handling to application in the mi_mcd.

3) my data is not in worklist monitor, no data uploaded, the purpose of list all syncbooutdelta data? can you provides me the code snippet ?

4) how to check data is local syncBo? local SyncBo doesnt allow data to be uploaded into the middleware right, in my metadata there is no attribute call suppressUpload attribute, does it mean that it is NOT a local SyncBO ?

5) i dont need this code for sync ??


public void Sync(){
SmartSyncRuntime ssRuntime = SmartSyncRuntime.getInstance();
SyncBoOutDeltaFacade boDeltaFacade = ssRuntime.getSyncBoOutDeltaFacade();
SyncBoDescriptorFacade descF = ssRuntime.getSyncBoDescriptorFacade();
SyncBoDescriptor myBO = descF.getSyncBoDescriptor("ZCON");
boDeltaFacade.setSendType(myBO, SyncBoOutDeltaSendType.SEND_DIRECT);
SyncManager.getInstance().synchronizeWithBackend(VisibilityType.USER_SHARED);
}

Former Member
0 Kudos

see inline.

> 1)i have changed the above metadata, but in the

> meta-data i dun have the attribute that you mentioned

> , <b>suppressUpload </b>.

if you don't see this attribute, then your syncbo is set to upload delta data. but

you have to check if you have some codelines suppressing the upload at runtime.

> 2)meaning , i have to change the conflict/error

> handling to application in the mi_mcd.

if you want your application to resolve the error/conflict, then you have to set this

on your MCD via mi_mcd.

> 3) my data is not in worklist monitor, no data

> uploaded, the purpose of list all syncbooutdelta

> data? can you provides me the code snippet ?

here's a sample code. this will list your delta data in the client.


SyncBoOutDeltaFacade deltFac = SmartSyncRuntime.getInstance().getSyncBoOutDeltaFacade();
MeIterator allDelta = deltFac.getAllDelta();
while(allDelta.hasNext()){
SyncBoOutDelta outDelta = (SyncBoOutDelta)allDelta.next();
//print them one by one; refer to SyncBoOutDelta interface for details
//on what it offers.
System.out.println("SyncKey:"+outDelta.getSyncKey()+" Action:" + outDelta.getAction());
}

> 4) how to check data is local syncBo? local SyncBo

> doesnt allow data to be uploaded into the middleware

> right, in my metadata there is no attribute call

> suppressUpload attribute, does it mean that it is NOT

> a local SyncBO ?

the characteristic of a local syncbo is that it has these attributes set to true:

- suppressUpload and suppressDownload

> 5) i dont need this code for sync ??

if you are trying to create a sync button within your application then you might

need it, but generally speaking it is not recommended. for generic sync apps,

it is sometimes necessary.

jo

Former Member
0 Kudos

<u>my intention is very simple, i just need to update a field in a row and update to the middleware so that the backend will reflect the changes. </u>

>2 if i set the conflict/error handling to application, then i should have to implement some code for it, right ?

>3) List syncbooutdelta

<b>SyncKey:0001233035 Action:M SendType:SEND</b>

doesnt it mean that when i sync , the uploader will pick up this data and do a modification ??

i have change the metadata like this

<SyncBO id="ZCON" version="1" type="timedTwoWay" allowCreate="false" allowModify="true" allowDelete="false" reqDirectSync=<b>"true" </b>downloadOrder="1">

1) i try to sync the application and check the worklist monitor, there is nothing in the inbox ? how come ?

2)if i test using emulator, i try to modify a value and execute, i am getting the following error.

<u>

Header action from mobile="MOD", R/3 action="ADD"

Return code 1 (DOWNLOADER)

</u>

i try to modify not "Add"

3) I am using Time 2 Way , how to check it is synchronous or asynchronous ? in merep_sbuilder, the default asyn. is checked, meaning async ??

the type is T01 , ASYNC

4)

public void checkInboxConflict(){

ErrorConflictInbox errorConflictInbox= SmartSyncRuntime.getInstance().getInboxNotifier().getErrorConflictInbox();

MeIterator iter;

SyncBoResponse resp;

try {

iter= errorConflictInbox.getAllSyncBoResponses();

while(iter.hasNext()){

resp= (SyncBoResponse)iter.next();

String bo=resp.getSyncBoDescriptor().getSyncBoName();//SyncBo Name

String state=resp.getSyncBoResponseState().toString();

String res=resp.getResponseType().toString();//Get the SyncBo response type (conflict or ERROR)

String msg=resp.getText();// This will return the exact message from the server

System.out.println("bo:" +bo +" state: " +state +" res: " +res +" msg:" +mtext);

}

boolean syncStatusComplete= SmartSyncRuntime.getInstance().getInboxNotifier().isSyncStatusComplete();

System.out.println("syncStatus:" +syncStatusComplete);

}catch (Exception e) {

e.printStackTrace();

}

}

<u>bo:ZCON state: INITIAL res: CONFLICT msg:Conflict: R/3 = delete, device = modify

SyncStatus=true (complete)

</u>

5) after that i change my code to this

while(iter.hasNext()){

if(resp.getSyncBoResponseState().equals(SyncBoResponseState.INITIAL)){

String a=resp.getSyncBoResponseState().toString();

String a1=syncBO.getSyncState().toString();

resp.acceptClientSyncBo(); //No transaction stated to commit

resp.delete();

String b=resp.getSyncBoResponseState().toString();

String b2=syncBO.getSyncState().toString();

System.out.println("state1: " +a +"state2: " +b);

System.out.println("SyncState1: " +a1 +"SyncState2: " +b1);

}

}

<u>state1: INITIAL state2: RESOLVED </u>

<u>SyncStatus1:QUANRANTINE SyncStatus2: INCONSISTENT</u>

and i try to sync ...no data in worklist

6)i try to list out all the delta to be uploaded

ListAllOutDelta to be upload

<u>SyncKey:0001233349 Action:I State:99925F8E24DFFE49A4563C5E018E9B61 SendType:SEND

</u>

i am modifying the rows, not Insert a new row, the Action:'I' instead of 'M', pls clarify on this.

after i sync, i found out that there is 2 record with different syncKey but same primary key and all attributes appear to be same except the attribute that i changing.

<u>SYNCKEY PERSNUMBER CITY STREET HOUSENO</u>

0001230298 000000000 HELL <u>ANG MO KIO</u> 0123456789 (modified record)

0001230299 000000000 HELL <u>HEAVEN ST</u> 0123456789(old record)

i check the application and found out that the previous record that i modify have its value changing locally but not updated into the backend, after sync, there is another record downloaded into this application which is the old record before i modify with different syncKey.

but when i check the backend table, there is only 1 record inside, because i dont implement the 'Create' Bapi.

does it make sense ?

7) when i check my client , the data is persisted with modified value , but the changes is not reflected in the server, how come the data in client is not uploaded to the server.

acceptClientSyncBo will make the client wins how come the data is not get updated in server ?

According to him, can anyone translate the things highlighted below

##########################################################

##########################################################

for modifying one sync bo instance , there is no need to use createUnlinkedCopy()..

just use like this..

sb = dataFacade.getSyncBo(sbd,key);

SmartSyncTransactionManager transactionManager;

transactionManager = dataFacade.getSmartSyncTransactionManager();

transactionManager.beginTransaction();

setHeaderFieldValue(sb,"PERSNUMBER","9866321467");

setHeaderFieldValue(sb,"FIRSTNAME","RajaSekhar");

setHeaderFieldValue(sb,"LASTNAME","Varigonda");

setHeaderFieldValue(sb,"PROFESSION","Technical Specialist");

setHeaderFieldValue(sb,"SEX","MALE");

setHeaderFieldValue(sb,"BIRTHDAY","1977-09-28");

setHeaderFieldValue(sb,"HEIGHT","165");

setHeaderFieldValue(sb,"WEIGHT","75");

// Commit the transaction

transactionManager.commit();

setHeaderFieldValue - can be used to set value in new sync bo instance , or modify the instance.

<b>

But one main think here have to consider is , if you have created one Sync Bo instance , not synchronized with back end and u have modified that, then thats just like a creation .So during sync this will call Create Bapi Wrapper.

</b>

But after synchronization , is u are modifying that instance , then it is a modification(will call MODIFY Wrapper in back end during synchronization). u must have the right to modify this instance in the client side.

hope u got it.

u can debug MI Applications in NWDS.

refer this blog written by Arun

/people/arunkumar.ravi/blog/2006/02/22/execute-debug-your-mi-code-from-nwds

let me know , if u have doubts

Regards

Kishor Gopinathan

####################################################################################################################

pls comment...

Former Member
0 Kudos

> >2 if i set the conflict/error handling to

> application, then i should have to implement some

> code for it, right ?

yes you will need to implement how your app will handle the error/conflict cases.

when the applresolve flag is enabled, MI framework will not apply the server-side

data once received in the client. refer to SmartSync APIs - ErrorConflictInbox etc...

> >3) List syncbooutdelta

> <b>SyncKey:0001233035 Action:M SendType:SEND</b>

> doesnt it mean that when i sync , the uploader will

> pick up this data and do a modification ??

since the send type is SEND, it will send the delta data of the SyncBo 0001233035.

> i have change the metadata like this

> <SyncBO id="ZCON" version="1" type="timedTwoWay"

> allowCreate="false" allowModify="true"

> allowDelete="false" reqDirectSync=<b>"true"

> </b>downloadOrder="1">

>

> 1) i try to sync the application and check the

> worklist monitor, there is nothing in the inbox ? how

> come ?

after you changed your xml metadata, did you re-deploy your application?

after making changes to the xml metadata file (meRepMeta.xml), you need to

include it into your app archive and re-upload it to the nwa. remove previously

assigned app from the MI client and re-assign the new app to your device again.

> 2)if i test using emulator, i try to modify a value

> and execute, i am getting the following error.

> <u>

> Header action from mobile="MOD", R/3 action="ADD"

> Return code 1 (DOWNLOADER)

> </u>

> i try to modify not "Add"

check your BAPI implementation. it might try to ADD the record if it couldn't find

the record your are trying to MOD.

> 3) I am using Time 2 Way , how to check it is

> synchronous or asynchronous ? in merep_sbuilder, the

> default asyn. is checked, meaning async ??

> the type is T01 , ASYNC

if it is checked, then it's ASYNC. to check, try generating the metadata and

check on the reqDirectSync attribute. if set to true, it will synchronous; otherwise,

async.

>4,5,6

> <u>bo:ZCON state: INITIAL res: CONFLICT msg:Conflict:

> R/3 = delete, device = modify

> SyncStatus=true (complete)

> </u>

> ListAllOutDelta to be upload

> <u>SyncKey:0001233349 Action:I

> State:99925F8E24DFFE49A4563C5E018E9B61 SendType:SEND

> </u>

>

> i am modifying the rows, not Insert a new row, the

> Action:'I' instead of 'M', pls clarify on this.

that's a normal behavior. the data you were trying to modify was already deleted

from the server (this is what "R/3 = delete" means). now, since you accepted the

data in your client, MI will now create the INSERT request rather than modify

(coz there's nothing to modify, right?).

in short, your previous request was MOD, but since the data is already deleted

from the backend, in an ordinary case without the conflict handling, M/W will

send a DEL request to the client and the MI client will delete the modified SyncBo;

losing your modifications. now that you have implemented the conflict handling,

MI will not automatically apply the message (i.e. removing your client SyncBo).

and since you chose acceptClientSyncBo(), your data will be considered a new

one and will be inserted into the backend again on the next sync and will be

assigned a new key.

> after i sync, i found out that there is 2 record with

> different syncKey but same primary key and all

> attributes appear to be same except the attribute

> that i changing.

>

> <u>SYNCKEY PERSNUMBER CITY STREET HOUSENO</u>

> 0001230298 000000000 HELL <u>ANG MO KIO</u>

> 0123456789 (modified record)

> 0001230299 000000000 HELL <u>HEAVEN ST</u>

> 0123456789(old record)

> i check the application and found out that the

> previous record that i modify have its value changing

> locally but not updated into the backend, after sync,

> there is another record downloaded into this

> application which is the old record before i modify

> with different syncKey.

> but when i check the backend table, there is only 1

> record inside, because i dont implement the 'Create'

> Bapi.

> does it make sense ?

yes it make sense. if you don't have the Create BAPI, you middleware might not

be able to handle the INSERT request and your client won't received the actual

synckey assigned by the backend.

> 7) when i check my client , the data is persisted

> with modified value , but the changes is not

> reflected in the server, how come the data in client

> is not uploaded to the server.

> acceptClientSyncBo will make the client wins how come

> the data is not get updated in server ?

you already mentioned the cause. you don't have the Create BAPI and acceptClientSyncBo

will send an INSERT request for the of device=MODIFY and R/3=DELETE.

hope things clear to you now.

regards

jo

Former Member
0 Kudos

In response to this

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>4,5,6

> bo:ZCON state: INITIAL res: CONFLICT msg:Conflict:

> R/3 = delete, device = modify

> SyncStatus=true (complete)

>

> ListAllOutDelta to be upload

> SyncKey:0001233349 Action:I

> State:99925F8E24DFFE49A4563C5E018E9B61 SendType:SEND

>

>

> i am modifying the rows, not Insert a new row, the

> Action:'I' instead of 'M', pls clarify on this.

that's a normal behavior. the data you were trying to modify was already deleted

from the server (this is what "R/3 = delete" means). now, since you accepted the

data in your client, MI will now create the INSERT request rather than modify

(coz there's nothing to modify, right?).

in short, your previous request was MOD, but since the data is already deleted

from the backend, in an ordinary case without the conflict handling, M/W will

send a DEL request to the client and the MI client will delete the modified SyncBo;

losing your modifications. now that you have implemented the conflict handling,

MI will not automatically apply the message (i.e. removing your client SyncBo).

and since you chose acceptClientSyncBo(), your data will be considered a new

one and will be inserted into the backend again on the next sync and will be

assigned a new key.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

actually, i am not deleting anything from my backend.

1: modify the record in the client.

2: try to sync

3: i found out that there is 1 record inserted. for eg: previous instance: 157 now become 158 <b>1 instance added</b>

4. i try to check the record that i modify, it is correct with modified value.

i try to check the new record, it is the old record that sync from backend.

eg:

SYNCKEY | userid(primarykey) | Name | Position

0001295357 00001 Ahmad salesman (modified with sales manager)

after sync

0001295357 00001 Ahmad salesmanager

0001297823 00001 Ahmad salesman

this will be 2 records with same primary key but different syncKey in the client

5: i check the merep_10100

i found that

0001295357 00001 Ahmad <b> salesman </b> (deleted)

0001297823 00001 Ahmad <b> salesman </b> (added)

there are no salesmanager added, still "salesman"

6: to double check if this. i run the emulator

i choose this with 'M' attribute

0001295357 00001 Ahmad salesmanager

and F8

and found out that

SyncKey | Attribute | LastUpdate | LongCharacter

1295989 A <BLANK> 1000110100001101000

1295681 D 20070820 <BLANK>

if i try using the standard merep_contact_getlist, getdetail, modify

which works perfectly. it will have 'M' attribute instead of 'D'

what could be the problem ? mapping ??

it couldnt find the particular rows for modifying ?

and it try to add a new record ? after it find out that the same primary key exists

so it delete the old records ??

i will explain more if things no clear .............

pls advice ................

someone pls help

Message was edited by:

yzme yzme