cancel
Showing results for 
Search instead for 
Did you mean: 

How to initiate a Deletion of a main Entity in MDG-X

former_member196830
Active Participant
0 Kudos

Hello,

We have a Custom MDG Data Model with an access class that does all our actions (Save, Read, Query, Enqueue, Dequeue, Authority Check, Derivations, etc...)

We are trying to also enable the Deletion of a record for our main entity. The reuse area is a Z-table in our case and the requirement is not to flag for deletion, but to delete the entry.

Can you provide information on what triggers the population of the structure lr_data_del in the SAP standard read_data method.

CALL METHOD io_delta->read_data
       EXPORTING
         i_entity      = <lv_entity>
         i_struct      = if_uiss_constant~gc_check
       IMPORTING
         er_t_data_ins = lr_data_ins
         er_t_data_upd = lr_data_upd
         er_t_data_del = lr_data_del.


The way we initiate the process is by setting up a separate button on the search BADI implementation in the method IF_EX_USMD_SEARCH~PROCESS_EVENT and setting up the activity to DELETE, but apparently that's not sufficient


WHEN 'DELETE'.
        es_navigation-application = if_mdg_bp_constants=>gc_app_single_maintenance.
        ls_navigation-fieldname   = if_mdg_bp_constants=>gc_ptag_process.
        ls_navigation-value       = 'ZIDL'.    "Delete Entity business activity
        APPEND ls_navigation TO es_navigation-t_parameter.
        ls_navigation-fieldname   = if_mdg_bp_constants=>gc_ptag_editing_mode.
        ls_navigation-value       = if_mdg_bp_constants=>gc_activity-delete.
        APPEND ls_navigation TO es_navigation-t_parameter.


The Process is triggered properly, but when debugging the access class, all three structures remain empty lr_data_ins, lr_data_upd and also lr_data_del.


Please advise on the proper way to implement a deletion functionality if you've done this in the past.


Thanks in advance,

Boris

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member196830
Active Participant
0 Kudos

Just in case you are interested to know,

What I ended up doing is to have a Deletion flag and once set, I branch in the Update logic to do an actual deletion of the record from the table in the Save method of the access class.

Best regards,

Boris

michael_theis
Active Contributor
0 Kudos

Hi Boris,

logical action "DELETE" triggers always the "Mark for Deletion". If you really want to delete, you should use "ERASE" instead. You might have a look at the SAP MDG-F configuration for examples.

Best regards

Michael

former_member196830
Active Participant
0 Kudos

Hello Michael,

I guess I'm still missing something. Since ERASE logical action was not in the system by default, I added it. Also configured the Business Activity to use the new ERASE logical action and made sure that I'm enforcing it with the button from my Search screen.

The structures like lr_data_del still remain initial after the read_data method call.

Regards,

Boris