cancel
Showing results for 
Search instead for 
Did you mean: 

How to retreive rejections after sync (MI 7.1)

Former Member
0 Kudos

Hello all,

I am attempting to retreive rejections using the SyncManager after a syncronization with the DOE. I've seen a thread on here regarding this but I'm left confused and uncertain about it.

Currently I've tested with syncronization of data that is to fail but my rejection repository collection count always equals zero. I read in a similar thread the resolution was to change a column "Conflict Resolution" to manual instead of automatic in the DO editor. I figured DO editor was the data object editor within the mobile abap client but I cannot find this column for the life of me and cannot find any documentation.

Also, if this does work my concern is that automatic conflict handling will be completely gone. I'm just looking for a rejection when a validation check fails in the MODIFY BAPI wrapper. Not necessarily wanting to disable the Conflict Scheme.

I would appreciate any help on this matter.

Thanks,

Alex

Edited by: Alex Van Luven on Nov 6, 2009 10:11 PM

Edited by: Alex Van Luven on Nov 6, 2009 11:30 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member206242
Active Participant
0 Kudos

Hi,

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

This documentation will be of help to you on handling rejections.

Regards,

Nipun

Answers (6)

Answers (6)

Former Member
0 Kudos

Sorry guys....one more question which is a little off topic.

When I change my a servce object in NWDS and for example remove a parameter. I re-import the service in my UI object only to not see the change. I'm forced to delete and re-create the model in order to see the change I made.

Can any of you explain what I may be doing wrong?

Anyone example is that I re-imported the service and found that in the context of my controller, it didn't reference the change. Yet the model when looking at it did show the changes.

Alex

former_member53099
Participant
0 Kudos

Hi Alex

If your model shows the changes, then that means the re-import was successful.

In order to include the newly added parameter into the controller's context one will have to explicitly include the parameter. Please go to 'Edit Model Binding' option on the node and select the extra parameter. Now rebuild the project.

This needs to be done, as on the controller's context not necessarily all the parameters will be used, so when a new parameter is included in the model, it is not automatically reflected in the controller's context. It depends on the application developer's discretion to include it or not

Hope this helps

Best Regards

Vaidehi

Former Member
0 Kudos

Thanks Vaidehi for that response. That makes more sense then why it's been behaving that way.

You seem very knowledgeable with this stuff so I am wondering if you might have an answer for this.

We are attempting to transport all of the data objects, backend adapters and distribution models to our QA system. However, we've encountered a syntax error that occurred for one of the instance push functions of a backend adapter.

The backend adapters were not originally setup by myself and what I've noticed is that all the instance push functions for each backend adapter are all local objects accept for one which is included in a package. I'm not sure why the developer had done this but should they all be temporary and then the instance push function regenerated on the new client once the RFC destination is set? Or should they all be transported along?

And secondly, is it normal for the status icon to be red once you initially transport these things? I know the RFC destination is set to blank so I am just wondering if it has to be regenerated for that reason.

Thanks,

Alex

former_member53099
Participant
0 Kudos

Hi Alex

The instance push function module is generated by DOE. So it is always local. One dosn't have to transport the instance push functions explicitly, it will be generated by the DOE.

It is normal to have Red status as the RFC destination is not there initially. Once RFC destination is set, the next generation wud take care of making it green.

Hope this helps

Best Regards

vaidehi

Former Member
0 Kudos

Hi Vaidehi,

I am working on NW 7.1 Laptop application, we have to handle similar situations discussed in this thread and want to implement rejection handling for 7.1 Laptop application. I went through SDN and found out a How to guide for rejection handling, after going through the document I found out that for handling rejection messages we have to set the conflict detection scheme to manual at client side Data object in model. In the guide, the sample screenshot given is for OCA I could not find similar option to enable manual conflict detection in Laptop Perspective. Can you please let me know how to set it for laptop apps. From this thread , the note mentioned by Nipun Note no 1259580 , it is not available, so can you tell me if there is any alternative note which we can refer to.

Also , it would help if you could tell me about any laptop perspective specific documentation on this topic.

Thanks

Regards,

Priya

Former Member
0 Kudos

You guys have been awesome.

Arjun, I did notice that there were two implementations.

Nipun, that note is perfect. I suck at finding this hidden SAP documentation.

Vaidehi, I'll take a look at your code and use it as a reference. However, it is a different API then the one used in the SAP Note sent by Nipun.

So one last question guys. In the note it did not specify but would I get rejections based on a conflicts discovered by the DOE or just backend validation errors? I just wouldn't want to have to worry about deciding whether to pick between the server or client version based on conflicts. I guess if that's the only way to get the rejections then so be it. I guess I would find out via some tests too.

Thanks again, greatly greatly appreciated.

Alex

former_member53099
Participant
0 Kudos

Hi Alex

you will get a rejction in both the cases.

If there is a validation error on the backend, a rejection will always be sent to the device.

In case of a conflict identified by the DOE, depending on the conflict handling scheme selected for the data object, the device will get rejection.

Best Regards

Vaidehi

Former Member
0 Kudos

Adding to what Vaidehi said, if you just want to see the Rejection handling, you can achieve it by using only Backend Failures.

You can have this code in the Create/modify bapi wrappers to reject some of the messages coming from the client.

If the bapi wrapper returns the error message, it would flow down to the client as "Rejection".

And along with this message, it would also send the "Server Image".

Regards,

Ramanath.

Former Member
0 Kudos

Adding to what Vaidehi said, if you just want to see the Rejection handling, you can achieve it by using only Backend Failures.

You can have this code in the Create/modify bapi wrappers to reject some of the messages coming from the client.

If the bapi wrapper returns the error message, it would flow down to the client as "Rejection".

And along with this message, it would also send the "Server Image".

Regards,

Ramanath.

former_member53099
Participant
0 Kudos

Hi Alex

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

Thanks for both of your answers.

So what I'm looking at is retreiving the rejections on the device itself so I can display errors to the user. There is a java class for the mobile client called SyncManager which apparently you can use to retreive these rejection messages.

Ramanath, this configuration of "Accept Server Image", where can I set this? Those options sounds like what I may need.

The problem is that if the backend validation (called by MODIFY) fails the client item becomes stuck on the client device without updating it back to the "server" image.

Not sure if any of this is making sense.

Alex

Former Member
0 Kudos

By the way, have you had a look at this? :

http://help.sap.com/javadocs/nwmobile/SP1/com/sap/ip/me/api/sync/SyncManager.html

Looks like the class is meant for 'backward compatible' applications (i.e. those applications which were used in versions prior to MI 7.1).

I assume you are creating a new application in 7.1 itself. There must be a separate API to fetch the same information for new applications.

I'll look around if I can find it.

Former Member
0 Kudos

Correction!

Looks like there are two implementations of SyncManager and looks like only one of them are deprecated.

[http://help.sap.com/javadocs/nwmobile/SP1/com/sap/tc/mobile/cfs/sync/api/SyncManager.html]

[http://help.sap.com/javadocs/nwmobile/SP1/com/sap/ip/me/api/sync/SyncManager.html]

Former Member
0 Kudos

If I understand correctly, you expect a conflict upon upload, but you are not getting any.

Conflicts are different from errors thrown by MODIFY. Conflicts are calculated by the DOE itself.

For example, if you set conflict detection ON, the DOE will try to figure out if the client has an old copy of the instance it is trying to modify (because say, for example the instance was modified by the backend and the modification has not yet reached the client). If such a thing occurs, the DOE will reject the client's message without even calling MODIFY.

On the other hand, errors thrown in the RETURN parameter of MODIFY BAPI Wrapper, go as rejections to client as well. The error is purely based on backend logic ofcourse, and is not a DOE decision.

Now:

If you want to change the conflict detection scheme, it has to be done in the transaction SDOE_WB of the DOE system. Navigate to your SWCV and Data Object and open it. Right there, on the main 'Data Object Overview' tab, you will see the options to change the conflict detection scheme.

Former Member
0 Kudos

Hi,

I am not sure what do u mean by SyncManager but never the less here is some info regarding rejections.

in case of validation checks failed in MODIFY bapi wrapper, you should set the bapiret msg type as "E" which will be considered as ERROR by DOE. (remember MODIFY bapi wrapper will be invoked only for update instances and not newly created instances)

You can see the rejections in the outbound queue of the device in Admin portal using "View Outbound Q Details" link.

If you are using Netweaver Mobile client, then the behavior of the application depends on the configuration you have set for rejection handling.

If configuration is set to "Accept Server Image", then the local changes done on the client would be ignored and server image is kept. If the configuration is set to "Accept Client Image", then the local changes would be given preference.

~ Ramanath.