on 12-03-2007 9:51 AM
Hi, i´m doing a smart project, i havethis method:
- modifyRowInDB
- addRowInDB
How can i do deleteRowInDB?
Lot of thanks,
Hi Victor,
to delete a row, there are two things possible -like in the modify.
First if the row is on the local machine and in state L because you just created it - then you can delete is simply by selecting it with its guid and delete it with the API. This is the same as modify - just delete at the end.
If it is already in G state, so it was synced with the backend. In that case you need a delete bapi wrapper, that does the delete in the backend as well. The rest is straight forward again. Can be the same coding pretty much as your MODIFY handler - on both sides, the abap and the java - but instead of modify, you call delete.
By the way, to have a look for all possible methods: while you develop a java app, you usually get help from eclipse. In the moment you enter code, Eclipse shows you what instructions are possible. If you write
String s = new String();
s.comp
then the baloonhelp shows you that there are several different instructions that start with comp for the String. The same happens when you write the SmartSync code. The line where you setup the modify..... In there just delete evrything from the dot in front of the modify to the end of the line. If you now enter the dort again, then it shows you all possible instructions for that code structure. So instead of selecting the modify from there, you just select the delete.... It is a ssimple as that. And the bestthing: it shows you the necessary variables then as well... Great stuff
ope this helps,
Regards,
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, if i understand...
I have this method for delete:
public void borrar (String syncBoName, String syncKey) {
try {
SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);
SyncBo s = dataFacade.getSyncBo(sbd, syncKey);
if (s.getStatus().toString().equals("G") || s.getStatus().toString().equals("L")) {
dataFacade.deleteSyncBo(dataFacade.getSyncBo(sbd, syncKey));
}
} catch (PersistenceException pex) {
System.out.println(pex.getMessage());
} catch (ModificationNotAllowedException e) {
System.out.print(e.getMessage());
}
}
Only, i need do the delete handler?
Thanks,
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.