cancel
Showing results for 
Search instead for 
Did you mean: 

Problems Only To Delete Records on DOE

Former Member
0 Kudos

Hi,

I have developed an application using SDOE_CONTACT* BAPI WRAPPERS (GETLIST, GETDETAIL, CREATE, MODIFY, DELETE).

The application is running fine for GETLIST, GETDETAIL, CREATE and MODIFY, when I synchronize i can see the data reflecting on CDS and Backend tables.

But, when I delete a record and synchronize, the record is just deleted on CDS and in the backend table not. I have checked the messages on DOE Administrator and I can see the message with "D" status on TASK field and just the sync fields as EXTRACTKEY, STATEID AND SYNCKEY_MMW are filled.

    • I´m using the remove method generated by mobile framework in NWDS when I imported the Data Object to delete the records.

      • I have tested the SDOE_CONTACT_DELETE on backend, passing the same ID value that I synchronized on MI Client.

Has anyone an idea to solve it?

Thanks.

Edited by: Rogério Tambellini on Nov 27, 2009 6:48 PM

Accepted Solutions (1)

Accepted Solutions (1)

AjithC
Employee
Employee
0 Kudos

Hi Rogério,

Just check the backend adapter for this Data Object. The delete BAPI might be missing there and instead "send confirmation" flag might be set. In that case this is an expected behaviour. To change this behaviour, Just uncheck the flag and mention the correct bapi wrapper name..

If the above case is false, check the status in message monitor and see if there is any errors..

Regards

Ajith

Former Member
0 Kudos

Hi Ajith,

Any idea?

Thanks.

AjithC
Employee
Employee
0 Kudos

Hi Rogério,

The first case looks very strange. Looks like a bug. Nevertheless check the bapiwrapper. There is a bug in the bapiwrapper that it doesn't check for failure cases.. may be you can copy that FM into a local one and make a sy-subrc check after the delete.. Incase of failure return Error message.. make sure to change the bapiwrapper name to the new name in backend adapter..

the code snippet for the bapi wrapper...

delete from sdoe_person

where persnumber = persnumber.

if SY_SUBRC is not initial. "delete failed

call function 'BALW_BAPIRETURN_GET2'

exporting

type = 'E'

cl = 'SDOE_SAMPLE_BAPI'

number = '007'

par1 = lds_return-message_v1

importing

return = lds_return.

append lds_return to return.

return.

endif.

The error message wil be meaningless (or misleading), but here we are more interested in the type. If the bapi returns type "E", the record will not be deleted from CDS..

if this also fails, raise a support ticket...

Regards

Ajith

Former Member
0 Kudos

Hi,

For first situation

-


Whatever you see in message monitoring is correct where client will send only sync key of the record deleted. Some internal service (message completion service) in DOE fills the key and other details of the key before calling the delete bapi wrapper.

If you could see the person id is filled in the message passed to 'PROCESS_UPLOAD_DELETE' and same thing is not passed to

bapi wrapper, then its problem with mapping where DELETE bapi wrapper's importing parameter is not properly mapped with

data object. So check your bapi wrapper mapping. In case you have properly mapped, then check whether you have changed the bapi wrapper signature after creating backend adapter.

For second situation

-


For deleting the instance as such you dont need to delete child node rows. Mobile client and DOE takes care of doing cascade delete where on header delete corresponding child rows will also be deleted. So try by just deleting the header.

Regards

Dhana

Edited by: Dhanasekhar Karuppanan on Nov 30, 2009 6:34 AM

Former Member
0 Kudos

Hi Ajith and Dhanasekhar,

Thanks for ur help.

Ajith I will take care about your tip when we start developing ours own BAPI WRAPPERS... I will pass this to ABAP Programmers...

Dhanasekhar, I´m not able to see the person ID in the message passed to PROCESS_UPLOAD_DELETE. So, I checked the Mapping between Data Object and BAPI WRAPPER in Mapping Tool, and in the Object Name matchcode, I´m able to see just SDOE_CONTACT_GETDETAIL, SDOE_CONTACT_CREATE and SDOE_CONTACT_MODIFY whereas SDOE_CONTACT_DELETE doesn´t appear. I tried to make it appear in the matchcode, but i didn´t have success.

    • I haven´t changed any parameter in this function...

Do you have some tip to appear it there to make the association?

Thanks.

Former Member
0 Kudos

Hi,

I was wrong in my previous reply. Mapping for delete bapi wrapper is not necessary. But there should be some signature which need to be maintained for your delete BAPI wraper.

i.e) The importing parameter of getDetail parameter and importing parameter of delete bapi wrapper should be same. Also the reference type of these parameters should be same. Mapping done for getDetail is internally used for mapping delete bapi wrapper also.

So check whether importing parameter of your getdetail bapi and delete bapi are same.

For more info about bapi wrapper signature look into the following link

[https://media.sdn.sap.com/public/html/submitted_docs/MI/MDK_2.5/content/appdev/smartsync/bapi_wrapper_types.html|https://media.sdn.sap.com/public/html/submitted_docs/MI/MDK_2.5/content/appdev/smartsync/bapi_wrapper_types.html]

Former Member
0 Kudos

Hi Dhanasekhar,

The parameters in SDOE_CONTACT_GETDETAIL are:

*"----


""Local Interface:

*" IMPORTING

*" VALUE(MANDT) TYPE SDOE_PERSON-MANDT OPTIONAL

*" VALUE(PERSNUMBER) TYPE SDOE_PERSON-PERSNUMBER OPTIONAL

*" EXPORTING

*" VALUE(PERSON) TYPE SDOE_PERSON

*" TABLES

*" ADDRESS STRUCTURE SDOE_ADDRESS

*" E_M

AIL STRUCTURE SDOE_E_MAIL

*" RETURN STRUCTURE BAPIRET2

*"----


And in SDOE_CONTACT_DELETE are:

*"----


""Local Interface:

*" IMPORTING

*" VALUE(MANDT) TYPE SDOE_PERSON-MANDT OPTIONAL

*" VALUE(PERSNUMBER) TYPE SDOE_PERSON-PERSNUMBER

*" TABLES

*" RETURN STRUCTURE BAPIRET2

*"----


If you have MI7.1 installed, you can check them, because they are SAP standard functions.

Any idea?

Thanks.

Former Member
0 Kudos

Mapping is not displayed in SDOE_WB for delete because it is internally done. However, mapping must exist in the adapter repository (which you cannot see).

I think for some reason, mapping has not got stored in the repository, and that is why somewhere in the generated adapter code, the keys are not getting populated for the delete call. Can you try creating a fresh adapter and see if deletes get sent?

Former Member
0 Kudos

Hi Arjun,

Thanks for your help. The problem has been solved. I re-created the SWCV project and it worked.

Just one question. When i change something in the Data Object, what are the steps to activate everything again? For example, to change a BE Key Field. Do i have to:

1 - Change BE Key Field

2 - Activate/Regenerate Data Object, BE Adapter and DM?

3 - Run SDOE_CLEANUP

4 - Execute/Schedule Job for SDOE_LOAD and Trigger Extracting

5 - Activate Rule

6 - Delete and Re-import DO in NWDS?

Could you help me with this queries?

Thanks.

Former Member
0 Kudos

This is how I would do it:

If you are in a productive system, the first thing to do here is to deactivate all Rules. Lets call that step 0.

0. Deactivate Rules

> 1 - Change BE Key Field

Correct.

> 2 - Activate/Regenerate Data Object, BE Adapter and DM?

When you activate the DO, and the activation may or may not give an error (depending on whether the change requires existing CDS contents to be adjusted due to the changed key field). If you get an error, it will mention the CDS table which has not been activated (because it needs to be adjusted). At this point, you need to go to SE14 and adjust the table while keeping contents.

DM can work irrespective of changes to DO, as long as you don't remove any of the fields used by it. So DM you can leave as it is.

> 3 - Run SDOE_CLEANUP

Not necessary if the adjustment succeeded. There is no need to lose data, unless you want to. And in a productive system, its best not to run a cleanup.

> 4 - Execute/Schedule Job for SDOE_LOAD and Trigger Extracting

Again, if the adjustment worked, this need not change.

> 5 - Activate Rule

This will recalculate and send inserts to devices again.

> 6 - Delete and Re-import DO in NWDS?

Yep. Sounds okay.

Former Member
0 Kudos

Hi Arjun,

Thank you very much for your explanation. It will be really useful for me.

Rogerio

Answers (0)