Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

implement crud operation in global class

0 Kudos
529

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,

4 REPLIES 4

FredericGirod
Active Contributor
0 Kudos
392

What is the problem of trying to implement crud operations ?

0 Kudos
392

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.

Sandra_Rossi
Active Contributor
392

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)

Eduardo-CE
Active Participant
0 Kudos
392

Hi,

You can check this example program BCALV_EDIT_03.