Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inline SQLs, consume Kronos ABAP API #3

Merged
merged 53 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d808686
inline sql initial commit
iliyan-velichkov Jun 12, 2024
a00cbba
rollback package-lock.json
iliyan-velichkov Jun 12, 2024
5d2db05
comment my code
iliyan-velichkov Jun 12, 2024
0572e26
uncomment code + cleanup
iliyan-velichkov Jun 12, 2024
1e232bb
implement some of the interface methods
iliyan-velichkov Jun 13, 2024
c566e29
more interface impl
iliyan-velichkov Jun 13, 2024
7c94075
implement cursor methods, beginTransaction, commit and rollback
iliyan-velichkov Jun 13, 2024
75349ba
add testing table
iliyan-velichkov Jun 13, 2024
9d23e45
remove sql.js since it is not actually needed
iliyan-velichkov Jun 13, 2024
f197f66
fix client
iliyan-velichkov Jun 13, 2024
7db5627
add sdk as external to prevent errors
iliyan-velichkov Jun 13, 2024
9241f06
multiple calls in run method
iliyan-velichkov Jun 13, 2024
04ba247
add dao abap init commit
iliyan-velichkov Jun 13, 2024
3d4b0c6
add zcl_dirigible_employee_dao.clas.abap - not working
iliyan-velichkov Jun 13, 2024
81d87d4
update abap files - not working
iliyan-velichkov Jun 13, 2024
d0d394b
apply review comments
iliyan-velichkov Jun 13, 2024
eee8e1a
transpiler and lint config files
iliyan-velichkov Jun 14, 2024
bdb6c1d
refactor abap code
iliyan-velichkov Jun 14, 2024
bf58d25
update gitignore
iliyan-velichkov Jun 14, 2024
5c23502
directly print the result of select
iliyan-velichkov Jun 14, 2024
b45d6f3
use snake case for the table - otherwise values not extracted
iliyan-velichkov Jun 14, 2024
292b889
format the code
iliyan-velichkov Jun 14, 2024
a8d7c35
add insert method
iliyan-velichkov Jun 17, 2024
7967cd0
add delete_all_employees method
iliyan-velichkov Jun 17, 2024
07dc7c6
add logger
iliyan-velichkov Jun 17, 2024
0f4d411
add more messages
iliyan-velichkov Jun 17, 2024
b2fb34a
reorder methods
iliyan-velichkov Jun 17, 2024
3c4bc46
refactoring
iliyan-velichkov Jun 17, 2024
7b17e71
extract some methods
iliyan-velichkov Jun 17, 2024
84e7058
add comment
iliyan-velichkov Jun 17, 2024
6d4675e
remove quotes for strings in println
iliyan-velichkov Jun 17, 2024
8943477
allow length of 160
iliyan-velichkov Jun 17, 2024
23eefd1
fix update
iliyan-velichkov Jun 17, 2024
f62d2ad
remove comments
iliyan-velichkov Jun 17, 2024
eaf1d0d
[workaround] manually register the table to enable update
iliyan-velichkov Jun 17, 2024
60373cc
database init using kronos abap api
iliyan-velichkov Jun 19, 2024
933d4ce
cleanup
iliyan-velichkov Jun 19, 2024
f1f714a
cleanup
iliyan-velichkov Jun 20, 2024
0eeea95
update dependencies
iliyan-velichkov Jun 20, 2024
eceb627
update build script
iliyan-velichkov Jun 20, 2024
60393f4
restructure the project
iliyan-velichkov Jun 20, 2024
71376da
add abap app class with run method
iliyan-velichkov Jun 20, 2024
8669a38
use introduced Kronos ABAP API from the app
iliyan-velichkov Jun 21, 2024
ec0424e
use renamed ABAP API class
iliyan-velichkov Jun 24, 2024
ae6ba9a
add build-linux.sh
iliyan-velichkov Jun 24, 2024
9b334f1
configure abap lint
iliyan-velichkov Jun 24, 2024
25626ec
add kronos ABAP APIs as libs
iliyan-velichkov Jun 24, 2024
c146dac
add logs
iliyan-velichkov Jun 24, 2024
ffe60f9
fix unit script
iliyan-velichkov Jun 24, 2024
2ed0be2
fix run script
iliyan-velichkov Jun 24, 2024
f25c51a
align the sample with the blog
iliyan-velichkov Jun 28, 2024
6f42aaf
remove test workflow since this project could be run on Kronos only
iliyan-velichkov Jun 28, 2024
efe61cf
cleanup
iliyan-velichkov Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions src/zcl_dirigible_employee_dao.clas.abap
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
CLASS zcl_dirigible_employee_dao DEFINITION PUBLIC.

PUBLIC SECTION.
TYPES: BEGIN OF ty_employee,
id TYPE n LENGTH 10,
firstName TYPE string,
lastName TYPE string,
END OF ty_employee.

TYPES: ty_employees TYPE TABLE OF ty_employee WITH EMPTY KEY.
TYPES:
BEGIN OF ty_employee,
id TYPE n LENGTH 10,
firstName TYPE string,
lastName TYPE string,
END OF ty_employee,
ty_employees TYPE TABLE OF ty_employee WITH EMPTY KEY.
larshp marked this conversation as resolved.
Show resolved Hide resolved

CLASS-METHODS:
select_all
RETURNING VALUE(rv_result) TYPE string.

CLASS-METHODS: select_all_employees
RETURNING VALUE(rv_result) TYPE string.
ENDCLASS.

CLASS zcl_dirigible_employee_dao IMPLEMENTATION.
METHOD select_all_employees.

METHOD select_all.
DATA: lt_employees TYPE ty_employees,
ls_employee TYPE ty_employee,
lv_result TYPE string.

SELECT *
SELECT id, firstName, lastName
larshp marked this conversation as resolved.
Show resolved Hide resolved
FROM employees
INTO TABLE lt_employees.

Expand All @@ -34,4 +39,5 @@ CLASS zcl_dirigible_employee_dao IMPLEMENTATION.

rv_result = lv_result.
ENDMETHOD.

ENDCLASS.
25 changes: 21 additions & 4 deletions src/zcl_hello_world.clas.abap
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
CLASS zcl_hello_world DEFINITION PUBLIC FINAL CREATE PUBLIC.

PUBLIC SECTION.
CLASS-METHODS run.

PRIVATE SECTION.
DATA: lo_employee_dao TYPE REF TO zcl_dirigible_employee_dao.

ENDCLASS.

CLASS zcl_hello_world IMPLEMENTATION.

METHOD run.
DATA: lv_result TYPE string.

CREATE OBJECT lo_employee_dao.

zcl_dirigible_response=>println(
EXPORTING
message_in = 'hello world!' ).
message_in = 'Hello world!' ).

zcl_dirigible_response=>println(
EXPORTING
message_in = 'inserting an employee...' ).
message_in = 'Selecting all employees...' ).

lv_result = lo_employee_dao->select_all( ).

zcl_dirigible_response=>println(
EXPORTING
message_in = 'employee was inserted!' ).
message_in = 'Employees selected.' ).

zcl_dirigible_response=>println(
EXPORTING
message_in = 'Employee Data:'
data_in = lv_result ).
ENDMETHOD.
ENDCLASS.

ENDCLASS.
Loading