From bc567309f50f22fd58567eaa91542ce1e59c01fd Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 10:07:11 +0000 Subject: [PATCH 01/20] docs: point demo image at the abap2UI5-addons org The screenshot URL still referenced the old abap2UI5-apps org and only worked via GitHub's repo-transfer redirect. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c986d61..184d4f9 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ SQL Console in Your Browser – No Need for Eclipse or SAP GUI Installation * Fix ABAP Cloud Readiness #### Demo -image +image #### Contribution & Support Pull Requests are welcome! Whether you're fixing a bug, adding new functionality, or improving the documentation, your contributions are always appreciated. If you run into problems, feel free to open an issue. From b6bbc70cfa90995dd42a027dfb2ac75ee31332e4 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 10:16:54 +0000 Subject: [PATCH 02/20] docs: add CI status badges to README The three workflows existed but the README lacked the badge block the sibling addons have. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 184d4f9..45a1005 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +[![ABAP_STANDARD](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_STANDARD.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_STANDARD.yaml) +[![ABAP_CLOUD](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_CLOUD.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_CLOUD.yaml) +
+[![rename_test](https://github.com/abap2UI5-addons/sql-console/actions/workflows/rename_test.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/rename_test.yaml) + # sql-console SQL Console in Your Browser – No Need for Eclipse or SAP GUI Installation From fb43fbf1ebdc8f3ed22d3582b27d888f1227c474 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 10:44:03 +0000 Subject: [PATCH 03/20] ci: validate pull requests and add Dependabot The three workflows only triggered on push to main, so a PR with broken ABAP passed with no checks and the failure only surfaced after merge on a then-red main. Added pull_request as an additional trigger (sibling layout-management already does this) and a Dependabot config matching the other repos (weekly npm + github-actions, @abaplint grouped). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- .github/dependabot.yml | 18 ++++++++++++++++++ .github/workflows/ABAP_CLOUD.yaml | 1 + .github/workflows/ABAP_STANDARD.yaml | 1 + .github/workflows/rename_test.yaml | 1 + 4 files changed, 21 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..9997317 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +# Keep the npm dependency tree and the GitHub Actions pinned versions +# up to date and covered by security alerts. +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + groups: + abaplint: + patterns: + - "@abaplint/*" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/ABAP_CLOUD.yaml b/.github/workflows/ABAP_CLOUD.yaml index 2cf95d6..4d250b1 100644 --- a/.github/workflows/ABAP_CLOUD.yaml +++ b/.github/workflows/ABAP_CLOUD.yaml @@ -3,6 +3,7 @@ name: ABAP_CLOUD on: push: branches: [main] + pull_request: permissions: contents: read diff --git a/.github/workflows/ABAP_STANDARD.yaml b/.github/workflows/ABAP_STANDARD.yaml index c6386ff..0ec924c 100644 --- a/.github/workflows/ABAP_STANDARD.yaml +++ b/.github/workflows/ABAP_STANDARD.yaml @@ -3,6 +3,7 @@ name: ABAP_STANDARD on: push: branches: [main] + pull_request: permissions: contents: read diff --git a/.github/workflows/rename_test.yaml b/.github/workflows/rename_test.yaml index e65a583..1c5af4b 100644 --- a/.github/workflows/rename_test.yaml +++ b/.github/workflows/rename_test.yaml @@ -3,6 +3,7 @@ name: rename_test on: push: branches: [main] + pull_request: permissions: contents: read From f5b3f44e18a5ebdb3f04df0a155d802e8f68430f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 10:47:19 +0000 Subject: [PATCH 04/20] docs: note that authorization checks are the operator's responsibility This addon accesses data by table/SQL the user names and has no authorization check of its own by design (it is a developer tool). Document that explicitly and point operators at adding their own checks before using it beyond a development system. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 45a1005..c9c6124 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ SQL Console in Your Browser – No Need for Eclipse or SAP GUI Installation * S/4 Private Cloud or On-Premise (ABAP for Cloud, Standard ABAP) * SAP NetWeaver AS ABAP 7.50 or higher (Standard ABAP) +#### Security +This is a developer tool. It runs the SQL the user enters, without an authorization check of its own; the native path additionally uses ADBC and therefore bypasses ABAP authorizations and client separation. Before using it beyond a development system, add your own authorization checks and restrict who may run the app (see the Todo below). + #### Dependencies * [abap2UI5](https://github.com/abap2UI5/abap2UI5) * [popups](https://github.com/abap2UI5-addons/popups) From 7f7eda883b67f70cfaec50c38f2f8ebf441d1c8c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 11:07:21 +0000 Subject: [PATCH 05/20] chore: remove Dependabot config Dependency updates will be handled manually. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- .github/dependabot.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 9997317..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Keep the npm dependency tree and the GitHub Actions pinned versions -# up to date and covered by security alerts. -version: 2 -updates: - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" - open-pull-requests-limit: 5 - groups: - abaplint: - patterns: - - "@abaplint/*" - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" From b582d7d49369256f56c6796671b6e03659f2adf3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 11:10:24 +0000 Subject: [PATCH 06/20] ci: add build_rename workflow for namespace branches Adds the same rename-branch feature abap2UI5 and frontend have: a workflow_dispatch that renames all artifacts to a chosen namespace and pushes the result to rename_ (e.g. rename_zmyui5), ready to pull with abapGit for a parallel installation in the same system. Reuses the existing .github/abaplint/rename.json (placeholder zabap2ui5) with the chosen name substituted; main is carried as second parent. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- .github/workflows/build_rename.yaml | 101 ++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/build_rename.yaml diff --git a/.github/workflows/build_rename.yaml b/.github/workflows/build_rename.yaml new file mode 100644 index 0000000..2452817 --- /dev/null +++ b/.github/workflows/build_rename.yaml @@ -0,0 +1,101 @@ +name: build_rename + +# Renames all artifacts to a chosen namespace and pushes the result to +# the branch rename_, e.g. rename_zmyui5 - ready to pull with +# abapGit for a parallel installation in the same SAP system. The +# renaming itself is the plain abaplint rename with the checked-in +# config .github/abaplint/rename.json (placeholder "zabap2ui5"); this +# workflow only sets the chosen name in the config and stores the +# result. Re-running with the same name updates the branch to the +# current main state; without content changes nothing is pushed. The +# main commit is carried as second parent so GitHub shows the branch as +# "ahead" instead of "behind" main. + +on: + workflow_dispatch: + inputs: + namespace: + description: "New namespace (max. 9 characters), e.g. ZMYUI5" + required: true + type: string + default: zabap2ui5 + +permissions: + contents: write + +concurrency: + group: build_rename-${{ inputs.namespace }} + cancel-in-progress: false + +jobs: + build_rename: + runs-on: ubuntu-latest + timeout-minutes: 15 + env: + NAMESPACE: ${{ inputs.namespace }} + steps: + # validate the input and derive the branch name before building + - name: Derive branch name + run: | + if ! printf '%s' "$NAMESPACE" | grep -Eq '^[A-Za-z][A-Za-z0-9_]{0,8}$'; then + echo "::error::Invalid namespace '$NAMESPACE' (letter + letters/digits/underscore, max. 9 characters)" + exit 1 + fi + ns=$(printf '%s' "$NAMESPACE" | tr '[:upper:]' '[:lower:]') + if [ "$ns" = "z2ui5" ]; then + echo "::error::Namespace '$NAMESPACE' is the original namespace - nothing to rename" + exit 1 + fi + echo "NS=$ns" >> "$GITHUB_ENV" + echo "BRANCH=rename_$ns" >> "$GITHUB_ENV" + echo "Building branch: rename_$ns" + + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + - run: npm ci + + # set the chosen name in the rename config and run the abaplint + # rename; it writes the renamed sources to + # .github/abaplint/output//src + - name: Rename to ${{ inputs.namespace }} + run: | + sed "s/zabap2ui5/$NS/g" .github/abaplint/rename.json > .github/abaplint/rename_run.json + npx abaplint .github/abaplint/rename_run.json --rename + + # branch content: the renamed src tree plus the abapGit descriptor + # and the license + - name: Assemble branch content + run: | + src=$(find .github/abaplint/output -type d -name src | head -n 1) + if [ -z "$src" ]; then + echo "::error::no renamed src folder found under .github/abaplint/output" + exit 1 + fi + out=".github/out/$BRANCH" + rm -rf "$out" + mkdir -p "$out" + cp -r "$src" "$out/src" + cp LICENSE "$out/" + cp .abapgit.xml "$out/" + + - name: Push renamed branch + run: | + b="$BRANCH" + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + git fetch origin "$b" --depth 1 2>/dev/null || true + parent=$(git rev-parse -q --verify "refs/remotes/origin/$b" || true) + index="$RUNNER_TEMP/index-$b" + rm -f "$index" + (cd ".github/out/$b" && GIT_DIR="$GITHUB_WORKSPACE/.git" GIT_WORK_TREE=. GIT_INDEX_FILE="$index" git add -A) + tree=$(GIT_INDEX_FILE="$index" git write-tree) + if [ -n "$parent" ] && [ "$(git rev-parse "$parent^{tree}")" = "$tree" ]; then + echo "$b: no changes" + exit 0 + fi + commit=$(git commit-tree "$tree" ${parent:+-p "$parent"} -p "$GITHUB_SHA" -m "build: $b from $GITHUB_SHA") + git push origin "$commit:refs/heads/$b" + echo "$b: pushed $commit" From 72f6625a8637112e654972ad97a9edf31fb1301e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 11:12:40 +0000 Subject: [PATCH 07/20] chore: drop unused devDependencies Only @abaplint/cli is actually used (abaplint checks + rename). The transpiler/runtime/sqlite stack, @types/node and npm-check-updates had zero references - carried over from a template. abaplint still reports 0 issues after removal. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- package-lock.json | 99 +---------------------------------------------- package.json | 7 +--- 2 files changed, 2 insertions(+), 104 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5668a97..e03ebbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,7 @@ "version": "1.0.0", "license": "MIT", "devDependencies": { - "@abaplint/cli": "^2.119.14", - "@abaplint/database-sqlite": "^2.11.78", - "@abaplint/runtime": "^2.13.22", - "@abaplint/transpiler-cli": "^2.13.22", - "@types/node": "^22.10.5", - "npm-check-updates": "^17.1.18" + "@abaplint/cli": "^2.119.14" } }, "node_modules/@abaplint/cli": { @@ -32,98 +27,6 @@ "funding": { "url": "https://github.com/sponsors/larshp" } - }, - "node_modules/@abaplint/database-sqlite": { - "version": "2.11.78", - "resolved": "https://registry.npmjs.org/@abaplint/database-sqlite/-/database-sqlite-2.11.78.tgz", - "integrity": "sha512-1s5GhhwzcupKQhK2lZW7GKIvsz/WukgjuLk2oHmlSXWGFtapLYO9wJCtUSmSNTMNuXXaVt8ks2t2RH8SVj6hCg==", - "dev": true, - "license": "MIT", - "dependencies": { - "sql.js": "^1.11.0" - } - }, - "node_modules/@abaplint/runtime": { - "version": "2.13.22", - "resolved": "https://registry.npmjs.org/@abaplint/runtime/-/runtime-2.13.22.tgz", - "integrity": "sha512-4/evgMO3RqY0oz0ZYW7jaGYYuJKK0QwUiIMBTeyANVMd12Kzz8g0CdZIEPs4QkKiyPlwa3Gsz503mrZJJ49/EA==", - "dev": true, - "license": "MIT", - "dependencies": { - "temporal-polyfill": "^0.3.2" - }, - "funding": { - "url": "https://github.com/sponsors/larshp" - } - }, - "node_modules/@abaplint/transpiler-cli": { - "version": "2.13.22", - "resolved": "https://registry.npmjs.org/@abaplint/transpiler-cli/-/transpiler-cli-2.13.22.tgz", - "integrity": "sha512-++7h7dmDGXuwghbm/81qwrXGYUT+j4npWQpw/M96/HdTyGL45AJpOMlIFsea7ZthvJM/QZ2Whf2VG00+iZN/BQ==", - "dev": true, - "license": "MIT", - "bin": { - "abap_transpile": "abap_transpile" - }, - "funding": { - "url": "https://github.com/sponsors/larshp" - } - }, - "node_modules/@types/node": { - "version": "22.19.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.18.tgz", - "integrity": "sha512-9v00a+dn2yWVsYDEunWC4g/TcRKVq3r8N5FuZp7u0SGrPvdN9c2yXI9bBuf5Fl0hNCb+QTIePTn5pJs2pwBOQQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/npm-check-updates": { - "version": "17.1.18", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-17.1.18.tgz", - "integrity": "sha512-bkUy2g4v1i+3FeUf5fXMLbxmV95eG4/sS7lYE32GrUeVgQRfQEk39gpskksFunyaxQgTIdrvYbnuNbO/pSUSqw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "ncu": "build/cli.js", - "npm-check-updates": "build/cli.js" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0", - "npm": ">=8.12.1" - } - }, - "node_modules/sql.js": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sql.js/-/sql.js-1.14.1.tgz", - "integrity": "sha512-gcj8zBWU5cFsi9WUP+4bFNXAyF1iRpA3LLyS/DP5xlrNzGmPIizUeBggKa8DbDwdqaKwUcTEnChtd2grWo/x/A==", - "dev": true, - "license": "MIT" - }, - "node_modules/temporal-polyfill": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.3.2.tgz", - "integrity": "sha512-TzHthD/heRK947GNiSu3Y5gSPpeUDH34+LESnfsq8bqpFhsB79HFBX8+Z834IVX68P3EUyRPZK5bL/1fh437Eg==", - "dev": true, - "license": "MIT", - "dependencies": { - "temporal-spec": "0.3.1" - } - }, - "node_modules/temporal-spec": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.3.1.tgz", - "integrity": "sha512-B4TUhezh9knfSIMwt7RVggApDRJZo73uZdj8AacL2mZ8RP5KtLianh2MXxL06GN9ESYiIsiuoLQhgVfwe55Yhw==", - "dev": true, - "license": "ISC" - }, - "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, - "license": "MIT" } } } diff --git a/package.json b/package.json index d8f251b..fa74b6d 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,6 @@ }, "homepage": "https://github.com/abap2UI5-addons/sql-console#readme", "devDependencies": { - "@abaplint/cli": "^2.119.14", - "@abaplint/database-sqlite": "^2.11.78", - "@abaplint/runtime": "^2.13.22", - "@abaplint/transpiler-cli": "^2.13.22", - "@types/node": "^22.10.5", - "npm-check-updates": "^17.1.18" + "@abaplint/cli": "^2.119.14" } } From e7fbc65658d16b0c0d03efce5706ffa6b0194a00 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 11:45:15 +0000 Subject: [PATCH 08/20] refactor: vendor sql-console context and db classes instead of z2ui5_cl_util Adopts the popups/samples pattern: sql-console now carries its own z2ui5_sql_cl_context (the utility methods it uses: conv/itab/filter/ rtti/xml/srtti/time/uuid plus their private helpers and filter types) and z2ui5_sql_cl_db (the four z2ui5_t_91 persistence helpers), copied from the abap2UI5 utility classes, instead of calling z2ui5_cl_util / z2ui5_cl_util_db directly. The db copy still reads/writes the shared z2ui5_t_91 table via the abap2UI5 dependency. abaplint standard: 0 issues. The cloud check keeps its pre-existing failures in src/native/ (ADBC/DDIC types not available in ABAP Cloud); the new classes are cloud-clean. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- src/abap/z2ui5_sql_cl_app_01.clas.abap | 36 +- src/abap/z2ui5_sql_cl_context.clas.abap | 534 ++++++++++++++++++ src/abap/z2ui5_sql_cl_context.clas.xml | 16 + src/abap/z2ui5_sql_cl_db.clas.abap | 177 ++++++ src/abap/z2ui5_sql_cl_db.clas.xml | 16 + src/abap/z2ui5_sql_cl_history_api.clas.abap | 18 +- ...i5_native_sql_console.clas.locals_imp.abap | 16 +- .../zcl_2ui5_native_sql_console_st.clas.abap | 2 +- 8 files changed, 779 insertions(+), 36 deletions(-) create mode 100644 src/abap/z2ui5_sql_cl_context.clas.abap create mode 100644 src/abap/z2ui5_sql_cl_context.clas.xml create mode 100644 src/abap/z2ui5_sql_cl_db.clas.abap create mode 100644 src/abap/z2ui5_sql_cl_db.clas.xml diff --git a/src/abap/z2ui5_sql_cl_app_01.clas.abap b/src/abap/z2ui5_sql_cl_app_01.clas.abap index 7b60bc2..6d5fda7 100644 --- a/src/abap/z2ui5_sql_cl_app_01.clas.abap +++ b/src/abap/z2ui5_sql_cl_app_01.clas.abap @@ -54,7 +54,7 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. cont_size TYPE string, title TYPE string, search_field TYPE string, - t_filter TYPE z2ui5_cl_util=>ty_t_filter_multi, + t_filter TYPE z2ui5_sql_cl_context=>ty_t_filter_multi, rtti_data TYPE string, rtti_data_back TYPE string, END OF ty_s_preview. @@ -63,7 +63,7 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. BEGIN OF ms_draft, s_preview TYPE ty_s_preview, sql_input TYPE string, - sql_s_command TYPE z2ui5_cl_util=>ty_s_filter_multi, + sql_s_command TYPE z2ui5_sql_cl_context=>ty_s_filter_multi, sql_max_rows TYPE i, sql_cont_size TYPE string, history_cont_size TYPE string, @@ -185,14 +185,14 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. CLEAR ls_preview-tab. CLEAR ls_preview-tab_backup. - ls_preview-rtti_data = z2ui5_cl_util=>xml_srtti_stringify( ). + ls_preview-rtti_data = z2ui5_sql_cl_context=>xml_srtti_stringify( ). IF IS ASSIGNED. - ls_preview-rtti_data_back = z2ui5_cl_util=>xml_srtti_stringify( ). + ls_preview-rtti_data_back = z2ui5_sql_cl_context=>xml_srtti_stringify( ). ENDIF. - lr_hist->s_db-timestampl = z2ui5_cl_util=>time_get_timestampl( ). + lr_hist->s_db-timestampl = z2ui5_sql_cl_context=>time_get_timestampl( ). IF lr_hist->s_db-uuid IS INITIAL. - lr_hist->s_db-uuid = z2ui5_cl_util=>uuid_get_c32( ). + lr_hist->s_db-uuid = z2ui5_sql_cl_context=>uuid_get_c32( ). ENDIF. z2ui5_sql_cl_history_api=>db_create( VALUE #( sql_command = ms_draft-sql_input @@ -200,7 +200,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. timestampl = lr_hist->s_db-timestampl uuid = lr_hist->s_db-uuid counter = lines( ) - result_data = z2ui5_cl_util=>xml_srtti_stringify( ls_preview ) ) ). + result_data = z2ui5_sql_cl_context=>xml_srtti_stringify( ls_preview ) ) ). lr_hist->s_db-sql_command = ms_draft-sql_input. lr_hist->s_db-tabname = ms_draft-sql_s_command-name. @@ -230,7 +230,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. CLEAR ms_draft-s_preview-tab. IF ls_entry-result_data IS NOT INITIAL. - lr_preview = z2ui5_cl_util=>xml_srtti_parse( rtti_data = ls_entry-result_data ). + lr_preview = z2ui5_sql_cl_context=>xml_srtti_parse( rtti_data = ls_entry-result_data ). FIELD-SYMBOLS TYPE any. ASSIGN lr_preview->('title') TO . @@ -243,12 +243,12 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. DATA lr_data TYPE REF TO data. ASSIGN lr_preview->('rtti_data') TO . - lr_data = z2ui5_cl_util=>xml_srtti_parse( ). - ms_draft-s_preview-tab = z2ui5_cl_util=>conv_copy_ref_data( lr_data ). + lr_data = z2ui5_sql_cl_context=>xml_srtti_parse( ). + ms_draft-s_preview-tab = z2ui5_sql_cl_context=>conv_copy_ref_data( lr_data ). ASSIGN lr_preview->('rtti_data_back') TO . - lr_data = z2ui5_cl_util=>xml_srtti_parse( ). - ms_draft-s_preview-tab_backup = z2ui5_cl_util=>conv_copy_ref_data( lr_data ). + lr_data = z2ui5_sql_cl_context=>xml_srtti_parse( ). + ms_draft-s_preview-tab_backup = z2ui5_sql_cl_context=>conv_copy_ref_data( lr_data ). ENDIF. @@ -306,7 +306,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. IF ms_draft-s_preview-search_field IS NOT INITIAL. - z2ui5_cl_util=>itab_filter_by_val( + z2ui5_sql_cl_context=>itab_filter_by_val( EXPORTING val = ms_draft-s_preview-search_field CHANGING @@ -325,7 +325,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ASSIGN ms_draft-s_preview-tab_backup->* TO . = . preview_filter_search( ). - ms_draft-s_preview-title = `Number of Rows: ` && ` (` && z2ui5_cl_util=>c_trim( lines( ) ) && `)`. + ms_draft-s_preview-title = `Number of Rows: ` && ` (` && z2ui5_sql_cl_context=>c_trim( lines( ) ) && `)`. preview_view( ). history_db_save( ). @@ -344,7 +344,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ASSIGN ms_draft-s_preview-tab_backup->* TO . = . - ms_draft-s_preview-title = `Number of Rows: ` && ` ` && z2ui5_cl_util=>c_trim( lines( ) ). + ms_draft-s_preview-title = `Number of Rows: ` && ` ` && z2ui5_sql_cl_context=>c_trim( lines( ) ). preview_view( ). client->message_toast_display( `All filters deleted` ). @@ -386,7 +386,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. )->get_parent( ). - DATA(lt_fields) = z2ui5_cl_util=>rtti_get_t_attri_by_any( ). + DATA(lt_fields) = z2ui5_sql_cl_context=>rtti_get_t_attri_by_any( ). DATA(lo_columns) = tab->ui_columns( ). LOOP AT lt_fields INTO DATA(lv_field). @@ -451,8 +451,8 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. preview_view( ). - ms_draft-s_preview-t_filter = z2ui5_cl_util=>filter_get_multi_by_data( ). - ms_draft-s_preview-title = `Number of Rows: ` && ` ` && z2ui5_cl_util=>c_trim( lines( ) ). + ms_draft-s_preview-t_filter = z2ui5_sql_cl_context=>filter_get_multi_by_data( ). + ms_draft-s_preview-title = `Number of Rows: ` && ` ` && z2ui5_sql_cl_context=>c_trim( lines( ) ). history_db_save( ). client->view_model_update( ). diff --git a/src/abap/z2ui5_sql_cl_context.clas.abap b/src/abap/z2ui5_sql_cl_context.clas.abap new file mode 100644 index 0000000..d0dada9 --- /dev/null +++ b/src/abap/z2ui5_sql_cl_context.clas.abap @@ -0,0 +1,534 @@ +CLASS z2ui5_sql_cl_context DEFINITION + PUBLIC + CREATE PUBLIC. + + PUBLIC SECTION. + + TYPES: + BEGIN OF ty_s_token, + key TYPE string, + text TYPE string, + visible TYPE abap_bool, + selkz TYPE abap_bool, + editable TYPE abap_bool, + END OF ty_s_token. + TYPES ty_t_token TYPE STANDARD TABLE OF ty_s_token WITH EMPTY KEY. + + TYPES: + BEGIN OF ty_s_range, + sign TYPE c LENGTH 1, + option TYPE c LENGTH 2, + low TYPE string, + high TYPE string, + END OF ty_s_range. + TYPES ty_t_range TYPE STANDARD TABLE OF ty_s_range WITH EMPTY KEY. + + TYPES: + BEGIN OF ty_s_filter_multi, + name TYPE string, + t_range TYPE ty_t_range, + t_token TYPE ty_t_token, + t_token_added TYPE ty_t_token, + t_token_removed TYPE ty_t_token, + END OF ty_s_filter_multi. + TYPES ty_t_filter_multi TYPE STANDARD TABLE OF ty_s_filter_multi WITH EMPTY KEY. + + "! Vendored copy of the abap2UI5 utility methods this app uses, so the + "! app carries its own context instead of depending on z2ui5_cl_util. + CLASS-DATA cv_char_util_horizontal_tab TYPE c LENGTH 1 READ-ONLY. + + CLASS-METHODS class_constructor. + + CLASS-METHODS c_trim + IMPORTING + val TYPE any + RETURNING + VALUE(result) TYPE string. + + CLASS-METHODS conv_copy_ref_data + IMPORTING + !from TYPE any + RETURNING + VALUE(result) TYPE REF TO data. + + CLASS-METHODS conv_get_string_by_xstring + IMPORTING + val TYPE xstring + RETURNING + VALUE(result) TYPE string. + + CLASS-METHODS conv_get_xstring_by_string + IMPORTING + val TYPE string + RETURNING + VALUE(result) TYPE xstring. + + CLASS-METHODS filter_get_multi_by_data + IMPORTING + val TYPE data + RETURNING + VALUE(result) TYPE ty_t_filter_multi. + + CLASS-METHODS itab_filter_by_val + IMPORTING + val TYPE clike + fields TYPE string_table OPTIONAL + ignore_case TYPE abap_bool DEFAULT abap_false + CHANGING + !tab TYPE STANDARD TABLE. + + CLASS-METHODS rtti_get_t_attri_by_any + IMPORTING + val TYPE any + RETURNING + VALUE(result) TYPE cl_abap_structdescr=>component_table. + + CLASS-METHODS time_get_timestampl + RETURNING + VALUE(result) TYPE timestampl. + + CLASS-METHODS uuid_get_c32 + RETURNING + VALUE(result) TYPE string. + + CLASS-METHODS xml_parse + IMPORTING + !xml TYPE clike + EXPORTING + !any TYPE any. + + CLASS-METHODS xml_stringify + IMPORTING + !any TYPE any + RETURNING + VALUE(result) TYPE string + RAISING + cx_xslt_serialization_error. + + CLASS-METHODS xml_srtti_parse + IMPORTING + rtti_data TYPE clike + RETURNING + VALUE(result) TYPE REF TO data. + + CLASS-METHODS xml_srtti_stringify + IMPORTING + !data TYPE any + RETURNING + VALUE(result) TYPE string. + + PROTECTED SECTION. + + CLASS-METHODS rtti_check_ref_data + IMPORTING + val TYPE any + RETURNING + VALUE(result) TYPE abap_bool. + + CLASS-METHODS rtti_check_class_exists + IMPORTING + val TYPE clike + RETURNING + VALUE(result) TYPE abap_bool. + + CLASS-METHODS rtti_get_t_attri_by_include + IMPORTING + !type TYPE REF TO cl_abap_datadescr + RETURNING + VALUE(result) TYPE abap_component_tab. + + PRIVATE SECTION. +ENDCLASS. + + +CLASS z2ui5_sql_cl_context IMPLEMENTATION. + + METHOD class_constructor. + + cv_char_util_horizontal_tab = cl_abap_char_utilities=>horizontal_tab. + + ENDMETHOD. + + METHOD c_trim. + + result = shift_left( shift_right( CONV string( val ) ) ). + result = shift_right( val = result + sub = cv_char_util_horizontal_tab ). + result = shift_left( val = result + sub = cv_char_util_horizontal_tab ). + result = shift_left( shift_right( result ) ). + + ENDMETHOD. + + METHOD conv_copy_ref_data. + + FIELD-SYMBOLS TYPE data. + FIELD-SYMBOLS TYPE data. + + IF rtti_check_ref_data( from ). + ASSIGN from->* TO . + ELSE. + ASSIGN from TO . + ENDIF. + CREATE DATA result LIKE . + ASSIGN result->* TO . + + = . + + ENDMETHOD. + + METHOD conv_get_string_by_xstring. + + DATA conv TYPE REF TO object. + DATA conv_codepage TYPE c LENGTH 21. + DATA conv_in_class TYPE c LENGTH 18. + + TRY. + + conv_codepage = `CL_ABAP_CONV_CODEPAGE`. + CALL METHOD (conv_codepage)=>create_in + RECEIVING + instance = conv. + + CALL METHOD conv->(`IF_ABAP_CONV_IN~CONVERT`) + EXPORTING + source = val + RECEIVING + result = result. + + CATCH cx_root. + + conv_in_class = `CL_ABAP_CONV_IN_CE`. + CALL METHOD (conv_in_class)=>create + EXPORTING + encoding = `UTF-8` + RECEIVING + conv = conv. + + CALL METHOD conv->(`CONVERT`) + EXPORTING + input = val + IMPORTING + data = result. + ENDTRY. + + ENDMETHOD. + + METHOD conv_get_xstring_by_string. + + DATA conv TYPE REF TO object. + DATA conv_codepage TYPE c LENGTH 21. + DATA conv_out_class TYPE c LENGTH 19. + + TRY. + + conv_codepage = `CL_ABAP_CONV_CODEPAGE`. + CALL METHOD (conv_codepage)=>create_out + RECEIVING + instance = conv. + + CALL METHOD conv->(`IF_ABAP_CONV_OUT~CONVERT`) + EXPORTING + source = val + RECEIVING + result = result. + + CATCH cx_root. + + conv_out_class = `CL_ABAP_CONV_OUT_CE`. + CALL METHOD (conv_out_class)=>create + EXPORTING + encoding = `UTF-8` + RECEIVING + conv = conv. + + CALL METHOD conv->(`CONVERT`) + EXPORTING + data = val + IMPORTING + buffer = result. + ENDTRY. + + ENDMETHOD. + + METHOD filter_get_multi_by_data. + + LOOP AT rtti_get_t_attri_by_any( val ) REFERENCE INTO DATA(lr_comp). + INSERT VALUE #( name = lr_comp->name ) INTO TABLE result. + ENDLOOP. + + ENDMETHOD. + + METHOD itab_filter_by_val. + " TRANSPILER NOTE: ABAP CS operator is ALWAYS case-insensitive regardless + " of the ignore_case flag. The flag only pre-converts to uppercase for + " consistency, but CS itself never does case-sensitive matching. + " JS equivalent: always use toLowerCase().includes(toLowerCase()). + FIELD-SYMBOLS TYPE any. + FIELD-SYMBOLS TYPE any. + + DATA(lv_search) = COND string( WHEN ignore_case = abap_true + THEN to_upper( val ) + ELSE val ). + + LOOP AT tab ASSIGNING . + + DATA(lv_check_found) = abap_false. + DATA(lv_index) = 1. + DO. + IF fields IS INITIAL. + ASSIGN COMPONENT lv_index OF STRUCTURE TO . + IF sy-subrc <> 0. + EXIT. + ENDIF. + ELSE. + IF lv_index > lines( fields ). + EXIT. + ENDIF. + DATA(lv_name) = fields[ lv_index ]. + ASSIGN COMPONENT lv_name OF STRUCTURE TO . + IF sy-subrc <> 0. + lv_index = lv_index + 1. + CONTINUE. + ENDIF. + ENDIF. + + DATA(lv_value) = |{ }|. + IF ignore_case = abap_true. + lv_value = to_upper( lv_value ). + IF lv_value CS lv_search. + lv_check_found = abap_true. + EXIT. + ENDIF. + ELSE. + " Case-sensitive: use find() because CS is always case-insensitive + IF find( val = lv_value sub = lv_search ) >= 0. + lv_check_found = abap_true. + EXIT. + ENDIF. + ENDIF. + + lv_index = lv_index + 1. + ENDDO. + + IF lv_check_found = abap_false. + DELETE tab. + ENDIF. + + ENDLOOP. + + ENDMETHOD. + + METHOD rtti_get_t_attri_by_any. + + DATA lo_struct TYPE REF TO cl_abap_structdescr. + DATA lo_type TYPE REF TO cl_abap_typedescr. + + TRY. + lo_type = cl_abap_typedescr=>describe_by_data( val ). + IF lo_type->kind = cl_abap_typedescr=>kind_ref. + lo_type = cl_abap_typedescr=>describe_by_data_ref( val ). + ENDIF. + CATCH cx_root. + TRY. + lo_type = cl_abap_typedescr=>describe_by_data_ref( val ). + CATCH cx_root. + lo_type = cl_abap_structdescr=>describe_by_name( val ). + ENDTRY. + ENDTRY. + + CASE lo_type->kind. + WHEN cl_abap_typedescr=>kind_struct. + lo_struct = CAST #( lo_type ). + WHEN cl_abap_typedescr=>kind_table. + lo_struct = CAST #( CAST cl_abap_tabledescr( lo_type )->get_table_line_type( ) ). + WHEN OTHERS. + lo_struct ?= lo_type. + ENDCASE. + + DATA(comps) = lo_struct->get_components( ). + + LOOP AT comps REFERENCE INTO DATA(lr_comp). + + IF lr_comp->as_include = abap_false. + APPEND lr_comp->* TO result. + ELSE. + DATA(lt_attri) = rtti_get_t_attri_by_include( lr_comp->type ). + APPEND LINES OF lt_attri TO result. + ENDIF. + ENDLOOP. + + ENDMETHOD. + + METHOD time_get_timestampl. + GET TIME STAMP FIELD result. + ENDMETHOD. + + METHOD uuid_get_c32. + DATA lv_uuid TYPE c LENGTH 32. + DATA lv_classname TYPE string. + DATA lv_fm TYPE string. + + TRY. + + TRY. + + lv_classname = `CL_SYSTEM_UUID`. + CALL METHOD (lv_classname)=>if_system_uuid_static~create_uuid_c32 + RECEIVING + uuid = lv_uuid. + + CATCH cx_root. + + lv_fm = `GUID_CREATE`. + CALL FUNCTION lv_fm + IMPORTING + ev_guid_32 = lv_uuid. + + ENDTRY. + + result = lv_uuid. + + CATCH cx_root. + ASSERT 1 = 0. + ENDTRY. + ENDMETHOD. + + METHOD xml_parse. + + IF xml IS INITIAL. + CLEAR any. + RETURN. + ENDIF. + + CALL TRANSFORMATION id + SOURCE XML xml + RESULT data = any. + + ENDMETHOD. + + METHOD xml_stringify. + + CALL TRANSFORMATION id + SOURCE data = any + RESULT XML result + OPTIONS data_refs = `heap-or-create`. + + ENDMETHOD. + + METHOD xml_srtti_parse. + + DATA srtti TYPE REF TO object. + CALL TRANSFORMATION id SOURCE XML rtti_data RESULT srtti = srtti. + + DATA rtti_type TYPE REF TO cl_abap_typedescr. + CALL METHOD srtti->(`GET_RTTI`) + RECEIVING + rtti = rtti_type. + + DATA lo_datadescr TYPE REF TO cl_abap_datadescr. + lo_datadescr ?= rtti_type. + + CREATE DATA result TYPE HANDLE lo_datadescr. + ASSIGN result->* TO FIELD-SYMBOL(). + CALL TRANSFORMATION id SOURCE XML rtti_data RESULT dobj = . + + ENDMETHOD. + + METHOD xml_srtti_stringify. + + IF rtti_check_class_exists( `ZCL_SRTTI_TYPEDESCR` ) = abap_true. + + DATA srtti TYPE REF TO object. + DATA(lv_classname) = `ZCL_SRTTI_TYPEDESCR`. + CALL METHOD (lv_classname)=>(`CREATE_BY_DATA_OBJECT`) + EXPORTING + data_object = data + RECEIVING + srtti = srtti. + CALL TRANSFORMATION id SOURCE srtti = srtti dobj = data RESULT XML result. + + ELSE. + + TRY. + CALL METHOD z2ui5_cl_srt_typedescr=>(`CREATE_BY_DATA_OBJECT`) + EXPORTING + data_object = data + RECEIVING + srtti = srtti. + CALL TRANSFORMATION id SOURCE srtti = srtti dobj = data RESULT XML result. + + CATCH cx_root. + + DATA(lv_text) = `UNSUPPORTED_FEATURE`. + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING + val = lv_text. + + ENDTRY. + ENDIF. + + ENDMETHOD. + + METHOD rtti_check_ref_data. + + TRY. + DATA(lo_typdescr) = cl_abap_typedescr=>describe_by_data( val ). + DATA(lo_ref) = CAST cl_abap_refdescr( lo_typdescr ) ##NEEDED. + result = abap_true. + CATCH cx_root ##NO_HANDLER. + ENDTRY. + + ENDMETHOD. + + METHOD rtti_check_class_exists. + + TRY. + cl_abap_classdescr=>describe_by_name( EXPORTING p_name = val + EXCEPTIONS type_not_found = 1 ). + IF sy-subrc = 0. + result = abap_true. + ENDIF. + + CATCH cx_root ##NO_HANDLER. + ENDTRY. + + ENDMETHOD. + + METHOD rtti_get_t_attri_by_include. + + TRY. + + cl_abap_typedescr=>describe_by_name( EXPORTING p_name = type->absolute_name + RECEIVING p_descr_ref = DATA(type_desc) + EXCEPTIONS type_not_found = 1 ). + + CATCH cx_root INTO DATA(x). + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING + previous = x. + ENDTRY. + DATA(sdescr) = CAST cl_abap_structdescr( type_desc ). + DATA(comps) = sdescr->get_components( ). + + LOOP AT comps REFERENCE INTO DATA(lr_comp). + + IF lr_comp->as_include = abap_true. + + DATA(incl_comps) = rtti_get_t_attri_by_include( lr_comp->type ). + + LOOP AT incl_comps REFERENCE INTO DATA(lr_incl_comp). + APPEND lr_incl_comp->* TO result. + ENDLOOP. + + ELSE. + + APPEND lr_comp->* TO result. + + ENDIF. + + ENDLOOP. + + ENDMETHOD. + +ENDCLASS. diff --git a/src/abap/z2ui5_sql_cl_context.clas.xml b/src/abap/z2ui5_sql_cl_context.clas.xml new file mode 100644 index 0000000..6f03b78 --- /dev/null +++ b/src/abap/z2ui5_sql_cl_context.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_SQL_CL_CONTEXT + E + SQL Console - vendored utility context + 1 + X + X + X + + + + diff --git a/src/abap/z2ui5_sql_cl_db.clas.abap b/src/abap/z2ui5_sql_cl_db.clas.abap new file mode 100644 index 0000000..a1cb0b3 --- /dev/null +++ b/src/abap/z2ui5_sql_cl_db.clas.abap @@ -0,0 +1,177 @@ +CLASS z2ui5_sql_cl_db DEFINITION + PUBLIC + FINAL + CREATE PUBLIC. + + PUBLIC SECTION. + + TYPES ty_s_db TYPE z2ui5_t_91. + TYPES ty_t_db TYPE STANDARD TABLE OF ty_s_db WITH EMPTY KEY. + + "! Vendored copy of the abap2UI5 persistence helpers this app uses, so + "! the app carries its own DB access instead of depending on + "! z2ui5_cl_util_db. Reads and writes the shared z2ui5_t_91 table. + CLASS-METHODS delete_by_handle + IMPORTING + uname TYPE clike OPTIONAL + handle TYPE clike OPTIONAL + handle2 TYPE clike OPTIONAL + handle3 TYPE clike OPTIONAL + check_commit TYPE abap_bool DEFAULT abap_true. + + CLASS-METHODS save + IMPORTING + uname TYPE clike OPTIONAL + handle TYPE clike OPTIONAL + handle2 TYPE clike OPTIONAL + handle3 TYPE clike OPTIONAL + data TYPE any + check_commit TYPE abap_bool DEFAULT abap_true + RETURNING + VALUE(result) TYPE string. + + CLASS-METHODS load_by_handle + IMPORTING + uname TYPE clike OPTIONAL + handle TYPE clike OPTIONAL + handle2 TYPE clike OPTIONAL + handle3 TYPE clike OPTIONAL + EXPORTING + VALUE(result) TYPE any. + + " only supplied parameters filter the selection, initial values of + " unsupplied parameters do not restrict the result + CLASS-METHODS load_multi_by_handle + IMPORTING + uname TYPE clike OPTIONAL + handle TYPE clike OPTIONAL + handle2 TYPE clike OPTIONAL + handle3 TYPE clike OPTIONAL + RETURNING + VALUE(result) TYPE ty_t_db. + + PROTECTED SECTION. + PRIVATE SECTION. +ENDCLASS. + + +CLASS z2ui5_sql_cl_db IMPLEMENTATION. + + METHOD delete_by_handle. + + DELETE FROM z2ui5_t_91 + WHERE + uname = @uname + AND handle = @handle + AND handle2 = @handle2 + AND handle3 = @handle3. + + IF check_commit = abap_true. + COMMIT WORK AND WAIT. + ENDIF. + + ENDMETHOD. + + METHOD load_by_handle. + + SELECT SINGLE data + FROM z2ui5_t_91 + WHERE + uname = @uname + AND handle = @handle + AND handle2 = @handle2 + AND handle3 = @handle3 "#EC WARNOK + INTO @DATA(lv_data). + IF sy-subrc <> 0. + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING + val = `NO_ENTRY_FOR_HANDLE_EXISTS`. + ENDIF. + + z2ui5_sql_cl_context=>xml_parse( + EXPORTING + xml = lv_data + IMPORTING + any = result ). + + ENDMETHOD. + + METHOD load_multi_by_handle. + + DATA lr_uname TYPE RANGE OF z2ui5_t_91-uname. + DATA lr_handle TYPE RANGE OF z2ui5_t_91-handle. + DATA lr_handle2 TYPE RANGE OF z2ui5_t_91-handle2. + DATA lr_handle3 TYPE RANGE OF z2ui5_t_91-handle3. + + IF uname IS SUPPLIED. + lr_uname = VALUE #( ( sign = `I` option = `EQ` low = uname ) ). + ENDIF. + IF handle IS SUPPLIED. + lr_handle = VALUE #( ( sign = `I` option = `EQ` low = handle ) ). + ENDIF. + IF handle2 IS SUPPLIED. + lr_handle2 = VALUE #( ( sign = `I` option = `EQ` low = handle2 ) ). + ENDIF. + IF handle3 IS SUPPLIED. + lr_handle3 = VALUE #( ( sign = `I` option = `EQ` low = handle3 ) ). + ENDIF. + + SELECT FROM z2ui5_t_91 + FIELDS * + WHERE uname IN @lr_uname + AND handle IN @lr_handle + AND handle2 IN @lr_handle2 + AND handle3 IN @lr_handle3 "#EC WARNOK + INTO CORRESPONDING FIELDS OF TABLE @result. + + ENDMETHOD. + + METHOD save. + + SELECT SINGLE id + FROM z2ui5_t_91 + WHERE + uname = @uname + AND handle = @handle + AND handle2 = @handle2 "#EC WARNOK + AND handle3 = @handle3 + INTO @DATA(lv_id) ##SUBRC_OK. + + DATA lv_data TYPE string. + TRY. + lv_data = z2ui5_sql_cl_context=>xml_stringify( data ). + CATCH cx_xslt_serialization_error. + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING + val = `DB_SAVE_FAILED`. + ENDTRY. + + DATA(ls_db) = VALUE z2ui5_t_91( + uname = uname + handle = handle + handle2 = handle2 + handle3 = handle3 + data = lv_data ). + + IF lv_id IS NOT INITIAL. + ls_db-id = lv_id. + ELSE. + ls_db-id = z2ui5_sql_cl_context=>uuid_get_c32( ). + ENDIF. + + MODIFY z2ui5_t_91 FROM @ls_db. + IF sy-subrc <> 0. + RAISE EXCEPTION TYPE z2ui5_cx_util_error + EXPORTING + val = `DB_SAVE_FAILED`. + ENDIF. + + IF check_commit = abap_true. + COMMIT WORK AND WAIT. + ENDIF. + + result = ls_db-id. + + ENDMETHOD. + +ENDCLASS. diff --git a/src/abap/z2ui5_sql_cl_db.clas.xml b/src/abap/z2ui5_sql_cl_db.clas.xml new file mode 100644 index 0000000..d1ddeb0 --- /dev/null +++ b/src/abap/z2ui5_sql_cl_db.clas.xml @@ -0,0 +1,16 @@ + + + + + + Z2UI5_SQL_CL_DB + E + SQL Console - vendored persistence + 1 + X + X + X + + + + diff --git a/src/abap/z2ui5_sql_cl_history_api.clas.abap b/src/abap/z2ui5_sql_cl_history_api.clas.abap index 9ce7e18..b936fbc 100644 --- a/src/abap/z2ui5_sql_cl_history_api.clas.abap +++ b/src/abap/z2ui5_sql_cl_history_api.clas.abap @@ -59,7 +59,7 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_create. val-uname = sy-uname. - z2ui5_cl_util_db=>save( uname = val-uname + z2ui5_sql_cl_db=>save( uname = val-uname handle = c_handle_history handle2 = val-uuid data = val ). @@ -70,10 +70,10 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. DATA ls_entry TYPE ty_s_entry. - LOOP AT z2ui5_cl_util_db=>load_multi_by_handle( uname = val + LOOP AT z2ui5_sql_cl_db=>load_multi_by_handle( uname = val handle = c_handle_history ) REFERENCE INTO DATA(lr_db). - z2ui5_cl_util=>xml_parse( EXPORTING xml = lr_db->data + z2ui5_sql_cl_context=>xml_parse( EXPORTING xml = lr_db->data IMPORTING any = ls_entry ). INSERT ls_entry INTO TABLE result. @@ -83,10 +83,10 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_delete. - LOOP AT z2ui5_cl_util_db=>load_multi_by_handle( uname = user + LOOP AT z2ui5_sql_cl_db=>load_multi_by_handle( uname = user handle = c_handle_history ) REFERENCE INTO DATA(lr_db). - z2ui5_cl_util_db=>delete_by_handle( uname = lr_db->uname + z2ui5_sql_cl_db=>delete_by_handle( uname = lr_db->uname handle = lr_db->handle handle2 = lr_db->handle2 check_commit = abap_false ). @@ -98,7 +98,7 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_create_draft. - z2ui5_cl_util_db=>save( uname = sy-uname + z2ui5_sql_cl_db=>save( uname = sy-uname handle = c_handle_draft data = CONV string( val ) ). @@ -107,7 +107,7 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_read_draft. TRY. - z2ui5_cl_util_db=>load_by_handle( EXPORTING uname = sy-uname + z2ui5_sql_cl_db=>load_by_handle( EXPORTING uname = sy-uname handle = c_handle_draft IMPORTING result = result ). CATCH z2ui5_cx_util_error. @@ -118,13 +118,13 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_read_by_id. - DATA(lt_db) = z2ui5_cl_util_db=>load_multi_by_handle( handle = c_handle_history + DATA(lt_db) = z2ui5_sql_cl_db=>load_multi_by_handle( handle = c_handle_history handle2 = val ). IF lt_db IS INITIAL. RETURN. ENDIF. - z2ui5_cl_util=>xml_parse( EXPORTING xml = lt_db[ 1 ]-data + z2ui5_sql_cl_context=>xml_parse( EXPORTING xml = lt_db[ 1 ]-data IMPORTING any = result ). ENDMETHOD. diff --git a/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap b/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap index ca262d7..d17b097 100644 --- a/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap +++ b/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap @@ -366,7 +366,7 @@ class history implementation. into @data(data). r_val = value #( base corresponding #( data ) - data = z2ui5_cl_util=>xml_srtti_parse( z2ui5_cl_util=>conv_get_string_by_xstring( data-serialized_results ) ) ). + data = z2ui5_sql_cl_context=>xml_srtti_parse( z2ui5_sql_cl_context=>conv_get_string_by_xstring( data-serialized_results ) ) ). endmethod. method insert_new. @@ -384,7 +384,7 @@ class history implementation. created_at = utclong_current( ) created_by = cl_abap_syst=>get_user_name( ) rows_no = lines( ) - serialized_results = z2ui5_cl_util=>conv_get_xstring_by_string( z2ui5_cl_util=>xml_srtti_stringify( ) ) ). + serialized_results = z2ui5_sql_cl_context=>conv_get_xstring_by_string( z2ui5_sql_cl_context=>xml_srtti_stringify( ) ) ). insert into z2ui5_nsql_c_hst values @new_entry. @@ -556,7 +556,7 @@ class data_result_view implementation. if is assigned. - data(fields) = z2ui5_cl_util=>rtti_get_t_attri_by_any( ). + data(fields) = z2ui5_sql_cl_context=>rtti_get_t_attri_by_any( ). data(table) = me->a_parser->ui_table( id = `previewTab` rows = me->a_ui5_client->_bind( ) @@ -686,8 +686,8 @@ class on_run implementation. ( label = -name property = -name type = `String` ) ) ##NO_TEXT - filters = z2ui5_cl_util=>filter_get_multi_by_data( ) - title = |{ 'Number of Rows:'(010) } { z2ui5_cl_util=>c_trim( lines(
) ) }| ). + filters = z2ui5_sql_cl_context=>filter_get_multi_by_data(
) + title = |{ 'Number of Rows:'(010) } { z2ui5_sql_cl_context=>c_trim( lines(
) ) }| ). new data_result_view( i_state = state i_ui5_client = i_ui5_client )->redraw( ). @@ -777,8 +777,8 @@ class on_load_history_item implementation. ( label = -name property = -name type = `String` ) ) ##NO_TEXT - filters = z2ui5_cl_util=>filter_get_multi_by_data(
) - title = |{ 'Number of Rows:'(010) } { z2ui5_cl_util=>c_trim( lines(
) ) }| ). + filters = z2ui5_sql_cl_context=>filter_get_multi_by_data(
) + title = |{ 'Number of Rows:'(010) } { z2ui5_sql_cl_context=>c_trim( lines(
) ) }| ). new data_result_view( i_state = state i_ui5_client = i_ui5_client )->redraw( ). @@ -884,7 +884,7 @@ class on_wide_filtering implementation. = . - z2ui5_cl_util=>itab_filter_by_val( exporting val = state->results_pane-wide_filter_string + z2ui5_sql_cl_context=>itab_filter_by_val( exporting val = state->results_pane-wide_filter_string changing tab = ). state->results_pane-output_data = state->results_pane-filtered_db_data. diff --git a/src/native/zcl_2ui5_native_sql_console_st.clas.abap b/src/native/zcl_2ui5_native_sql_console_st.clas.abap index ce05963..9474289 100644 --- a/src/native/zcl_2ui5_native_sql_console_st.clas.abap +++ b/src/native/zcl_2ui5_native_sql_console_st.clas.abap @@ -73,7 +73,7 @@ class zcl_2ui5_native_sql_console_st definition title type string, column_config type zcl_2ui5_native_sql_console_st=>t_columns_config, wide_filter_string type string, - filters type z2ui5_cl_util=>ty_t_filter_multi, + filters type z2ui5_sql_cl_context=>ty_t_filter_multi, end of t_results_pane. class-methods instance From 88594e5d8357778d99693e9928568039adbfc9b9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 11:56:50 +0000 Subject: [PATCH 09/20] ci: bump actions/checkout and actions/setup-node to v5 The round-1 action-version pass skipped these four addons; they still ran @v4 while layout-management already uses @v5. Unify on @v5. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- .github/workflows/ABAP_CLOUD.yaml | 4 ++-- .github/workflows/ABAP_STANDARD.yaml | 4 ++-- .github/workflows/build_rename.yaml | 4 ++-- .github/workflows/rename_test.yaml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ABAP_CLOUD.yaml b/.github/workflows/ABAP_CLOUD.yaml index 4d250b1..842a3be 100644 --- a/.github/workflows/ABAP_CLOUD.yaml +++ b/.github/workflows/ABAP_CLOUD.yaml @@ -13,8 +13,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v5 + - uses: actions/setup-node@v5 with: node-version: 22 - run: npm ci diff --git a/.github/workflows/ABAP_STANDARD.yaml b/.github/workflows/ABAP_STANDARD.yaml index 0ec924c..4024a39 100644 --- a/.github/workflows/ABAP_STANDARD.yaml +++ b/.github/workflows/ABAP_STANDARD.yaml @@ -13,8 +13,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v5 + - uses: actions/setup-node@v5 with: node-version: 22 - run: npm ci diff --git a/.github/workflows/build_rename.yaml b/.github/workflows/build_rename.yaml index 2452817..ad80cf3 100644 --- a/.github/workflows/build_rename.yaml +++ b/.github/workflows/build_rename.yaml @@ -50,8 +50,8 @@ jobs: echo "BRANCH=rename_$ns" >> "$GITHUB_ENV" echo "Building branch: rename_$ns" - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v5 + - uses: actions/setup-node@v5 with: node-version: '22' cache: 'npm' diff --git a/.github/workflows/rename_test.yaml b/.github/workflows/rename_test.yaml index 1c5af4b..9a72b6b 100644 --- a/.github/workflows/rename_test.yaml +++ b/.github/workflows/rename_test.yaml @@ -13,8 +13,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v5 + - uses: actions/setup-node@v5 with: node-version: 22 - run: npm ci From 35bc3d278abffebab8e92feb66dfe2d81e093712 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 12:03:11 +0000 Subject: [PATCH 10/20] docs: align sql-console external dependencies across README and abaplint sql-console depends on custom-controls (z2ui5_cl_cc_spreadsheet) and popups, but the dependency set had drifted: the README omitted custom-controls, abap_cloud.jsonc omitted popups, and rename.json omitted both. All three now list the full set: abap2UI5, popups, custom-controls. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- .github/abaplint/abap_cloud.jsonc | 5 +++++ .github/abaplint/rename.json | 10 ++++++++++ README.md | 1 + 3 files changed, 16 insertions(+) diff --git a/.github/abaplint/abap_cloud.jsonc b/.github/abaplint/abap_cloud.jsonc index 8f73235..f320aa1 100644 --- a/.github/abaplint/abap_cloud.jsonc +++ b/.github/abaplint/abap_cloud.jsonc @@ -13,6 +13,11 @@ "folder": "/abap2UI5", "files": "/src/**/*.*" }, + { + "url": "https://github.com/abap2UI5-addons/popups", + "folder": "/popups", + "files": "/src/**/*.*" + }, { "url": "https://github.com/abap2UI5-addons/custom-controls", "folder": "/customcontrols", diff --git a/.github/abaplint/rename.json b/.github/abaplint/rename.json index 46e6de1..a314faa 100644 --- a/.github/abaplint/rename.json +++ b/.github/abaplint/rename.json @@ -12,6 +12,16 @@ "url": "https://github.com/abap2UI5/abap2UI5", "folder": "/abap2UI5", "files": "/src/**/*.*" + }, + { + "url": "https://github.com/abap2UI5-addons/popups", + "folder": "/popups", + "files": "/src/**/*.*" + }, + { + "url": "https://github.com/abap2UI5-addons/custom-controls", + "folder": "/customcontrols", + "files": "/src/**/*.*" } ], "rename": { diff --git a/README.md b/README.md index c9c6124..d2f3cf0 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ This is a developer tool. It runs the SQL the user enters, without an authorizat #### Dependencies * [abap2UI5](https://github.com/abap2UI5/abap2UI5) * [popups](https://github.com/abap2UI5-addons/popups) +* [custom-controls](https://github.com/abap2UI5-addons/custom-controls) #### Credits * Logic for Query to ABAP SQL Translation used from [ZTOAD](https://github.com/marianfoo/ztoad), integrated by [choper725](https://github.com/choper725) From ed3a4d041a4025ed9adf07e1160ebc712a1caf3e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 14:02:02 +0000 Subject: [PATCH 11/20] =?UTF-8?q?chore:=20hygiene=20batch=20=E2=80=94=20gi?= =?UTF-8?q?tattributes,=20CoC,=20workflows,=20lint=20rules,=20title=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .gitattributes (LF), CODE_OF_CONDUCT.md, LICENSE holder -> abap2UI5 - workflows: concurrency groups + npm cache - abaplint: enable exporting + omit_parameter_name (auto-fixed findings); reindent abaplint.jsonc to 2-space (comments preserved) - fix the 'Number of Rows' preview title: remove the double space, drop the inconsistent parentheses, collapse the 3 duplicated && builds into one |Number of Rows: { lines( ... ) }| template abaplint standard: 0 issues. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- .gitattributes | 11 ++ .github/workflows/ABAP_CLOUD.yaml | 5 + .github/workflows/ABAP_STANDARD.yaml | 5 + .github/workflows/rename_test.yaml | 5 + CODE_OF_CONDUCT.md | 128 ++++++++++++++++++ LICENSE | 2 +- abaplint.jsonc | 102 +++++++------- src/abap/z2ui5_sql_cl_app_01.clas.abap | 16 +-- ...i5_native_sql_console.clas.locals_imp.abap | 10 +- ...association_processor.clas.locals_imp.abap | 6 +- 10 files changed, 222 insertions(+), 68 deletions(-) create mode 100644 .gitattributes create mode 100644 CODE_OF_CONDUCT.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4120e63 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# Normalize line endings to LF for all text files (abapGit + tooling expect LF) +* text=auto eol=lf +*.abap text eol=lf +*.xml text eol=lf +*.json text eol=lf +*.jsonc text eol=lf +*.md text eol=lf +*.mjs text eol=lf +*.js text eol=lf +*.yaml text eol=lf +*.yml text eol=lf diff --git a/.github/workflows/ABAP_CLOUD.yaml b/.github/workflows/ABAP_CLOUD.yaml index 842a3be..3f72411 100644 --- a/.github/workflows/ABAP_CLOUD.yaml +++ b/.github/workflows/ABAP_CLOUD.yaml @@ -8,6 +8,10 @@ on: permissions: contents: read +concurrency: + group: ABAP_CLOUD-${{ github.ref }} + cancel-in-progress: true + jobs: ABAP_CLOUD: runs-on: ubuntu-latest @@ -17,5 +21,6 @@ jobs: - uses: actions/setup-node@v5 with: node-version: 22 + cache: 'npm' - run: npm ci - run: npx abaplint .github/abaplint/abap_cloud.jsonc diff --git a/.github/workflows/ABAP_STANDARD.yaml b/.github/workflows/ABAP_STANDARD.yaml index 4024a39..640df49 100644 --- a/.github/workflows/ABAP_STANDARD.yaml +++ b/.github/workflows/ABAP_STANDARD.yaml @@ -8,6 +8,10 @@ on: permissions: contents: read +concurrency: + group: ABAP_STANDARD-${{ github.ref }} + cancel-in-progress: true + jobs: ABAP_STANDARD: runs-on: ubuntu-latest @@ -17,5 +21,6 @@ jobs: - uses: actions/setup-node@v5 with: node-version: 22 + cache: 'npm' - run: npm ci - run: npx abaplint ./abaplint.jsonc diff --git a/.github/workflows/rename_test.yaml b/.github/workflows/rename_test.yaml index 9a72b6b..b332209 100644 --- a/.github/workflows/rename_test.yaml +++ b/.github/workflows/rename_test.yaml @@ -8,6 +8,10 @@ on: permissions: contents: read +concurrency: + group: rename_test-${{ github.ref }} + cancel-in-progress: true + jobs: rename_test: runs-on: ubuntu-latest @@ -17,5 +21,6 @@ jobs: - uses: actions/setup-node@v5 with: node-version: 22 + cache: 'npm' - run: npm ci - run: npm run rename diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..18c9147 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/LICENSE b/LICENSE index fd08f21..2a60ede 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 oblomov +Copyright (c) 2024 abap2UI5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/abaplint.jsonc b/abaplint.jsonc index d45050d..9483854 100644 --- a/abaplint.jsonc +++ b/abaplint.jsonc @@ -3,56 +3,58 @@ "files": "/src/**/*.*" }, "dependencies": [ - { - "url": "https://github.com/abapedia/steampunk-2305-api-intersect-702", - "folder": "/deps", - "files": "/src/**/*.*" - }, - { - "url": "https://github.com/abap2UI5/abap2UI5", - "folder": "/abap2UI5", - "files": "/src/**/*.*" - }, - { - "url": "https://github.com/abap2UI5-addons/popups", - "folder": "/popups", - "files": "/src/**/*.*" + { + "url": "https://github.com/abapedia/steampunk-2305-api-intersect-702", + "folder": "/deps", + "files": "/src/**/*.*" + }, + { + "url": "https://github.com/abap2UI5/abap2UI5", + "folder": "/abap2UI5", + "files": "/src/**/*.*" + }, + { + "url": "https://github.com/abap2UI5-addons/popups", + "folder": "/popups", + "files": "/src/**/*.*" + }, + { + "url": "https://github.com/abap2UI5-addons/custom-controls", + "folder": "/customcontrols", + "files": "/src/**/*.*" + } + ], + "syntax": { + "version": "v750", + "errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)" }, - { - "url": "https://github.com/abap2UI5-addons/custom-controls", - "folder": "/customcontrols", - "files": "/src/**/*.*" + "rules": { + "downport": true, + "begin_end_names": true, + "check_ddic": true, + "check_include": true, + // the two excluded test class includes contain test doubles for standard + // APIs (cl_sql_statement, if_dd_sobject, if_dd_sobject_util) that are not + // part of the dependency stubs, so syntax resolution fails only there + "check_syntax": { + "exclude": [ + "zcl_2ui5_native_sql_console\\.clas\\.testclasses\\.abap", + "zcl_association_processor\\.clas\\.testclasses\\.abap" + ] + }, + "global_class": true, + "definitions_top": false, + "implement_methods": true, + "method_implemented_twice": true, + "parser_error": true, + "superclass_final": { + "exclude": [ + "zcl_2ui5_native_sql_console\\.clas\\.testclasses\\.abap" + ] + }, + "unknown_types": true, + "xml_consistency": true, + "exporting": true, + "omit_parameter_name": true } -], -"syntax": { - "version": "v750", - "errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)" -}, -"rules": { - "downport": true, - "begin_end_names": true, - "check_ddic": true, - "check_include": true, - // the two excluded test class includes contain test doubles for standard - // APIs (cl_sql_statement, if_dd_sobject, if_dd_sobject_util) that are not - // part of the dependency stubs, so syntax resolution fails only there - "check_syntax": { - "exclude": [ - "zcl_2ui5_native_sql_console\\.clas\\.testclasses\\.abap", - "zcl_association_processor\\.clas\\.testclasses\\.abap" - ] - }, - "global_class": true, - "definitions_top": false, - "implement_methods": true, - "method_implemented_twice": true, - "parser_error": true, - "superclass_final": { - "exclude": [ - "zcl_2ui5_native_sql_console\\.clas\\.testclasses\\.abap" - ] - }, - "unknown_types": true, - "xml_consistency": true -} } diff --git a/src/abap/z2ui5_sql_cl_app_01.clas.abap b/src/abap/z2ui5_sql_cl_app_01.clas.abap index 6d5fda7..0ba5be5 100644 --- a/src/abap/z2ui5_sql_cl_app_01.clas.abap +++ b/src/abap/z2ui5_sql_cl_app_01.clas.abap @@ -230,7 +230,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. CLEAR ms_draft-s_preview-tab. IF ls_entry-result_data IS NOT INITIAL. - lr_preview = z2ui5_sql_cl_context=>xml_srtti_parse( rtti_data = ls_entry-result_data ). + lr_preview = z2ui5_sql_cl_context=>xml_srtti_parse( ls_entry-result_data ). FIELD-SYMBOLS TYPE any. ASSIGN lr_preview->('title') TO . @@ -325,7 +325,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ASSIGN ms_draft-s_preview-tab_backup->* TO . = . preview_filter_search( ). - ms_draft-s_preview-title = `Number of Rows: ` && ` (` && z2ui5_sql_cl_context=>c_trim( lines( ) ) && `)`. + ms_draft-s_preview-title = |Number of Rows: { lines( ) }|. preview_view( ). history_db_save( ). @@ -344,7 +344,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ASSIGN ms_draft-s_preview-tab_backup->* TO . = . - ms_draft-s_preview-title = `Number of Rows: ` && ` ` && z2ui5_sql_cl_context=>c_trim( lines( ) ). + ms_draft-s_preview-title = |Number of Rows: { lines( ) }|. preview_view( ). client->message_toast_display( `All filters deleted` ). @@ -391,7 +391,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. DATA(lo_columns) = tab->ui_columns( ). LOOP AT lt_fields INTO DATA(lv_field). lo_columns->ui_column( width = `auto` sortproperty = `'` && lv_field-name && `'` filterproperty = `'` && lv_field-name && `'` - )->text( text = lv_field-name )->ui_template( )->label( text = `{` && lv_field-name && `}` wrapping = abap_true ). + )->text( lv_field-name )->ui_template( )->label( text = `{` && lv_field-name && `}` wrapping = abap_true ). ENDLOOP. ELSE. @@ -452,7 +452,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. preview_view( ). ms_draft-s_preview-t_filter = z2ui5_sql_cl_context=>filter_get_multi_by_data( ). - ms_draft-s_preview-title = `Number of Rows: ` && ` ` && z2ui5_sql_cl_context=>c_trim( lines( ) ). + ms_draft-s_preview-title = |Number of Rows: { lines( ) }|. history_db_save( ). client->view_model_update( ). @@ -657,21 +657,21 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. DATA(cont_sub) = cont_main->pane_container( orientation = `Horizontal` ). DATA(view_sql) = cont_sub->split_pane( requiredparentwidth = `600` - )->layout_data( ns = `layout` + )->layout_data( `layout` )->splitter_layout_data( size = client->_bind_edit( ms_draft-sql_cont_size ) )->get_parent( )->get_parent( ). sql_view_display( view_sql ). DATA(view_history) = cont_sub->split_pane( requiredparentwidth = `400` - )->layout_data( ns = `layout` + )->layout_data( `layout` )->splitter_layout_data( size = client->_bind_edit( ms_draft-history_cont_size ) )->get_parent( )->get_parent( ). history_view( view_history ). cont_main->split_pane( requiredparentwidth = `400` - )->layout_data( ns = `layout` + )->layout_data( `layout` )->splitter_layout_data( size = client->_bind_edit( ms_draft-s_preview-cont_size ) )->get_parent( )->get_parent( )->vbox( id = `preview` ). diff --git a/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap b/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap index d17b097..6a3d437 100644 --- a/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap +++ b/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap @@ -452,7 +452,7 @@ class main_view implementation. data(shell) = me->a_parser->shell( appwidthlimited = me->a_ui5_client->_bind_edit( i_state->page-app_width_limited ) ). - data(page) = shell->page( title = 'Native SQL Console'(001) ). + data(page) = shell->page( 'Native SQL Console'(001) ). data(header_content) = page->header_content( ). @@ -462,7 +462,7 @@ class main_view implementation. )->input( width = `15%` value = me->a_ui5_client->_bind_edit( i_state->sql_editor_pane-fallback_max_rows ) )->button( text = 'Run'(003) press = me->a_ui5_client->_event( on_run=>event_name( ) ) type = `Emphasized` ##NO_TEXT )->toolbar_spacer( - )->label( text = `Shell` ##NO_TEXT + )->label( `Shell` ##NO_TEXT )->switch( state = me->a_ui5_client->_bind_edit( i_state->page-app_width_limited ) )->link( text = 'Project on GitHub'(004) target = '_blank' href = 'https://github.com/abap2UI5-addons/sql-console' ). @@ -477,7 +477,7 @@ class main_view implementation. "SQL Editor Pane data(editor_split_pane) = horizontal_pane_container->split_pane( requiredparentwidth = `600` ). - data(esp_layout_data) = editor_split_pane->layout_data( ns = `layout` ) ##NO_TEXT. + data(esp_layout_data) = editor_split_pane->layout_data( `layout` ) ##NO_TEXT. esp_layout_data->splitter_layout_data( size = me->a_ui5_client->_bind_edit( i_state->sql_editor_pane-layout_size ) ). @@ -486,7 +486,7 @@ class main_view implementation. "History Pane data(history_split_pane) = horizontal_pane_container->split_pane( requiredparentwidth = `400` ). - data(h_layout_data) = history_split_pane->layout_data( ns = `layout` ) ##NO_TEXT. + data(h_layout_data) = history_split_pane->layout_data( `layout` ) ##NO_TEXT. h_layout_data->splitter_layout_data( size = me->a_ui5_client->_bind_edit( i_state->history_pane-layout_size ) ). @@ -521,7 +521,7 @@ class main_view implementation. "Results Pane data(results_split_pane) = vertical_pane_container->split_pane( requiredparentwidth = `400` ). - data(rsp_layout_data) = results_split_pane->layout_data( ns = `layout` ) ##NO_TEXT. + data(rsp_layout_data) = results_split_pane->layout_data( `layout` ) ##NO_TEXT. rsp_layout_data->splitter_layout_data( size = me->a_ui5_client->_bind_edit( i_state->results_pane-layout_size ) ). diff --git a/src/native/zcl_association_processor.clas.locals_imp.abap b/src/native/zcl_association_processor.clas.locals_imp.abap index 5bb9c35..2a0b940 100644 --- a/src/native/zcl_association_processor.clas.locals_imp.abap +++ b/src/native/zcl_association_processor.clas.locals_imp.abap @@ -53,8 +53,7 @@ CLASS lcl_name_generator IMPLEMENTATION. METHOD lif_name_generator~create_sql_view_name. DATA(random_int) = cl_abap_random_int=>create( - EXPORTING - min = 0 + min = 0 seed = CONV i( sy-uzeit ) ). r_name = |Z{ random_int->get_next( ) }{ sy-uname(3) }|. @@ -416,8 +415,7 @@ CLASS CL_ADT_DP_CDS_ASSOC_OSQL_MAP IMPLEMENTATION. "does this method exist in older releases? r_select_statement = ddl_handler->generate_create_statement( - EXPORTING - iv_ddlname = i_ddl_source-ddlname + iv_ddlname = i_ddl_source-ddlname * iv_prid = -1 is_source = i_ddl_source * iv_state = 'A' From cc0154c1881a875f77cb13ce91a2ed9ac174befe Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 14:15:21 +0000 Subject: [PATCH 12/20] docs: uniform CI badge block; rename the rename check to 'renaming' Give the README the same six-badge block as the other addons (ABAP_STANDARD, ABAP_CLOUD, ABAP_702, auto_cloud, auto_downport, renaming) so badges stay grey where a workflow is not part of this repo and go green/red where it runs. The rename_test workflow is renamed to 'renaming' so its badge reads that. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- .github/workflows/rename_test.yaml | 2 +- README.md | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rename_test.yaml b/.github/workflows/rename_test.yaml index b332209..a47d39e 100644 --- a/.github/workflows/rename_test.yaml +++ b/.github/workflows/rename_test.yaml @@ -1,4 +1,4 @@ -name: rename_test +name: renaming on: push: diff --git a/README.md b/README.md index d2f3cf0..210640b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ [![ABAP_STANDARD](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_STANDARD.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_STANDARD.yaml) [![ABAP_CLOUD](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_CLOUD.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_CLOUD.yaml) +[![ABAP_702](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_702.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/ABAP_702.yaml)
-[![rename_test](https://github.com/abap2UI5-addons/sql-console/actions/workflows/rename_test.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/rename_test.yaml) +[![auto_cloud](https://github.com/abap2UI5-addons/sql-console/actions/workflows/auto_cloud.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/auto_cloud.yaml) +[![auto_downport](https://github.com/abap2UI5-addons/sql-console/actions/workflows/auto_downport.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/auto_downport.yaml) +
+[![renaming](https://github.com/abap2UI5-addons/sql-console/actions/workflows/rename_test.yaml/badge.svg)](https://github.com/abap2UI5-addons/sql-console/actions/workflows/rename_test.yaml) # sql-console SQL Console in Your Browser – No Need for Eclipse or SAP GUI Installation From 9cf6fa408ff4ac3e303a3328d9f0b2d108adc204 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 14:21:48 +0000 Subject: [PATCH 13/20] docs: add AGENTS.md Single agent-instruction file documenting the current state: structure, the vendored utility-copy model, dependencies, security notes, coding style and how to validate (abaplint + CI workflows). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- AGENTS.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..13e95dc --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,74 @@ +# AGENTS.md — AI Assistant Guide for abap2UI5 sql-console + +> This file follows the cross-tool AGENTS.md convention and is the single +> agent instruction file of this repository — Claude Code reads `AGENTS.md` +> natively, there is no separate `CLAUDE.md`. + +## Project Overview + +An SQL console in the browser, built with +[abap2UI5](https://github.com/abap2UI5/abap2UI5) — no Eclipse or SAP GUI needed. + +**Language:** English — all code, comments, commit messages, PRs, issues and +documentation must be in English. + +## Package Structure + +| Package | Content | +|---|---| +| `src/abap/` | The app (`z2ui5_sql_cl_*`), Open-SQL query path | +| `src/native/` | Native-SQL/ADBC path (`zcl_2ui5_native_*`, `zcl_association_processor`), derived from [ZTOAD](https://github.com/marianfoo/ztoad) | +| `src/abap/z2ui5_sql_cl_context` | Vendored utility copy — **see below** | +| `src/abap/z2ui5_sql_cl_db` | Vendored persistence copy (reads/writes the shared `z2ui5_t_91`) | + +## The Utility Copy Principle + +`z2ui5_sql_cl_context` and `z2ui5_sql_cl_db` are **trimmed, renamed copies** of +the abap2UI5 utility classes (`z2ui5_cl_util` / `z2ui5_cl_util_db` in the core), +carrying only the methods this addon uses plus the private helpers those need. +The app calls `z2ui5_sql_cl_context=>…` / `z2ui5_sql_cl_db=>…`, never +`z2ui5_cl_util=>…` directly. This keeps the install dependency-free (abapGit has +no dependency management). The core and the other addons use the same pattern. +When a new utility method is needed, copy it from the core utility class (with +its private helpers) into the context copy rather than adding a dependency. + +## Dependencies + +Installed alongside via abapGit; declared in the abaplint configs: + +* [abap2UI5](https://github.com/abap2UI5/abap2UI5) +* [popups](https://github.com/abap2UI5-addons/popups) +* [custom-controls](https://github.com/abap2UI5-addons/custom-controls) — `z2ui5_cl_cc_spreadsheet` + +## Security + +This is a developer tool. It runs the SQL the user enters, without an +authorization check of its own; the native path uses ADBC and therefore +bypasses ABAP authorizations and client separation. Before using it beyond a +development system, add your own authorization checks and restrict who may run +the app. See the README Todo — authorization checks and full ABAP Cloud +readiness are still open. + +## Coding Style + +Follows the abap2UI5 core conventions (see its +[AGENTS.md](https://github.com/abap2UI5/abap2UI5/blob/main/AGENTS.md)): Clean +ABAP with backtick string literals and string templates (`|…{ }…|`). The +`src/native/` classes are ZTOAD-derived and keep their own style +(`errorNamespace` in `abaplint.jsonc` is loosened for them, with `check_syntax` +excludes for their test doubles). + +## Validation + +Run `npx abaplint` before considering changes complete (config `abaplint.jsonc`, +0 issues expected on the standard config). CI: + +* `ABAP_STANDARD` — lint against Standard ABAP +* `ABAP_CLOUD` — lint against ABAP Cloud; the `src/native/` ADBC/DDIC code is + **not** ABAP-Cloud-ready, so this check has known findings there +* `renaming` (`rename_test.yaml`) — namespace-rename check +* `build_rename` — manual workflow that pushes a namespace-renamed branch + `rename_` for a parallel install + +There is no 702 downport (the native code uses APIs unavailable at 7.02). +All `.abap`/`.xml`/config files are LF-only (`.gitattributes` enforces it). From 281b13bd7ca81740588e32c536f1fc9837748882 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 15:01:30 +0000 Subject: [PATCH 14/20] Remove dead code and tidy config - Remove unused method preview_filter_range - Drop unused parameters fw_table/fw_title from result_display - Remove misleading DEFAULT sy-uname from db_read_by_id (id, not user) - Normalize default query casing to SELECT * FROM t100 - Quote node-version in workflows, extend .gitignore, add engines to package.json Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- .github/workflows/ABAP_CLOUD.yaml | 2 +- .github/workflows/ABAP_STANDARD.yaml | 2 +- .github/workflows/rename_test.yaml | 2 +- .gitignore | 4 ++++ README.md | 2 +- package.json | 3 +++ src/abap/z2ui5_sql_cl_app_01.clas.abap | 24 ++------------------- src/abap/z2ui5_sql_cl_history_api.clas.abap | 2 +- 8 files changed, 14 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ABAP_CLOUD.yaml b/.github/workflows/ABAP_CLOUD.yaml index 3f72411..b5bdebd 100644 --- a/.github/workflows/ABAP_CLOUD.yaml +++ b/.github/workflows/ABAP_CLOUD.yaml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions/setup-node@v5 with: - node-version: 22 + node-version: '22' cache: 'npm' - run: npm ci - run: npx abaplint .github/abaplint/abap_cloud.jsonc diff --git a/.github/workflows/ABAP_STANDARD.yaml b/.github/workflows/ABAP_STANDARD.yaml index 640df49..68dec42 100644 --- a/.github/workflows/ABAP_STANDARD.yaml +++ b/.github/workflows/ABAP_STANDARD.yaml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions/setup-node@v5 with: - node-version: 22 + node-version: '22' cache: 'npm' - run: npm ci - run: npx abaplint ./abaplint.jsonc diff --git a/.github/workflows/rename_test.yaml b/.github/workflows/rename_test.yaml index a47d39e..d063063 100644 --- a/.github/workflows/rename_test.yaml +++ b/.github/workflows/rename_test.yaml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions/setup-node@v5 with: - node-version: 22 + node-version: '22' cache: 'npm' - run: npm ci - run: npm run rename diff --git a/.gitignore b/.gitignore index 3c3629e..970868c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,5 @@ node_modules +output +.github/out/ +.github/abaplint/output/ +.github/abaplint/rename_run.json diff --git a/README.md b/README.md index 210640b..9640686 100644 --- a/README.md +++ b/README.md @@ -41,4 +41,4 @@ This is a developer tool. It runs the SQL the user enters, without an authorizat image #### Contribution & Support -Pull Requests are welcome! Whether you're fixing a bug, adding new functionality, or improving the documentation, your contributions are always appreciated. If you run into problems, feel free to open an issue. +Pull requests are welcome! Whether you're fixing bugs, adding new functionality, or improving documentation, your contributions are highly appreciated. If you encounter any issues, feel free to open an issue. diff --git a/package.json b/package.json index fa74b6d..98b8b58 100644 --- a/package.json +++ b/package.json @@ -17,5 +17,8 @@ "homepage": "https://github.com/abap2UI5-addons/sql-console#readme", "devDependencies": { "@abaplint/cli": "^2.119.14" + }, + "engines": { + "node": ">=22" } } diff --git a/src/abap/z2ui5_sql_cl_app_01.clas.abap b/src/abap/z2ui5_sql_cl_app_01.clas.abap index 0ba5be5..90880c8 100644 --- a/src/abap/z2ui5_sql_cl_app_01.clas.abap +++ b/src/abap/z2ui5_sql_cl_app_01.clas.abap @@ -108,7 +108,6 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. METHODS history_db_read. METHODS preview_filter_search. - METHODS preview_filter_range. METHODS history_on_clear_pressed. METHODS z2ui5_on_callback. METHODS z2ui5_on_event. @@ -132,10 +131,8 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. METHODS result_display IMPORTING - fw_table TYPE string fo_result TYPE REF TO data - ft_fieldlist TYPE z2ui5_sql_cl_query=>ty_t_fieldlist - fw_title TYPE string. + ft_fieldlist TYPE z2ui5_sql_cl_query=>ty_t_fieldlist. PRIVATE SECTION. @@ -284,21 +281,6 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ENDMETHOD. - METHOD preview_filter_range. - - FIELD-SYMBOLS TYPE STANDARD TABLE. - ASSIGN ms_draft-s_preview-tab->* TO . - - LOOP AT ms_draft-s_preview-t_filter INTO DATA(ls_tab). - - DATA(lv_clause) = ls_tab-name && ` not in ls_tab-t_range`. - DELETE WHERE (lv_clause). - - ENDLOOP. - - ENDMETHOD. - - METHOD preview_filter_search. FIELD-SYMBOLS TYPE STANDARD TABLE. @@ -475,10 +457,8 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ms_draft-sql_s_command-name = ls_result-tabname. result_display( - fw_table = ls_result-from fo_result = ls_result-data ft_fieldlist = ls_result-fieldlist - fw_title = ls_result-query ). ENDMETHOD. @@ -615,7 +595,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. METHOD z2ui5_on_init_set_app. - ms_draft-sql_input = `Select * from T100`. + ms_draft-sql_input = `SELECT * FROM t100`. ms_draft-history_cont_size = `30%`. ms_draft-sql_cont_size = `auto`. ms_draft-s_preview-cont_size = `auto`. diff --git a/src/abap/z2ui5_sql_cl_history_api.clas.abap b/src/abap/z2ui5_sql_cl_history_api.clas.abap index b936fbc..f7e52b8 100644 --- a/src/abap/z2ui5_sql_cl_history_api.clas.abap +++ b/src/abap/z2ui5_sql_cl_history_api.clas.abap @@ -32,7 +32,7 @@ CLASS z2ui5_sql_cl_history_api DEFINITION CLASS-METHODS db_read_by_id IMPORTING - val TYPE clike DEFAULT sy-uname + val TYPE clike RETURNING VALUE(result) TYPE ty_s_entry. From d5dc84a69748bef58040aed15bd31a1641e41fbb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 15:41:20 +0000 Subject: [PATCH 15/20] chore: reformat abap_cloud config to 2-space indentation Match the indentation used by the sibling addon configs; no rule or dependency changes. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- .github/abaplint/abap_cloud.jsonc | 48 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/abaplint/abap_cloud.jsonc b/.github/abaplint/abap_cloud.jsonc index f320aa1..b64c0d1 100644 --- a/.github/abaplint/abap_cloud.jsonc +++ b/.github/abaplint/abap_cloud.jsonc @@ -1,8 +1,8 @@ { - "global": { - "files": "/../../src/**/*.*" - }, - "dependencies": [ + "global": { + "files": "/../../src/**/*.*" + }, + "dependencies": [ { "url": "https://github.com/abapedia/steampunk-2305-api-intersect-702", "folder": "/deps", @@ -23,24 +23,24 @@ "folder": "/customcontrols", "files": "/src/**/*.*" } - ], - "syntax": { - "version": "Cloud", - "errorNamespace": "." - }, - "rules": { - "downport": true, - "begin_end_names": true, - "check_ddic": true, - "check_include": true, - "check_syntax": true, - "global_class": true, - "definitions_top": false, - "implement_methods": true, - "method_implemented_twice": true, - "parser_error": true, - "superclass_final": true, - "unknown_types": true, - "xml_consistency": true - } + ], + "syntax": { + "version": "Cloud", + "errorNamespace": "." + }, + "rules": { + "downport": true, + "begin_end_names": true, + "check_ddic": true, + "check_include": true, + "check_syntax": true, + "global_class": true, + "definitions_top": false, + "implement_methods": true, + "method_implemented_twice": true, + "parser_error": true, + "superclass_final": true, + "unknown_types": true, + "xml_consistency": true } +} From b6c053cd478192a937bc3e434d3ed29327050447 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 15:54:04 +0000 Subject: [PATCH 16/20] chore: update @abaplint/cli to 2.119.66 Align with the version now used in the abap2UI5 core repo. abaplint passes with 0 issues. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- package-lock.json | 11 +++++++---- package.json | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e03ebbc..7e1cd73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,13 +9,16 @@ "version": "1.0.0", "license": "MIT", "devDependencies": { - "@abaplint/cli": "^2.119.14" + "@abaplint/cli": "^2.119.66" + }, + "engines": { + "node": ">=22" } }, "node_modules/@abaplint/cli": { - "version": "2.119.14", - "resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.119.14.tgz", - "integrity": "sha512-rLCPYSR+G7kO0ILe6j6//ONle083KqCO+OD/M1FerKTTbmvwxlA+CIa9nWX1ayGMPQ1DQfGeqda4WEt88KUVdQ==", + "version": "2.119.66", + "resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.119.66.tgz", + "integrity": "sha512-Anjsm5G0jUnWwEAZrk2Ckm0we+VCrwjc/MOMSSk+774VJ6ka1ovkj981Y8BJdbxcKgKzIvn+D/ddap/tdxMFbw==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 98b8b58..26a49fc 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ }, "homepage": "https://github.com/abap2UI5-addons/sql-console#readme", "devDependencies": { - "@abaplint/cli": "^2.119.14" + "@abaplint/cli": "^2.119.66" }, "engines": { "node": ">=22" From af648e5fa2f320c13177d15dd55bb36a4a7dc4ce Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 15:56:36 +0000 Subject: [PATCH 17/20] fix: remove unreachable session-load confirm branch ms_control-callback_pop_session_load was declared and read in a WHEN but never assigned, so the "restore previous session" branch could never fire (it would only match an empty id_app). Remove the dead field and branch; z2ui5_on_init_set_app is still reachable from z2ui5_on_event. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- src/abap/z2ui5_sql_cl_app_01.clas.abap | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/abap/z2ui5_sql_cl_app_01.clas.abap b/src/abap/z2ui5_sql_cl_app_01.clas.abap index 90880c8..c0b7032 100644 --- a/src/abap/z2ui5_sql_cl_app_01.clas.abap +++ b/src/abap/z2ui5_sql_cl_app_01.clas.abap @@ -99,7 +99,6 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. DATA: BEGIN OF ms_control, - callback_pop_session_load TYPE string, callback_pop_history_clear TYPE string, END OF ms_control. DATA client TYPE REF TO z2ui5_if_client. @@ -534,15 +533,6 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. CASE io_popup->z2ui5_if_app~id_app. - WHEN ms_control-callback_pop_session_load. - - IF io_popup->result( ). - DATA(lv_id) = z2ui5_sql_cl_history_api=>db_read_draft( ). - client->nav_app_leave( client->get_app( lv_id ) ). - ELSE. - z2ui5_on_init_set_app( ). - ENDIF. - WHEN ms_control-callback_pop_history_clear. CLEAR ms_draft-history_tab. From 5b09c8e7fcaa356364636e7bdb71e3b37d3d7051 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 15:57:24 +0000 Subject: [PATCH 18/20] docs: fill in the empty Code of Conduct enforcement contact The Contributor Covenant [INSERT CONTACT METHOD] placeholder had been deleted, leaving a dangling "...responsible for enforcement at ." sentence. Point reporters at the repository's private Security Advisory report form. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- CODE_OF_CONDUCT.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 18c9147..07432e1 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -59,8 +59,8 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -. +reported to the community leaders responsible for enforcement by opening a +private report via the repository's [Security Advisory form](https://github.com/abap2UI5-addons/sql-console/security/advisories/new). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the From 3fd0a47e64cf2a31decdb1548f7b1614853f8880 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 17:10:47 +0000 Subject: [PATCH 19/20] fix: strip ` AS alias` from unqualified SELECT fields too build_target only stripped a trailing ` AS ` for table-qualified fields (the ~ branch); an unqualified aliased field kept the alias in the name, so e.g. `SELECT carrid AS cc FROM scarr` raised "field CARRID AS CC not found". Apply the strip on both paths. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01MEGSbezJEiFoFubnrqATiM --- src/abap/z2ui5_sql_cl_query.clas.abap | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/abap/z2ui5_sql_cl_query.clas.abap b/src/abap/z2ui5_sql_cl_query.clas.abap index 1acaa89..8574684 100644 --- a/src/abap/z2ui5_sql_cl_query.clas.abap +++ b/src/abap/z2ui5_sql_cl_query.clas.abap @@ -577,10 +577,9 @@ CLASS z2ui5_sql_cl_query IMPLEMENTATION. IF lv_name IS INITIAL. lv_name = lv_prefix. CLEAR lv_prefix. - ELSE. - " strip a trailing ` AS alias` from the field part - SPLIT lv_name AT ` ` INTO lv_name DATA(lv_dummy). ENDIF. + " strip a trailing ` AS alias` from the field part (qualified or not) + SPLIT lv_name AT ` ` INTO lv_name DATA(lv_dummy). IF lv_name = `*`. From 4c1f967859d7b65bee3ba74bb5c62b3e397cf763 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 17:37:34 +0000 Subject: [PATCH 20/20] revert: restore src/ to main, keep CI and docs changes only Take back all ABAP code changes (vendored z2ui5_sql_cl_context / z2ui5_sql_cl_db classes, dead-code removal, signature cleanups) so the PR only carries the low-risk CI, config and documentation updates. Drop the exporting / omit_parameter_name abaplint rules whose code fixes were part of the reverted changes, and remove the vendored-copy sections from AGENTS.md. npx abaplint: 0 issues, 23 files. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01N8Maa3PJ3E2bhrS9B9R1rf --- AGENTS.md | 13 - abaplint.jsonc | 4 +- src/abap/z2ui5_sql_cl_app_01.clas.abap | 78 ++- src/abap/z2ui5_sql_cl_context.clas.abap | 534 ------------------ src/abap/z2ui5_sql_cl_context.clas.xml | 16 - src/abap/z2ui5_sql_cl_db.clas.abap | 177 ------ src/abap/z2ui5_sql_cl_db.clas.xml | 16 - src/abap/z2ui5_sql_cl_history_api.clas.abap | 20 +- src/abap/z2ui5_sql_cl_query.clas.abap | 5 +- ...i5_native_sql_console.clas.locals_imp.abap | 26 +- .../zcl_2ui5_native_sql_console_st.clas.abap | 2 +- ...association_processor.clas.locals_imp.abap | 6 +- 12 files changed, 86 insertions(+), 811 deletions(-) delete mode 100644 src/abap/z2ui5_sql_cl_context.clas.abap delete mode 100644 src/abap/z2ui5_sql_cl_context.clas.xml delete mode 100644 src/abap/z2ui5_sql_cl_db.clas.abap delete mode 100644 src/abap/z2ui5_sql_cl_db.clas.xml diff --git a/AGENTS.md b/AGENTS.md index 13e95dc..ed29feb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,19 +18,6 @@ documentation must be in English. |---|---| | `src/abap/` | The app (`z2ui5_sql_cl_*`), Open-SQL query path | | `src/native/` | Native-SQL/ADBC path (`zcl_2ui5_native_*`, `zcl_association_processor`), derived from [ZTOAD](https://github.com/marianfoo/ztoad) | -| `src/abap/z2ui5_sql_cl_context` | Vendored utility copy — **see below** | -| `src/abap/z2ui5_sql_cl_db` | Vendored persistence copy (reads/writes the shared `z2ui5_t_91`) | - -## The Utility Copy Principle - -`z2ui5_sql_cl_context` and `z2ui5_sql_cl_db` are **trimmed, renamed copies** of -the abap2UI5 utility classes (`z2ui5_cl_util` / `z2ui5_cl_util_db` in the core), -carrying only the methods this addon uses plus the private helpers those need. -The app calls `z2ui5_sql_cl_context=>…` / `z2ui5_sql_cl_db=>…`, never -`z2ui5_cl_util=>…` directly. This keeps the install dependency-free (abapGit has -no dependency management). The core and the other addons use the same pattern. -When a new utility method is needed, copy it from the core utility class (with -its private helpers) into the context copy rather than adding a dependency. ## Dependencies diff --git a/abaplint.jsonc b/abaplint.jsonc index 9483854..e94c56a 100644 --- a/abaplint.jsonc +++ b/abaplint.jsonc @@ -53,8 +53,6 @@ ] }, "unknown_types": true, - "xml_consistency": true, - "exporting": true, - "omit_parameter_name": true + "xml_consistency": true } } diff --git a/src/abap/z2ui5_sql_cl_app_01.clas.abap b/src/abap/z2ui5_sql_cl_app_01.clas.abap index c0b7032..7b60bc2 100644 --- a/src/abap/z2ui5_sql_cl_app_01.clas.abap +++ b/src/abap/z2ui5_sql_cl_app_01.clas.abap @@ -54,7 +54,7 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. cont_size TYPE string, title TYPE string, search_field TYPE string, - t_filter TYPE z2ui5_sql_cl_context=>ty_t_filter_multi, + t_filter TYPE z2ui5_cl_util=>ty_t_filter_multi, rtti_data TYPE string, rtti_data_back TYPE string, END OF ty_s_preview. @@ -63,7 +63,7 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. BEGIN OF ms_draft, s_preview TYPE ty_s_preview, sql_input TYPE string, - sql_s_command TYPE z2ui5_sql_cl_context=>ty_s_filter_multi, + sql_s_command TYPE z2ui5_cl_util=>ty_s_filter_multi, sql_max_rows TYPE i, sql_cont_size TYPE string, history_cont_size TYPE string, @@ -99,6 +99,7 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. DATA: BEGIN OF ms_control, + callback_pop_session_load TYPE string, callback_pop_history_clear TYPE string, END OF ms_control. DATA client TYPE REF TO z2ui5_if_client. @@ -107,6 +108,7 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. METHODS history_db_read. METHODS preview_filter_search. + METHODS preview_filter_range. METHODS history_on_clear_pressed. METHODS z2ui5_on_callback. METHODS z2ui5_on_event. @@ -130,8 +132,10 @@ CLASS z2ui5_sql_cl_app_01 DEFINITION PUBLIC. METHODS result_display IMPORTING + fw_table TYPE string fo_result TYPE REF TO data - ft_fieldlist TYPE z2ui5_sql_cl_query=>ty_t_fieldlist. + ft_fieldlist TYPE z2ui5_sql_cl_query=>ty_t_fieldlist + fw_title TYPE string. PRIVATE SECTION. @@ -181,14 +185,14 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. CLEAR ls_preview-tab. CLEAR ls_preview-tab_backup. - ls_preview-rtti_data = z2ui5_sql_cl_context=>xml_srtti_stringify( ). + ls_preview-rtti_data = z2ui5_cl_util=>xml_srtti_stringify( ). IF IS ASSIGNED. - ls_preview-rtti_data_back = z2ui5_sql_cl_context=>xml_srtti_stringify( ). + ls_preview-rtti_data_back = z2ui5_cl_util=>xml_srtti_stringify( ). ENDIF. - lr_hist->s_db-timestampl = z2ui5_sql_cl_context=>time_get_timestampl( ). + lr_hist->s_db-timestampl = z2ui5_cl_util=>time_get_timestampl( ). IF lr_hist->s_db-uuid IS INITIAL. - lr_hist->s_db-uuid = z2ui5_sql_cl_context=>uuid_get_c32( ). + lr_hist->s_db-uuid = z2ui5_cl_util=>uuid_get_c32( ). ENDIF. z2ui5_sql_cl_history_api=>db_create( VALUE #( sql_command = ms_draft-sql_input @@ -196,7 +200,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. timestampl = lr_hist->s_db-timestampl uuid = lr_hist->s_db-uuid counter = lines( ) - result_data = z2ui5_sql_cl_context=>xml_srtti_stringify( ls_preview ) ) ). + result_data = z2ui5_cl_util=>xml_srtti_stringify( ls_preview ) ) ). lr_hist->s_db-sql_command = ms_draft-sql_input. lr_hist->s_db-tabname = ms_draft-sql_s_command-name. @@ -226,7 +230,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. CLEAR ms_draft-s_preview-tab. IF ls_entry-result_data IS NOT INITIAL. - lr_preview = z2ui5_sql_cl_context=>xml_srtti_parse( ls_entry-result_data ). + lr_preview = z2ui5_cl_util=>xml_srtti_parse( rtti_data = ls_entry-result_data ). FIELD-SYMBOLS TYPE any. ASSIGN lr_preview->('title') TO . @@ -239,12 +243,12 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. DATA lr_data TYPE REF TO data. ASSIGN lr_preview->('rtti_data') TO . - lr_data = z2ui5_sql_cl_context=>xml_srtti_parse( ). - ms_draft-s_preview-tab = z2ui5_sql_cl_context=>conv_copy_ref_data( lr_data ). + lr_data = z2ui5_cl_util=>xml_srtti_parse( ). + ms_draft-s_preview-tab = z2ui5_cl_util=>conv_copy_ref_data( lr_data ). ASSIGN lr_preview->('rtti_data_back') TO . - lr_data = z2ui5_sql_cl_context=>xml_srtti_parse( ). - ms_draft-s_preview-tab_backup = z2ui5_sql_cl_context=>conv_copy_ref_data( lr_data ). + lr_data = z2ui5_cl_util=>xml_srtti_parse( ). + ms_draft-s_preview-tab_backup = z2ui5_cl_util=>conv_copy_ref_data( lr_data ). ENDIF. @@ -280,6 +284,21 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ENDMETHOD. + METHOD preview_filter_range. + + FIELD-SYMBOLS TYPE STANDARD TABLE. + ASSIGN ms_draft-s_preview-tab->* TO . + + LOOP AT ms_draft-s_preview-t_filter INTO DATA(ls_tab). + + DATA(lv_clause) = ls_tab-name && ` not in ls_tab-t_range`. + DELETE WHERE (lv_clause). + + ENDLOOP. + + ENDMETHOD. + + METHOD preview_filter_search. FIELD-SYMBOLS TYPE STANDARD TABLE. @@ -287,7 +306,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. IF ms_draft-s_preview-search_field IS NOT INITIAL. - z2ui5_sql_cl_context=>itab_filter_by_val( + z2ui5_cl_util=>itab_filter_by_val( EXPORTING val = ms_draft-s_preview-search_field CHANGING @@ -306,7 +325,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ASSIGN ms_draft-s_preview-tab_backup->* TO . = . preview_filter_search( ). - ms_draft-s_preview-title = |Number of Rows: { lines( ) }|. + ms_draft-s_preview-title = `Number of Rows: ` && ` (` && z2ui5_cl_util=>c_trim( lines( ) ) && `)`. preview_view( ). history_db_save( ). @@ -325,7 +344,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ASSIGN ms_draft-s_preview-tab_backup->* TO . = . - ms_draft-s_preview-title = |Number of Rows: { lines( ) }|. + ms_draft-s_preview-title = `Number of Rows: ` && ` ` && z2ui5_cl_util=>c_trim( lines( ) ). preview_view( ). client->message_toast_display( `All filters deleted` ). @@ -367,12 +386,12 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. )->get_parent( ). - DATA(lt_fields) = z2ui5_sql_cl_context=>rtti_get_t_attri_by_any( ). + DATA(lt_fields) = z2ui5_cl_util=>rtti_get_t_attri_by_any( ). DATA(lo_columns) = tab->ui_columns( ). LOOP AT lt_fields INTO DATA(lv_field). lo_columns->ui_column( width = `auto` sortproperty = `'` && lv_field-name && `'` filterproperty = `'` && lv_field-name && `'` - )->text( lv_field-name )->ui_template( )->label( text = `{` && lv_field-name && `}` wrapping = abap_true ). + )->text( text = lv_field-name )->ui_template( )->label( text = `{` && lv_field-name && `}` wrapping = abap_true ). ENDLOOP. ELSE. @@ -432,8 +451,8 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. preview_view( ). - ms_draft-s_preview-t_filter = z2ui5_sql_cl_context=>filter_get_multi_by_data( ). - ms_draft-s_preview-title = |Number of Rows: { lines( ) }|. + ms_draft-s_preview-t_filter = z2ui5_cl_util=>filter_get_multi_by_data( ). + ms_draft-s_preview-title = `Number of Rows: ` && ` ` && z2ui5_cl_util=>c_trim( lines( ) ). history_db_save( ). client->view_model_update( ). @@ -456,8 +475,10 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. ms_draft-sql_s_command-name = ls_result-tabname. result_display( + fw_table = ls_result-from fo_result = ls_result-data ft_fieldlist = ls_result-fieldlist + fw_title = ls_result-query ). ENDMETHOD. @@ -533,6 +554,15 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. CASE io_popup->z2ui5_if_app~id_app. + WHEN ms_control-callback_pop_session_load. + + IF io_popup->result( ). + DATA(lv_id) = z2ui5_sql_cl_history_api=>db_read_draft( ). + client->nav_app_leave( client->get_app( lv_id ) ). + ELSE. + z2ui5_on_init_set_app( ). + ENDIF. + WHEN ms_control-callback_pop_history_clear. CLEAR ms_draft-history_tab. @@ -585,7 +615,7 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. METHOD z2ui5_on_init_set_app. - ms_draft-sql_input = `SELECT * FROM t100`. + ms_draft-sql_input = `Select * from T100`. ms_draft-history_cont_size = `30%`. ms_draft-sql_cont_size = `auto`. ms_draft-s_preview-cont_size = `auto`. @@ -627,21 +657,21 @@ CLASS z2ui5_sql_cl_app_01 IMPLEMENTATION. DATA(cont_sub) = cont_main->pane_container( orientation = `Horizontal` ). DATA(view_sql) = cont_sub->split_pane( requiredparentwidth = `600` - )->layout_data( `layout` + )->layout_data( ns = `layout` )->splitter_layout_data( size = client->_bind_edit( ms_draft-sql_cont_size ) )->get_parent( )->get_parent( ). sql_view_display( view_sql ). DATA(view_history) = cont_sub->split_pane( requiredparentwidth = `400` - )->layout_data( `layout` + )->layout_data( ns = `layout` )->splitter_layout_data( size = client->_bind_edit( ms_draft-history_cont_size ) )->get_parent( )->get_parent( ). history_view( view_history ). cont_main->split_pane( requiredparentwidth = `400` - )->layout_data( `layout` + )->layout_data( ns = `layout` )->splitter_layout_data( size = client->_bind_edit( ms_draft-s_preview-cont_size ) )->get_parent( )->get_parent( )->vbox( id = `preview` ). diff --git a/src/abap/z2ui5_sql_cl_context.clas.abap b/src/abap/z2ui5_sql_cl_context.clas.abap deleted file mode 100644 index d0dada9..0000000 --- a/src/abap/z2ui5_sql_cl_context.clas.abap +++ /dev/null @@ -1,534 +0,0 @@ -CLASS z2ui5_sql_cl_context DEFINITION - PUBLIC - CREATE PUBLIC. - - PUBLIC SECTION. - - TYPES: - BEGIN OF ty_s_token, - key TYPE string, - text TYPE string, - visible TYPE abap_bool, - selkz TYPE abap_bool, - editable TYPE abap_bool, - END OF ty_s_token. - TYPES ty_t_token TYPE STANDARD TABLE OF ty_s_token WITH EMPTY KEY. - - TYPES: - BEGIN OF ty_s_range, - sign TYPE c LENGTH 1, - option TYPE c LENGTH 2, - low TYPE string, - high TYPE string, - END OF ty_s_range. - TYPES ty_t_range TYPE STANDARD TABLE OF ty_s_range WITH EMPTY KEY. - - TYPES: - BEGIN OF ty_s_filter_multi, - name TYPE string, - t_range TYPE ty_t_range, - t_token TYPE ty_t_token, - t_token_added TYPE ty_t_token, - t_token_removed TYPE ty_t_token, - END OF ty_s_filter_multi. - TYPES ty_t_filter_multi TYPE STANDARD TABLE OF ty_s_filter_multi WITH EMPTY KEY. - - "! Vendored copy of the abap2UI5 utility methods this app uses, so the - "! app carries its own context instead of depending on z2ui5_cl_util. - CLASS-DATA cv_char_util_horizontal_tab TYPE c LENGTH 1 READ-ONLY. - - CLASS-METHODS class_constructor. - - CLASS-METHODS c_trim - IMPORTING - val TYPE any - RETURNING - VALUE(result) TYPE string. - - CLASS-METHODS conv_copy_ref_data - IMPORTING - !from TYPE any - RETURNING - VALUE(result) TYPE REF TO data. - - CLASS-METHODS conv_get_string_by_xstring - IMPORTING - val TYPE xstring - RETURNING - VALUE(result) TYPE string. - - CLASS-METHODS conv_get_xstring_by_string - IMPORTING - val TYPE string - RETURNING - VALUE(result) TYPE xstring. - - CLASS-METHODS filter_get_multi_by_data - IMPORTING - val TYPE data - RETURNING - VALUE(result) TYPE ty_t_filter_multi. - - CLASS-METHODS itab_filter_by_val - IMPORTING - val TYPE clike - fields TYPE string_table OPTIONAL - ignore_case TYPE abap_bool DEFAULT abap_false - CHANGING - !tab TYPE STANDARD TABLE. - - CLASS-METHODS rtti_get_t_attri_by_any - IMPORTING - val TYPE any - RETURNING - VALUE(result) TYPE cl_abap_structdescr=>component_table. - - CLASS-METHODS time_get_timestampl - RETURNING - VALUE(result) TYPE timestampl. - - CLASS-METHODS uuid_get_c32 - RETURNING - VALUE(result) TYPE string. - - CLASS-METHODS xml_parse - IMPORTING - !xml TYPE clike - EXPORTING - !any TYPE any. - - CLASS-METHODS xml_stringify - IMPORTING - !any TYPE any - RETURNING - VALUE(result) TYPE string - RAISING - cx_xslt_serialization_error. - - CLASS-METHODS xml_srtti_parse - IMPORTING - rtti_data TYPE clike - RETURNING - VALUE(result) TYPE REF TO data. - - CLASS-METHODS xml_srtti_stringify - IMPORTING - !data TYPE any - RETURNING - VALUE(result) TYPE string. - - PROTECTED SECTION. - - CLASS-METHODS rtti_check_ref_data - IMPORTING - val TYPE any - RETURNING - VALUE(result) TYPE abap_bool. - - CLASS-METHODS rtti_check_class_exists - IMPORTING - val TYPE clike - RETURNING - VALUE(result) TYPE abap_bool. - - CLASS-METHODS rtti_get_t_attri_by_include - IMPORTING - !type TYPE REF TO cl_abap_datadescr - RETURNING - VALUE(result) TYPE abap_component_tab. - - PRIVATE SECTION. -ENDCLASS. - - -CLASS z2ui5_sql_cl_context IMPLEMENTATION. - - METHOD class_constructor. - - cv_char_util_horizontal_tab = cl_abap_char_utilities=>horizontal_tab. - - ENDMETHOD. - - METHOD c_trim. - - result = shift_left( shift_right( CONV string( val ) ) ). - result = shift_right( val = result - sub = cv_char_util_horizontal_tab ). - result = shift_left( val = result - sub = cv_char_util_horizontal_tab ). - result = shift_left( shift_right( result ) ). - - ENDMETHOD. - - METHOD conv_copy_ref_data. - - FIELD-SYMBOLS TYPE data. - FIELD-SYMBOLS TYPE data. - - IF rtti_check_ref_data( from ). - ASSIGN from->* TO . - ELSE. - ASSIGN from TO . - ENDIF. - CREATE DATA result LIKE . - ASSIGN result->* TO . - - = . - - ENDMETHOD. - - METHOD conv_get_string_by_xstring. - - DATA conv TYPE REF TO object. - DATA conv_codepage TYPE c LENGTH 21. - DATA conv_in_class TYPE c LENGTH 18. - - TRY. - - conv_codepage = `CL_ABAP_CONV_CODEPAGE`. - CALL METHOD (conv_codepage)=>create_in - RECEIVING - instance = conv. - - CALL METHOD conv->(`IF_ABAP_CONV_IN~CONVERT`) - EXPORTING - source = val - RECEIVING - result = result. - - CATCH cx_root. - - conv_in_class = `CL_ABAP_CONV_IN_CE`. - CALL METHOD (conv_in_class)=>create - EXPORTING - encoding = `UTF-8` - RECEIVING - conv = conv. - - CALL METHOD conv->(`CONVERT`) - EXPORTING - input = val - IMPORTING - data = result. - ENDTRY. - - ENDMETHOD. - - METHOD conv_get_xstring_by_string. - - DATA conv TYPE REF TO object. - DATA conv_codepage TYPE c LENGTH 21. - DATA conv_out_class TYPE c LENGTH 19. - - TRY. - - conv_codepage = `CL_ABAP_CONV_CODEPAGE`. - CALL METHOD (conv_codepage)=>create_out - RECEIVING - instance = conv. - - CALL METHOD conv->(`IF_ABAP_CONV_OUT~CONVERT`) - EXPORTING - source = val - RECEIVING - result = result. - - CATCH cx_root. - - conv_out_class = `CL_ABAP_CONV_OUT_CE`. - CALL METHOD (conv_out_class)=>create - EXPORTING - encoding = `UTF-8` - RECEIVING - conv = conv. - - CALL METHOD conv->(`CONVERT`) - EXPORTING - data = val - IMPORTING - buffer = result. - ENDTRY. - - ENDMETHOD. - - METHOD filter_get_multi_by_data. - - LOOP AT rtti_get_t_attri_by_any( val ) REFERENCE INTO DATA(lr_comp). - INSERT VALUE #( name = lr_comp->name ) INTO TABLE result. - ENDLOOP. - - ENDMETHOD. - - METHOD itab_filter_by_val. - " TRANSPILER NOTE: ABAP CS operator is ALWAYS case-insensitive regardless - " of the ignore_case flag. The flag only pre-converts to uppercase for - " consistency, but CS itself never does case-sensitive matching. - " JS equivalent: always use toLowerCase().includes(toLowerCase()). - FIELD-SYMBOLS TYPE any. - FIELD-SYMBOLS TYPE any. - - DATA(lv_search) = COND string( WHEN ignore_case = abap_true - THEN to_upper( val ) - ELSE val ). - - LOOP AT tab ASSIGNING . - - DATA(lv_check_found) = abap_false. - DATA(lv_index) = 1. - DO. - IF fields IS INITIAL. - ASSIGN COMPONENT lv_index OF STRUCTURE TO . - IF sy-subrc <> 0. - EXIT. - ENDIF. - ELSE. - IF lv_index > lines( fields ). - EXIT. - ENDIF. - DATA(lv_name) = fields[ lv_index ]. - ASSIGN COMPONENT lv_name OF STRUCTURE TO . - IF sy-subrc <> 0. - lv_index = lv_index + 1. - CONTINUE. - ENDIF. - ENDIF. - - DATA(lv_value) = |{ }|. - IF ignore_case = abap_true. - lv_value = to_upper( lv_value ). - IF lv_value CS lv_search. - lv_check_found = abap_true. - EXIT. - ENDIF. - ELSE. - " Case-sensitive: use find() because CS is always case-insensitive - IF find( val = lv_value sub = lv_search ) >= 0. - lv_check_found = abap_true. - EXIT. - ENDIF. - ENDIF. - - lv_index = lv_index + 1. - ENDDO. - - IF lv_check_found = abap_false. - DELETE tab. - ENDIF. - - ENDLOOP. - - ENDMETHOD. - - METHOD rtti_get_t_attri_by_any. - - DATA lo_struct TYPE REF TO cl_abap_structdescr. - DATA lo_type TYPE REF TO cl_abap_typedescr. - - TRY. - lo_type = cl_abap_typedescr=>describe_by_data( val ). - IF lo_type->kind = cl_abap_typedescr=>kind_ref. - lo_type = cl_abap_typedescr=>describe_by_data_ref( val ). - ENDIF. - CATCH cx_root. - TRY. - lo_type = cl_abap_typedescr=>describe_by_data_ref( val ). - CATCH cx_root. - lo_type = cl_abap_structdescr=>describe_by_name( val ). - ENDTRY. - ENDTRY. - - CASE lo_type->kind. - WHEN cl_abap_typedescr=>kind_struct. - lo_struct = CAST #( lo_type ). - WHEN cl_abap_typedescr=>kind_table. - lo_struct = CAST #( CAST cl_abap_tabledescr( lo_type )->get_table_line_type( ) ). - WHEN OTHERS. - lo_struct ?= lo_type. - ENDCASE. - - DATA(comps) = lo_struct->get_components( ). - - LOOP AT comps REFERENCE INTO DATA(lr_comp). - - IF lr_comp->as_include = abap_false. - APPEND lr_comp->* TO result. - ELSE. - DATA(lt_attri) = rtti_get_t_attri_by_include( lr_comp->type ). - APPEND LINES OF lt_attri TO result. - ENDIF. - ENDLOOP. - - ENDMETHOD. - - METHOD time_get_timestampl. - GET TIME STAMP FIELD result. - ENDMETHOD. - - METHOD uuid_get_c32. - DATA lv_uuid TYPE c LENGTH 32. - DATA lv_classname TYPE string. - DATA lv_fm TYPE string. - - TRY. - - TRY. - - lv_classname = `CL_SYSTEM_UUID`. - CALL METHOD (lv_classname)=>if_system_uuid_static~create_uuid_c32 - RECEIVING - uuid = lv_uuid. - - CATCH cx_root. - - lv_fm = `GUID_CREATE`. - CALL FUNCTION lv_fm - IMPORTING - ev_guid_32 = lv_uuid. - - ENDTRY. - - result = lv_uuid. - - CATCH cx_root. - ASSERT 1 = 0. - ENDTRY. - ENDMETHOD. - - METHOD xml_parse. - - IF xml IS INITIAL. - CLEAR any. - RETURN. - ENDIF. - - CALL TRANSFORMATION id - SOURCE XML xml - RESULT data = any. - - ENDMETHOD. - - METHOD xml_stringify. - - CALL TRANSFORMATION id - SOURCE data = any - RESULT XML result - OPTIONS data_refs = `heap-or-create`. - - ENDMETHOD. - - METHOD xml_srtti_parse. - - DATA srtti TYPE REF TO object. - CALL TRANSFORMATION id SOURCE XML rtti_data RESULT srtti = srtti. - - DATA rtti_type TYPE REF TO cl_abap_typedescr. - CALL METHOD srtti->(`GET_RTTI`) - RECEIVING - rtti = rtti_type. - - DATA lo_datadescr TYPE REF TO cl_abap_datadescr. - lo_datadescr ?= rtti_type. - - CREATE DATA result TYPE HANDLE lo_datadescr. - ASSIGN result->* TO FIELD-SYMBOL(). - CALL TRANSFORMATION id SOURCE XML rtti_data RESULT dobj = . - - ENDMETHOD. - - METHOD xml_srtti_stringify. - - IF rtti_check_class_exists( `ZCL_SRTTI_TYPEDESCR` ) = abap_true. - - DATA srtti TYPE REF TO object. - DATA(lv_classname) = `ZCL_SRTTI_TYPEDESCR`. - CALL METHOD (lv_classname)=>(`CREATE_BY_DATA_OBJECT`) - EXPORTING - data_object = data - RECEIVING - srtti = srtti. - CALL TRANSFORMATION id SOURCE srtti = srtti dobj = data RESULT XML result. - - ELSE. - - TRY. - CALL METHOD z2ui5_cl_srt_typedescr=>(`CREATE_BY_DATA_OBJECT`) - EXPORTING - data_object = data - RECEIVING - srtti = srtti. - CALL TRANSFORMATION id SOURCE srtti = srtti dobj = data RESULT XML result. - - CATCH cx_root. - - DATA(lv_text) = `UNSUPPORTED_FEATURE`. - RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = lv_text. - - ENDTRY. - ENDIF. - - ENDMETHOD. - - METHOD rtti_check_ref_data. - - TRY. - DATA(lo_typdescr) = cl_abap_typedescr=>describe_by_data( val ). - DATA(lo_ref) = CAST cl_abap_refdescr( lo_typdescr ) ##NEEDED. - result = abap_true. - CATCH cx_root ##NO_HANDLER. - ENDTRY. - - ENDMETHOD. - - METHOD rtti_check_class_exists. - - TRY. - cl_abap_classdescr=>describe_by_name( EXPORTING p_name = val - EXCEPTIONS type_not_found = 1 ). - IF sy-subrc = 0. - result = abap_true. - ENDIF. - - CATCH cx_root ##NO_HANDLER. - ENDTRY. - - ENDMETHOD. - - METHOD rtti_get_t_attri_by_include. - - TRY. - - cl_abap_typedescr=>describe_by_name( EXPORTING p_name = type->absolute_name - RECEIVING p_descr_ref = DATA(type_desc) - EXCEPTIONS type_not_found = 1 ). - - CATCH cx_root INTO DATA(x). - RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - previous = x. - ENDTRY. - DATA(sdescr) = CAST cl_abap_structdescr( type_desc ). - DATA(comps) = sdescr->get_components( ). - - LOOP AT comps REFERENCE INTO DATA(lr_comp). - - IF lr_comp->as_include = abap_true. - - DATA(incl_comps) = rtti_get_t_attri_by_include( lr_comp->type ). - - LOOP AT incl_comps REFERENCE INTO DATA(lr_incl_comp). - APPEND lr_incl_comp->* TO result. - ENDLOOP. - - ELSE. - - APPEND lr_comp->* TO result. - - ENDIF. - - ENDLOOP. - - ENDMETHOD. - -ENDCLASS. diff --git a/src/abap/z2ui5_sql_cl_context.clas.xml b/src/abap/z2ui5_sql_cl_context.clas.xml deleted file mode 100644 index 6f03b78..0000000 --- a/src/abap/z2ui5_sql_cl_context.clas.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Z2UI5_SQL_CL_CONTEXT - E - SQL Console - vendored utility context - 1 - X - X - X - - - - diff --git a/src/abap/z2ui5_sql_cl_db.clas.abap b/src/abap/z2ui5_sql_cl_db.clas.abap deleted file mode 100644 index a1cb0b3..0000000 --- a/src/abap/z2ui5_sql_cl_db.clas.abap +++ /dev/null @@ -1,177 +0,0 @@ -CLASS z2ui5_sql_cl_db DEFINITION - PUBLIC - FINAL - CREATE PUBLIC. - - PUBLIC SECTION. - - TYPES ty_s_db TYPE z2ui5_t_91. - TYPES ty_t_db TYPE STANDARD TABLE OF ty_s_db WITH EMPTY KEY. - - "! Vendored copy of the abap2UI5 persistence helpers this app uses, so - "! the app carries its own DB access instead of depending on - "! z2ui5_cl_util_db. Reads and writes the shared z2ui5_t_91 table. - CLASS-METHODS delete_by_handle - IMPORTING - uname TYPE clike OPTIONAL - handle TYPE clike OPTIONAL - handle2 TYPE clike OPTIONAL - handle3 TYPE clike OPTIONAL - check_commit TYPE abap_bool DEFAULT abap_true. - - CLASS-METHODS save - IMPORTING - uname TYPE clike OPTIONAL - handle TYPE clike OPTIONAL - handle2 TYPE clike OPTIONAL - handle3 TYPE clike OPTIONAL - data TYPE any - check_commit TYPE abap_bool DEFAULT abap_true - RETURNING - VALUE(result) TYPE string. - - CLASS-METHODS load_by_handle - IMPORTING - uname TYPE clike OPTIONAL - handle TYPE clike OPTIONAL - handle2 TYPE clike OPTIONAL - handle3 TYPE clike OPTIONAL - EXPORTING - VALUE(result) TYPE any. - - " only supplied parameters filter the selection, initial values of - " unsupplied parameters do not restrict the result - CLASS-METHODS load_multi_by_handle - IMPORTING - uname TYPE clike OPTIONAL - handle TYPE clike OPTIONAL - handle2 TYPE clike OPTIONAL - handle3 TYPE clike OPTIONAL - RETURNING - VALUE(result) TYPE ty_t_db. - - PROTECTED SECTION. - PRIVATE SECTION. -ENDCLASS. - - -CLASS z2ui5_sql_cl_db IMPLEMENTATION. - - METHOD delete_by_handle. - - DELETE FROM z2ui5_t_91 - WHERE - uname = @uname - AND handle = @handle - AND handle2 = @handle2 - AND handle3 = @handle3. - - IF check_commit = abap_true. - COMMIT WORK AND WAIT. - ENDIF. - - ENDMETHOD. - - METHOD load_by_handle. - - SELECT SINGLE data - FROM z2ui5_t_91 - WHERE - uname = @uname - AND handle = @handle - AND handle2 = @handle2 - AND handle3 = @handle3 "#EC WARNOK - INTO @DATA(lv_data). - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `NO_ENTRY_FOR_HANDLE_EXISTS`. - ENDIF. - - z2ui5_sql_cl_context=>xml_parse( - EXPORTING - xml = lv_data - IMPORTING - any = result ). - - ENDMETHOD. - - METHOD load_multi_by_handle. - - DATA lr_uname TYPE RANGE OF z2ui5_t_91-uname. - DATA lr_handle TYPE RANGE OF z2ui5_t_91-handle. - DATA lr_handle2 TYPE RANGE OF z2ui5_t_91-handle2. - DATA lr_handle3 TYPE RANGE OF z2ui5_t_91-handle3. - - IF uname IS SUPPLIED. - lr_uname = VALUE #( ( sign = `I` option = `EQ` low = uname ) ). - ENDIF. - IF handle IS SUPPLIED. - lr_handle = VALUE #( ( sign = `I` option = `EQ` low = handle ) ). - ENDIF. - IF handle2 IS SUPPLIED. - lr_handle2 = VALUE #( ( sign = `I` option = `EQ` low = handle2 ) ). - ENDIF. - IF handle3 IS SUPPLIED. - lr_handle3 = VALUE #( ( sign = `I` option = `EQ` low = handle3 ) ). - ENDIF. - - SELECT FROM z2ui5_t_91 - FIELDS * - WHERE uname IN @lr_uname - AND handle IN @lr_handle - AND handle2 IN @lr_handle2 - AND handle3 IN @lr_handle3 "#EC WARNOK - INTO CORRESPONDING FIELDS OF TABLE @result. - - ENDMETHOD. - - METHOD save. - - SELECT SINGLE id - FROM z2ui5_t_91 - WHERE - uname = @uname - AND handle = @handle - AND handle2 = @handle2 "#EC WARNOK - AND handle3 = @handle3 - INTO @DATA(lv_id) ##SUBRC_OK. - - DATA lv_data TYPE string. - TRY. - lv_data = z2ui5_sql_cl_context=>xml_stringify( data ). - CATCH cx_xslt_serialization_error. - RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `DB_SAVE_FAILED`. - ENDTRY. - - DATA(ls_db) = VALUE z2ui5_t_91( - uname = uname - handle = handle - handle2 = handle2 - handle3 = handle3 - data = lv_data ). - - IF lv_id IS NOT INITIAL. - ls_db-id = lv_id. - ELSE. - ls_db-id = z2ui5_sql_cl_context=>uuid_get_c32( ). - ENDIF. - - MODIFY z2ui5_t_91 FROM @ls_db. - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE z2ui5_cx_util_error - EXPORTING - val = `DB_SAVE_FAILED`. - ENDIF. - - IF check_commit = abap_true. - COMMIT WORK AND WAIT. - ENDIF. - - result = ls_db-id. - - ENDMETHOD. - -ENDCLASS. diff --git a/src/abap/z2ui5_sql_cl_db.clas.xml b/src/abap/z2ui5_sql_cl_db.clas.xml deleted file mode 100644 index d1ddeb0..0000000 --- a/src/abap/z2ui5_sql_cl_db.clas.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Z2UI5_SQL_CL_DB - E - SQL Console - vendored persistence - 1 - X - X - X - - - - diff --git a/src/abap/z2ui5_sql_cl_history_api.clas.abap b/src/abap/z2ui5_sql_cl_history_api.clas.abap index f7e52b8..9ce7e18 100644 --- a/src/abap/z2ui5_sql_cl_history_api.clas.abap +++ b/src/abap/z2ui5_sql_cl_history_api.clas.abap @@ -32,7 +32,7 @@ CLASS z2ui5_sql_cl_history_api DEFINITION CLASS-METHODS db_read_by_id IMPORTING - val TYPE clike + val TYPE clike DEFAULT sy-uname RETURNING VALUE(result) TYPE ty_s_entry. @@ -59,7 +59,7 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_create. val-uname = sy-uname. - z2ui5_sql_cl_db=>save( uname = val-uname + z2ui5_cl_util_db=>save( uname = val-uname handle = c_handle_history handle2 = val-uuid data = val ). @@ -70,10 +70,10 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. DATA ls_entry TYPE ty_s_entry. - LOOP AT z2ui5_sql_cl_db=>load_multi_by_handle( uname = val + LOOP AT z2ui5_cl_util_db=>load_multi_by_handle( uname = val handle = c_handle_history ) REFERENCE INTO DATA(lr_db). - z2ui5_sql_cl_context=>xml_parse( EXPORTING xml = lr_db->data + z2ui5_cl_util=>xml_parse( EXPORTING xml = lr_db->data IMPORTING any = ls_entry ). INSERT ls_entry INTO TABLE result. @@ -83,10 +83,10 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_delete. - LOOP AT z2ui5_sql_cl_db=>load_multi_by_handle( uname = user + LOOP AT z2ui5_cl_util_db=>load_multi_by_handle( uname = user handle = c_handle_history ) REFERENCE INTO DATA(lr_db). - z2ui5_sql_cl_db=>delete_by_handle( uname = lr_db->uname + z2ui5_cl_util_db=>delete_by_handle( uname = lr_db->uname handle = lr_db->handle handle2 = lr_db->handle2 check_commit = abap_false ). @@ -98,7 +98,7 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_create_draft. - z2ui5_sql_cl_db=>save( uname = sy-uname + z2ui5_cl_util_db=>save( uname = sy-uname handle = c_handle_draft data = CONV string( val ) ). @@ -107,7 +107,7 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_read_draft. TRY. - z2ui5_sql_cl_db=>load_by_handle( EXPORTING uname = sy-uname + z2ui5_cl_util_db=>load_by_handle( EXPORTING uname = sy-uname handle = c_handle_draft IMPORTING result = result ). CATCH z2ui5_cx_util_error. @@ -118,13 +118,13 @@ CLASS z2ui5_sql_cl_history_api IMPLEMENTATION. METHOD db_read_by_id. - DATA(lt_db) = z2ui5_sql_cl_db=>load_multi_by_handle( handle = c_handle_history + DATA(lt_db) = z2ui5_cl_util_db=>load_multi_by_handle( handle = c_handle_history handle2 = val ). IF lt_db IS INITIAL. RETURN. ENDIF. - z2ui5_sql_cl_context=>xml_parse( EXPORTING xml = lt_db[ 1 ]-data + z2ui5_cl_util=>xml_parse( EXPORTING xml = lt_db[ 1 ]-data IMPORTING any = result ). ENDMETHOD. diff --git a/src/abap/z2ui5_sql_cl_query.clas.abap b/src/abap/z2ui5_sql_cl_query.clas.abap index 8574684..1acaa89 100644 --- a/src/abap/z2ui5_sql_cl_query.clas.abap +++ b/src/abap/z2ui5_sql_cl_query.clas.abap @@ -577,9 +577,10 @@ CLASS z2ui5_sql_cl_query IMPLEMENTATION. IF lv_name IS INITIAL. lv_name = lv_prefix. CLEAR lv_prefix. + ELSE. + " strip a trailing ` AS alias` from the field part + SPLIT lv_name AT ` ` INTO lv_name DATA(lv_dummy). ENDIF. - " strip a trailing ` AS alias` from the field part (qualified or not) - SPLIT lv_name AT ` ` INTO lv_name DATA(lv_dummy). IF lv_name = `*`. diff --git a/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap b/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap index 6a3d437..ca262d7 100644 --- a/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap +++ b/src/native/zcl_2ui5_native_sql_console.clas.locals_imp.abap @@ -366,7 +366,7 @@ class history implementation. into @data(data). r_val = value #( base corresponding #( data ) - data = z2ui5_sql_cl_context=>xml_srtti_parse( z2ui5_sql_cl_context=>conv_get_string_by_xstring( data-serialized_results ) ) ). + data = z2ui5_cl_util=>xml_srtti_parse( z2ui5_cl_util=>conv_get_string_by_xstring( data-serialized_results ) ) ). endmethod. method insert_new. @@ -384,7 +384,7 @@ class history implementation. created_at = utclong_current( ) created_by = cl_abap_syst=>get_user_name( ) rows_no = lines( ) - serialized_results = z2ui5_sql_cl_context=>conv_get_xstring_by_string( z2ui5_sql_cl_context=>xml_srtti_stringify( ) ) ). + serialized_results = z2ui5_cl_util=>conv_get_xstring_by_string( z2ui5_cl_util=>xml_srtti_stringify( ) ) ). insert into z2ui5_nsql_c_hst values @new_entry. @@ -452,7 +452,7 @@ class main_view implementation. data(shell) = me->a_parser->shell( appwidthlimited = me->a_ui5_client->_bind_edit( i_state->page-app_width_limited ) ). - data(page) = shell->page( 'Native SQL Console'(001) ). + data(page) = shell->page( title = 'Native SQL Console'(001) ). data(header_content) = page->header_content( ). @@ -462,7 +462,7 @@ class main_view implementation. )->input( width = `15%` value = me->a_ui5_client->_bind_edit( i_state->sql_editor_pane-fallback_max_rows ) )->button( text = 'Run'(003) press = me->a_ui5_client->_event( on_run=>event_name( ) ) type = `Emphasized` ##NO_TEXT )->toolbar_spacer( - )->label( `Shell` ##NO_TEXT + )->label( text = `Shell` ##NO_TEXT )->switch( state = me->a_ui5_client->_bind_edit( i_state->page-app_width_limited ) )->link( text = 'Project on GitHub'(004) target = '_blank' href = 'https://github.com/abap2UI5-addons/sql-console' ). @@ -477,7 +477,7 @@ class main_view implementation. "SQL Editor Pane data(editor_split_pane) = horizontal_pane_container->split_pane( requiredparentwidth = `600` ). - data(esp_layout_data) = editor_split_pane->layout_data( `layout` ) ##NO_TEXT. + data(esp_layout_data) = editor_split_pane->layout_data( ns = `layout` ) ##NO_TEXT. esp_layout_data->splitter_layout_data( size = me->a_ui5_client->_bind_edit( i_state->sql_editor_pane-layout_size ) ). @@ -486,7 +486,7 @@ class main_view implementation. "History Pane data(history_split_pane) = horizontal_pane_container->split_pane( requiredparentwidth = `400` ). - data(h_layout_data) = history_split_pane->layout_data( `layout` ) ##NO_TEXT. + data(h_layout_data) = history_split_pane->layout_data( ns = `layout` ) ##NO_TEXT. h_layout_data->splitter_layout_data( size = me->a_ui5_client->_bind_edit( i_state->history_pane-layout_size ) ). @@ -521,7 +521,7 @@ class main_view implementation. "Results Pane data(results_split_pane) = vertical_pane_container->split_pane( requiredparentwidth = `400` ). - data(rsp_layout_data) = results_split_pane->layout_data( `layout` ) ##NO_TEXT. + data(rsp_layout_data) = results_split_pane->layout_data( ns = `layout` ) ##NO_TEXT. rsp_layout_data->splitter_layout_data( size = me->a_ui5_client->_bind_edit( i_state->results_pane-layout_size ) ). @@ -556,7 +556,7 @@ class data_result_view implementation. if is assigned. - data(fields) = z2ui5_sql_cl_context=>rtti_get_t_attri_by_any( ). + data(fields) = z2ui5_cl_util=>rtti_get_t_attri_by_any( ). data(table) = me->a_parser->ui_table( id = `previewTab` rows = me->a_ui5_client->_bind( ) @@ -686,8 +686,8 @@ class on_run implementation. ( label = -name property = -name type = `String` ) ) ##NO_TEXT - filters = z2ui5_sql_cl_context=>filter_get_multi_by_data(
) - title = |{ 'Number of Rows:'(010) } { z2ui5_sql_cl_context=>c_trim( lines(
) ) }| ). + filters = z2ui5_cl_util=>filter_get_multi_by_data(
) + title = |{ 'Number of Rows:'(010) } { z2ui5_cl_util=>c_trim( lines(
) ) }| ). new data_result_view( i_state = state i_ui5_client = i_ui5_client )->redraw( ). @@ -777,8 +777,8 @@ class on_load_history_item implementation. ( label = -name property = -name type = `String` ) ) ##NO_TEXT - filters = z2ui5_sql_cl_context=>filter_get_multi_by_data(
) - title = |{ 'Number of Rows:'(010) } { z2ui5_sql_cl_context=>c_trim( lines(
) ) }| ). + filters = z2ui5_cl_util=>filter_get_multi_by_data(
) + title = |{ 'Number of Rows:'(010) } { z2ui5_cl_util=>c_trim( lines(
) ) }| ). new data_result_view( i_state = state i_ui5_client = i_ui5_client )->redraw( ). @@ -884,7 +884,7 @@ class on_wide_filtering implementation. = . - z2ui5_sql_cl_context=>itab_filter_by_val( exporting val = state->results_pane-wide_filter_string + z2ui5_cl_util=>itab_filter_by_val( exporting val = state->results_pane-wide_filter_string changing tab = ). state->results_pane-output_data = state->results_pane-filtered_db_data. diff --git a/src/native/zcl_2ui5_native_sql_console_st.clas.abap b/src/native/zcl_2ui5_native_sql_console_st.clas.abap index 9474289..ce05963 100644 --- a/src/native/zcl_2ui5_native_sql_console_st.clas.abap +++ b/src/native/zcl_2ui5_native_sql_console_st.clas.abap @@ -73,7 +73,7 @@ class zcl_2ui5_native_sql_console_st definition title type string, column_config type zcl_2ui5_native_sql_console_st=>t_columns_config, wide_filter_string type string, - filters type z2ui5_sql_cl_context=>ty_t_filter_multi, + filters type z2ui5_cl_util=>ty_t_filter_multi, end of t_results_pane. class-methods instance diff --git a/src/native/zcl_association_processor.clas.locals_imp.abap b/src/native/zcl_association_processor.clas.locals_imp.abap index 2a0b940..5bb9c35 100644 --- a/src/native/zcl_association_processor.clas.locals_imp.abap +++ b/src/native/zcl_association_processor.clas.locals_imp.abap @@ -53,7 +53,8 @@ CLASS lcl_name_generator IMPLEMENTATION. METHOD lif_name_generator~create_sql_view_name. DATA(random_int) = cl_abap_random_int=>create( - min = 0 + EXPORTING + min = 0 seed = CONV i( sy-uzeit ) ). r_name = |Z{ random_int->get_next( ) }{ sy-uname(3) }|. @@ -415,7 +416,8 @@ CLASS CL_ADT_DP_CDS_ASSOC_OSQL_MAP IMPLEMENTATION. "does this method exist in older releases? r_select_statement = ddl_handler->generate_create_statement( - iv_ddlname = i_ddl_source-ddlname + EXPORTING + iv_ddlname = i_ddl_source-ddlname * iv_prid = -1 is_source = i_ddl_source * iv_state = 'A'