2023 Jan 09 2:44 PM
Hello community,
I am trying to use OO and I am wondering How can I implement crud operations in a global class and after that I can use it in a report?
Do you have an example similar to my situation.
Thank you,
2023 Jan 09 2:55 PM
2023 Jan 09 3:14 PM
I am used to add crud operations directly in the report like in this example Create, Read, Update & Delete - CRUD Operations in ABAP Report - Go Coding , when I implement CRUD operations (UPDATE for example) in the report directly I get the new values from the parameters entered by user and then I update the table. Now I want to create a global class and define crud methods on it and then a simple call in the report for the crud methods! My issue is that I do not know how to write the code for update methods for example, from where I can get the new entries.
2023 Jan 09 3:28 PM
You are too much general, I don't understand what your question is. Something like below could be one solution to CRUD, but what is your question?
CLASS employee DEFINITION.
PUBLIC SECTION.
CLASS-METHODS create ... " new object, must not exist in database (SELECT to check)
CLASS-METHODS get ... " load existing object from database (SELECT)
METHODS get_salary ...
METHODS set_salary ...
METHODS lock ... " ready to update or delete
METHODS unlock ... " discard
METHODS delete ...
METHODS save ... " save to database (insert, update, delete)
2023 Jan 09 3:30 PM