cancel
Showing results for 
Search instead for 
Did you mean: 

SUP 2.1.2 - (Blackberry native app) Update operation not updating the MBO

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

I have an MBO based on a SAP RFC, it contains material data. Then I've added an update operation to this MBO, using exactly the same structure for the update operation RFC and the RFC to query the data for the MBO.

Finally, I'm triggering the update operation from my Blackberry SUP app, and when the device synchronizes with SUP, the RFC is called (I can debug it with an external breakpoint), but the MBO is not updated. The result of this is the backend having the material updated but not the SUP CDB...

I know I can simply make the operation to invalidate the cache to load the data from the backend again, but I don't want this because the cache group is "scheduled" and I want to load the data from the backend just once a day, so I need the device updating the MBO too when it's calling the update RFC

My blackberry code

//Get the material to update

MATERIALS material = MATERIALS.findByPrimaryKey('123');

//Fill update material structure

ZSUP_MATERIAL supMaterial = new ZSUP_MATERIAL();

supMaterial.setMATNR(material.getMATNR());

supMaterial.setSTOCK(10);

//Call update operation and synchronize

material.updateMaterial(supMaterial);

material.submitPending();

MATERIALSDB.synchronize();

PS: I did this before in a test environment with SUP 2.1.1 and sampledb and it worked, it looks like the problem is when I use RFCs instead of a database...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Marsh

Before calling submit pending operation, Try to call the save operation of that particular Class. By calling save method data will be get updated in the CDB before syncing with the backend. by doing this you will have a data updated in CDB.Your using scheduled sync, so at that time CDB will be updated with the data from Backend.

Thanks & Regards

Dinesh.

Marçal_Oliveras
Active Contributor
0 Kudos

Hi Dinesh,

I already tried this because in previous SUP versions the code sample was like you say, with a save method.

But I get the same result.

Former Member
0 Kudos

Hi Marsh,

How your telling CDB is not updated?, because when your trying to synchronize with backend from mobile. The data flow will be as follows

Mobile DB->CDB->EIS. So it is not required CDB should get the updated value from EIS immediately. we are updating the EIS with the updated content of CDB. So after you calling save try to check your CDB and Check the CDB once you called synchronize. Then we will come to know some conclusion. because it is totally confused if CDB is not updating then EIS also won't update.

Marçal_Oliveras
Active Contributor
0 Kudos

Hi Dinesh,

What happens it's exactly the following:

1. I run my app on the device and start the synchronization.

2. I get an MBO item and I modify it using the update operation.

3. After the submitPending() and syncrhonize() methods, I capture in SAP the RFC call to debug it and check that the call has been done correctly.

After this process, the device database is correctly updatet, and the SAP data (backend) too. But the changes hasn't been applied to the CDB database. So when the blackberry application does a new synchronization, the data uploaded to the device is wrong because it's the old CDB data.

The data is right only if there is a cache group update between the device synchronizations.

Former Member
0 Kudos

Hi Marshal

The sequence you describe is correct.

1. Device updates local DB

2. Calls operation:update which updates SAP and on success

3. the CDB must be updated, if the MBO and the return output structure of the RFC is the same

One more thing you can check to see is if you have checked the check box "Apply to cache" in your MBO. Other than this I can see nothing wrong with what you have done.

May be you have already solved the problem, please let us know if you have.

Regards

LNV