Reputation: 1
I have implemented the following function for an action in a Behavior Definition Handler class:
METHODS nohit FOR MODIFY
IMPORTING keys FOR ACTION hitabbd~nohit RESULT result.
...
METHOD nohit.
MODIFY ENTITIES OF zi_sls_hitab IN LOCAL MODE
ENTITY HitabBD
DELETE
FROM VALUE #( FOR key IN keys ( %tky = key-%tky ) )
FAILED failed
MAPPED mapped
REPORTED reported.
UPDATE /su01/sls_da_tab
SET zhit = 0
WHERE zobject = ls_key-Zobject and Zobjectkey = ls_key-Zobjectkey.
ENDLOOP.
ENDMETHOD.
Description:
Even if I include a READ to return changed entries (as with the update) the object page is always opened.
READ ENTITIES OF zi_sls_hitab IN LOCAL MODE
ENTITY HitabBD
ALL FIELDS WITH CORRESPONDING #( keys )
RESULT DATA(hittabdata).
result = VALUE #( FOR hittabrec in hittabdata
( %tky = hittabrec-%tky %param = hittabrec )
).
This is because the READ no longer has a changed data record that it could return.
How can I ensure that I remain in the List Page after the action and only the table is updated (data record removed)?
If >1 item is selected, the action works perfectly (with and without the READ).
I have already determined all the remaining keys and thus read and returned all the remaining data records -> same effect, it switches to the object page.
Returning the variable keys (i.e. the selected item) also does nothing.
The READ before the DELETE (i.e. returning the original object) does not switch to the Object Page, but the item is not removed from the table either.
Returning (result = '...'.) a string or similar is not possible due to the expected type of result.
The framework expects the changed item to be returned (without a change it remains in the list page without updating the table; with a change the table is updated). However, the item is not changed but deleted. There is nothing that I can return.
Upvotes: 0
Views: 60