cancel
Showing results for 
Search instead for 
Did you mean: 

Returning to the error after the data synchronization

Former Member
0 Kudos

Hi:

I am developing an application in 7.1 Mobile for PDA (OCA).

When sending data to the DOE with a synchronization have two scriptwriter:

1. The data is correct and data synchronization is correct.

2. The data is not correct and data synchronization is correct. On the monitor I get the error but data synchronization is correct, the user is not aware that there was an error, until I return to synchronize not return the correct data to the PDA.

Scenario 1 is correct, but in Scenario 2 need to know that something has gone wrong.

Any ideas?

Best regards

Maria Elena

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member206242
Active Participant
0 Kudos

Hi,

Could you explain the problem scenario 2 in more details. I am still confused as to whats the exact issue.

Regards,

Nipun

Former Member
0 Kudos

Hi:

when I synchronize the data and I will send me back an error, I get an error in the management console, I observe the error in the DOE, but the pda everything went right.

How can I return the error on the pda?

Best regards

Maria Elena

former_member206242
Active Participant
0 Kudos

Hi,

can you send the content of the trace files just after the scenario 2 from(
MI\Log) folder.

Are you facing rejection error? In that case you need to do rejection handling in the app code

Regards,

NIpun

Former Member
0 Kudos

Hi,

My problem is I have a data object on its modify and when he function return an error

How can I see the error on the PDA ?

Best regards

Maria Elena

Former Member
0 Kudos

If you are talking about backend throwing an error during a BAPI Wrapper call: Then it is 'rejected' by the DOE and a rejection is sent to the device.

This thread should answer your question []

Former Member
0 Kudos

Hi,

I have the following code:

String messages = "";

String msg;

Descargos_srvModel model = (Descargos_srvModel) OcaRoot.getInstance().getModel(Descargos_srvModel.class);

SyncManager syncMgr = OcaRoot.getInstance().getSyncManager();

RejectionRepository rejrep = syncMgr.getRejectionRepository();

Collection rejections = rejrep.getRejections( (OcaModel) model ) ;

System.out.println("rejections : " + rejections.size());

logger.debug( this.getClass(), "AGE: getRejections count: " + rejections.size());

Iterator rejIter = rejections.iterator();

while (rejIter.hasNext())

{

msg = "";

Rejection rej = (Rejection) rejIter.next();

System.out.println("Estado: " + rej.getRejectionState());

logger.debug( this.getClass(), "AGE: getRejections State: " + rej.getRejectionState());

Iterator rejInfoIter = rej.getRejectionInfos();

while (rejInfoIter.hasNext())

{

RejectionInfo rejInfo = (RejectionInfo) rejInfoIter.next();

logger.debug( this.getClass(), "AGE: getRejections getMessageText: " + rejInfo.getMessageText());

logger.debug( this.getClass(), "AGE: getRejections getErrorId: " + rejInfo.getErrorId());

logger.debug( this.getClass(), "AGE: getRejections getMessageNumber: " + rejInfo.getMessageNumber());

logger.debug( this.getClass(), "AGE: getRejections getMessageType: " + rejInfo.getMessageType());

logger.debug( this.getClass(), "AGE: getRejections getMessageVariable1: " + rejInfo.getMessageVariable1());

logger.debug( this.getClass(), "AGE: getRejections getParameterName: " + rejInfo.getParameterName());

msg = msg.concat( rejInfo.getMessageText() + ": ");

}

Iterator rejNodesIter = rej.getRejectedNodes();

while (rejNodesIter.hasNext())

{

RejectedNode rejNode = (RejectedNode) rejNodesIter.next();

logger.debug( this.getClass(), "AGE: getRejections Node: " + rejNode.getClass());

logger.debug( this.getClass(), "AGE: getRejections ClientVersion: " + rejNode.getClientVersion().getClass());

}

if( rej.getRejectionState().equals( RejectionState.INITIAL) )

{

// we always take the client version, so that the user can fix it //

rej.acceptClientVersion();

}

logger.debug( this.getClass(), "AGE: getRejections msg: " + msg);

messages = messages.concat( "\n" + msg );

logger.debug( this.getClass(), "AGE: getRejections messages: " + messages);

}

Former Member
0 Kudos

Hi;

I have the following code in the componente controller and the rejections.size() always is 0.

in the console of administracion I can see the error.

My model has the nodes 'Conflicts Resolution' of type 'Manual'.

Any Idea????

Best Regards.

String messages = "";

String msg;

Descargos_srvModel model = (Descargos_srvModel) OcaRoot.getInstance().getModel(Descargos_srvModel.class);

SyncManager syncMgr = OcaRoot.getInstance().getSyncManager();

RejectionRepository rejrep = syncMgr.getRejectionRepository();

Collection rejections = rejrep.getRejections( (OcaModel) model ) ;

System.out.println("rejections : " + rejections.size());

logger.debug( this.getClass(), "AGE: getRejections count: " + rejections.size());

Iterator rejIter = rejections.iterator();

while (rejIter.hasNext())

{

msg = ""; Rejection rej = (Rejection) rejIter.next();

System.out.println("Estado: " + rej.getRejectionState());

}

former_member206242
Active Participant
0 Kudos

HI,

Have you checked this SAP Note on rejection handling in 7.1

REjEECTION HANDLING IN 7.1

SAP Note 1259580, which contains an attachment on rejection-handling scenarios in SAP NetWeaver Mobile 7.1

Regards,

Nipun

Former Member
0 Kudos

Hi:

Ok, thanks but now

I have the rejections but when I accept the acceptServerVersion, I have to exit to the application and re-enter to get the value from the server.

What can I do to update the information when I accept the acceptServerVersion?

Best regards.

Maria Elena

Former Member
0 Kudos

Hello Maria,

Did you call the reload after you accept the server version?

For example,


 rejec.acceptServerVersion();
 wdContext.nodeMYNODE().reload();

Thanks & Regards,

Abhijit

former_member53099
Participant
0 Kudos

Hi

Please use the 'mbosync' apis in order to retrieve rejections.

You can get the details of the same at the following location

<http://help.sap.com/javadocs/nwmobile/SP1/com/sap/tc/mobile/cfs/mbosync/api/package-summary.html>

Here is a code snippet which i used in my application to retrieve the rejections

=============================

MBOSyncManager msm = MBOSyncManager.getInstance(MWDSessionManager.getSession());

RejectionRepository rr = msm.getRejectionRepository();

Rejection r;

com.sap.tc.mobile.test.component.wdp.IPrivateRejectionRepositoryView.IRejectionElement re;

for(ManagedIterator i = rr.getRejections(mdesc); i.hasNext(); re.setRejectionObject(r))

{

r = (Rejection)i.next();

re = node.createRejectionElement();

node.addElement(re);

}

=============================

Now if you want to accept the client version, you can try the following

=============================

com.sap.tc.mobile.test.component.wdp.IPrivateRejectionRepositoryView.IRejectionElement re = wdContext.currentRejectionElement();

if(re != null)

try

{

re.getRejectionObject().acceptClientVersion();

}

catch(Exception e)

{

e.printStackTrace();

wdComponentAPI.getMessageManager().reportException("Rejection is already resolved");

}

=============================

Hope this helps

Best Regards

vaidehi

Former Member
0 Kudos

Hi:

Ok, thanks. This is correct.

I have the rejection on the PDA, but if I modify again the data I get an exception:

java.lang.IllegalStateException: Cannot update parent during create of child

at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:210)

Any idea to modify the register again?

Best regards.

Maria Elena

Former Member
0 Kudos

Hello Maria,

Can you check the trace files onthe client?

An exception should have been logged into the trace file.

Exception might look like "Error executing SQL <sql statement>" and then exception trace.

Can you paste it here?

Thanks & Regards,

Abhijit

Former Member
0 Kudos

Hi:

The log I get the following exception:

<r id="1260897165906" t="18:12:45" d="2009-12-15" s="E" c="000" u="E011154" g="es" m="Internal Error. Please check the log file. --&gt; java.lang.IllegalStateException: Cannot update parent during create of child

at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:210)

at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:162)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.update(PersistenceManager.java:278)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.update(PersistenceManager.java:232)

at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.doUpdate(ModelClassCache.java:108)

at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.flush(ModelClassCache.java:64)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.flushCache(PersistenceManager.java:845)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.executeQuery(PersistenceManager.java:209)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:548)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:493)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:487)

at com.sap.tc.mobile.cfs.deploy.DeploymentManager.getArchiveInfo(DeploymentManager.java:1596)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.getApplicationClassloader(Application.java:194)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)

at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:365)

at com.sap.tc.mobile.wdlite.framework.Start.notifySyncAction(Start.java:439)

at com.sap.tc.mobile.wdlite.framework.Start$3.doHandleEvent(Start.java:298)

at com.sap.tc.mobile.wdlite.renderer.swt.container.MenuItem.notifyOnAction(MenuBar.java:390)

at com.sap.tc.mobile.wdlite.renderer.swt.container.MenuItem$1.widgetSelected(MenuBar.java:377)

at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)

at com.sap.tc.mobile.wdlite.renderer.swt.container.WorkingArea.refresh(WorkingArea.java:175)

at com.sap.tc.mobile.wdlite.renderer.api.RenderingManager.refresh(RenderingManager.java:233)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.refresh(Application.java:250)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.navigate(Application.java:503)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.enter(Application.java:243)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.setCurrent(Application.java:119)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:143)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)

at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:365)

at com.sap.tc.mobile.wdlite.framework.Start.runOnContext(Start.java:585)

at com.sap.tc.mobile.wdlite.framework.Start.startApplication(Start.java:609)

at com.sap.tc.mobile.wdlite.framework.Start.startContainer(Start.java:646)

at com.sap.tc.mobile.cfs.framework.spi.FrameworkManager.startContainer(FrameworkManager.java:259)

at com.sap.tc.mobile.cfs.init.FrameworkInitializer.init(FrameworkInitializer.java:230)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.sap.tc.mobile.cfs.startup.pda.Startup.main(Unknown Source)

Thanks and best regards.

Maria Elena

Former Member
0 Kudos

HI:

I get the folloging exception:

<r id="1260897165906" t="18:12:45" d="2009-12-15" s="E" c="000" u="E011154" g="es" m="Internal Error. Please check the log file. --&gt; java.lang.IllegalStateException: Cannot update parent during create of child

at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:210)

at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:162)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.update(PersistenceManager.java:278)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.update(PersistenceManager.java:232)

at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.doUpdate(ModelClassCache.java:108)

at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.flush(ModelClassCache.java:64)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.flushCache(PersistenceManager.java:845)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.executeQuery(PersistenceManager.java:209)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:548)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:493)

at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:487)

at com.sap.tc.mobile.cfs.deploy.DeploymentManager.getArchiveInfo(DeploymentManager.java:1596)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.getApplicationClassloader(Application.java:194)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)

at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:365)

at com.sap.tc.mobile.wdlite.framework.Start.notifySyncAction(Start.java:439)

at com.sap.tc.mobile.wdlite.framework.Start$3.doHandleEvent(Start.java:298)

at com.sap.tc.mobile.wdlite.renderer.swt.container.MenuItem.notifyOnAction(MenuBar.java:390)

at com.sap.tc.mobile.wdlite.renderer.swt.container.MenuItem$1.widgetSelected(MenuBar.java:377)

at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)

at com.sap.tc.mobile.wdlite.renderer.swt.container.WorkingArea.refresh(WorkingArea.java:175)

at com.sap.tc.mobile.wdlite.renderer.api.RenderingManager.refresh(RenderingManager.java:233)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.refresh(Application.java:250)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.navigate(Application.java:503)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.enter(Application.java:243)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.setCurrent(Application.java:119)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:143)

at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)

at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:365)

at com.sap.tc.mobile.wdlite.framework.Start.runOnContext(Start.java:585)

at com.sap.tc.mobile.wdlite.framework.Start.startApplication(Start.java:609)

at com.sap.tc.mobile.wdlite.framework.Start.startContainer(Start.java:646)

at com.sap.tc.mobile.cfs.framework.spi.FrameworkManager.startContainer(FrameworkManager.java:259)

at com.sap.tc.mobile.cfs.init.FrameworkInitializer.init(FrameworkInitializer.java:230)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.sap.tc.mobile.cfs.startup.pda.Startup.main(Unknown Source)

">

Thanks and best regards.

MAria Elena