{"id":15148530,"url":"https://github.com/keller-michael/markdown_table_via_abap_cds_and_abap_sql","last_synced_at":"2026-03-06T08:31:48.548Z","repository":{"id":247902371,"uuid":"748973112","full_name":"Keller-Michael/Markdown_table_via_ABAP_CDS_and_ABAP_SQL","owner":"Keller-Michael","description":"⚗️ create a Markdown table via ABAP CDS and ABAP SQL statement SELECT","archived":false,"fork":false,"pushed_at":"2024-07-11T06:52:41.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T05:35:18.003Z","etag":null,"topics":["abap","abap-cds","cds","example","experimental","fun","learning-by-doing","markdown","markdown-table"],"latest_commit_sha":null,"homepage":"","language":"ABAP CDS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Keller-Michael.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-27T07:42:36.000Z","updated_at":"2024-07-12T15:47:54.000Z","dependencies_parsed_at":"2024-07-11T08:22:50.160Z","dependency_job_id":null,"html_url":"https://github.com/Keller-Michael/Markdown_table_via_ABAP_CDS_and_ABAP_SQL","commit_stats":null,"previous_names":["keller-michael/markdown_table_via_abap_cds_and_abap_sql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keller-Michael%2FMarkdown_table_via_ABAP_CDS_and_ABAP_SQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keller-Michael%2FMarkdown_table_via_ABAP_CDS_and_ABAP_SQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keller-Michael%2FMarkdown_table_via_ABAP_CDS_and_ABAP_SQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keller-Michael%2FMarkdown_table_via_ABAP_CDS_and_ABAP_SQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Keller-Michael","download_url":"https://codeload.github.com/Keller-Michael/Markdown_table_via_ABAP_CDS_and_ABAP_SQL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242016735,"owners_count":20058290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abap","abap-cds","cds","example","experimental","fun","learning-by-doing","markdown","markdown-table"],"created_at":"2024-09-26T13:20:19.760Z","updated_at":"2026-03-06T08:31:48.493Z","avatar_url":"https://github.com/Keller-Michael.png","language":"ABAP CDS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚗️ Markdown table via ABAP CDS and ABAP SQL\n\nJust a small, non-serious free time SAP BTP project along the lines of: “Is that actually possible?” The answer is: \"Yes it is!\". You can use ABAP CDS and ABAP SQL statement SELECT to get data from the database directly as a Markdown table. I can't think of a business case for this scenario, but it's nice that it's possible 😂\n\n## Design\n\nThere are 4 different ABAP CDS to create a Markdown table output for entries in database table /DMO/AIRPORT:\n\n1) [ZI_MD_HEADER](/src/zi_md_header.ddls.asddls): Headline with needed columns\n2) [ZI_MD_ALIGNMENT](/src/zi_md_alignment.ddls.asddls): Alignment of columns\n3) [ZI_MD_LINES](/src/zi_md_lines.ddls.asddls): Lines from database table /DMO/AIRPORT\n4) [ZC_MD_TABLE](/src/zc_md_table.ddls.asddls): Combines the other 3 ABAP CDS from 1) to 3) by UNION\n\nAs UNION has no given sort order I solved this problem via ABAP SQL SELECT ... ORDER BY ...:\n```abap\nMETHOD if_oo_adt_classrun~main.\n  SELECT * FROM zc_md_table ORDER BY AirportID INTO TABLE @DATA(markdown_table).\n  out-\u003ewrite( markdown_table ).\nENDMETHOD.\n```\n\n## Output example\n\n### Raw Markdown table \n\n```Markdown\n|         **Airport ID**    |         Name                                     |         City                                 |         Country    |     \n|         :---              |         :---                                     |         :---                                 |         :---       |     \n|         ACA               |         General Juan N. Álvarez Int. Airport     |         Acapulco, Guerrero                   |         MX         |     \n|         ACE               |         Lanzarote Airport                        |         Lanzarote, Canary Islands            |         ES         |     \n|         BKK               |         Suvarnabhumi Airport                     |         Bangkok                              |         TH         |     \n|         BOS               |         Logan International Airport              |         Boston, Massachusetts                |         US         |     \n|         CDG               |         Charles de Gaulle Airport                |         Paris                                |         FR         | \n```\n\n### GitHub interpreted Markdown table\n\n|         **Airport ID**    |         Name                                     |         City                                 |         Country    |     \n|         :---              |         :---                                     |         :---                                 |         :---       |     \n|         ACA               |         General Juan N. Álvarez Int. Airport     |         Acapulco, Guerrero                   |         MX         |     \n|         ACE               |         Lanzarote Airport                        |         Lanzarote, Canary Islands            |         ES         |     \n|         BKK               |         Suvarnabhumi Airport                     |         Bangkok                              |         TH         |     \n|         BOS               |         Logan International Airport              |         Boston, Massachusetts                |         US         |     \n|         CDG               |         Charles de Gaulle Airport                |         Paris                                |         FR         |     \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeller-michael%2Fmarkdown_table_via_abap_cds_and_abap_sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeller-michael%2Fmarkdown_table_via_abap_cds_and_abap_sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeller-michael%2Fmarkdown_table_via_abap_cds_and_abap_sql/lists"}