{"id":15148556,"url":"https://github.com/keller-michael/markdown_from_table_or_structure","last_synced_at":"2025-10-24T03:32:05.658Z","repository":{"id":214792156,"uuid":"618950059","full_name":"Keller-Michael/markdown_from_table_or_structure","owner":"Keller-Michael","description":"🏭 generate Markdown table from internal table or structure in ABAP","archived":false,"fork":false,"pushed_at":"2023-12-30T19:26:54.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-30T22:51:27.451Z","etag":null,"topics":["abap","adt","bapi-return","btp","console","markdown","markdown-table","output","sap-btp","structure","table"],"latest_commit_sha":null,"homepage":"","language":"ABAP","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}},"created_at":"2023-03-25T20:20:51.000Z","updated_at":"2024-12-12T09:02:59.000Z","dependencies_parsed_at":"2023-12-30T20:25:14.905Z","dependency_job_id":"7c9e6859-3071-42c5-af8b-ceaa84d7baf5","html_url":"https://github.com/Keller-Michael/markdown_from_table_or_structure","commit_stats":null,"previous_names":["keller-michael/markdown_from_table_or_structure"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keller-Michael%2Fmarkdown_from_table_or_structure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keller-Michael%2Fmarkdown_from_table_or_structure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keller-Michael%2Fmarkdown_from_table_or_structure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keller-Michael%2Fmarkdown_from_table_or_structure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Keller-Michael","download_url":"https://codeload.github.com/Keller-Michael/markdown_from_table_or_structure/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237910078,"owners_count":19385829,"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","adt","bapi-return","btp","console","markdown","markdown-table","output","sap-btp","structure","table"],"created_at":"2024-09-26T13:20:25.909Z","updated_at":"2025-10-24T03:32:00.379Z","avatar_url":"https://github.com/Keller-Michael.png","language":"ABAP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :factory: Generate Markdown table from internal table or structure\n\n## Description\n\nExecutable classes (F9) and the [ABAP Development Tools console](https://developers.sap.com/tutorials/abap-environment-console-application.html) as an output area for information are particularly useful when using the SAP Business Technology Platform (SAP BTP). With this [example class](./src/zmke_cl_markdown.clas.abap) you are able to generate a [Markdown](https://en.wikipedia.org/wiki/Markdown) table from an internal table or structure in your ABAP code. \n\nThe advantage is that a Markdown table can be easily prepared and processed: You can use online editors such as [Dillinger](https://dillinger.io/) or offline editors such as [Visual Studio Code](https://code.visualstudio.com/) with suitable plugins such as \"Markdown All in One\" and \"Markdown Emoji\". Not to forget: Markdown plays a huge role on GitHub :wink:\n\n## Example\n\nHere are some example calls to generate a Markdown table from a structure (example 1), from internal table (example 2) and from BAPI messages (example 3).\n\n```abap\nMETHOD if_oo_adt_classrun~main.\n  DATA markdown_table TYPE string_table.\n\n  DATA(markdown) = zmke_cl_markdown=\u003eget_instance( ).\n\n  \" example 1\n  SELECT SINGLE * FROM I_currency INTO @DATA(currency).\n  markdown_table = markdown-\u003egenerate_from_structure( currency ).\n  out-\u003ewrite( markdown_table ).\n\n  \" example 2\n  SELECT * FROM I_Currency INTO TABLE @DATA(currencies).\n  markdown_table = markdown-\u003egenerate_from_table( currencies ).\n  out-\u003ewrite( markdown_table ).\n  \n  \" example 3\n  DATA(bapi_messages) = VALUE bapirettab( ( type = 'E' id = 'SY' number = '499' message_v1 = 'Hi' message_v2 = 'there!' )\n                                          ( type = 'A' id = 'SY' number = '499' message_v1 = 'Hi' message_v2 = 'there!' )\n                                          ( type = 'I' id = 'SY' number = '499' message_v1 = 'Hi' message_v2 = 'there!' )\n                                          ( type = 'W' id = 'SY' number = '499' message_v1 = 'Hi' message_v2 = 'there!' )\n                                          ( type = 'S' id = 'SY' number = '499' message_v1 = 'Hi' message_v2 = 'there!' ) ).\n\n    markdown_table = markdown-\u003egenerate_from_bapi_return( bapi_messages ).\n    out-\u003ewrite( markdown_table ).  \nENDMETHOD.\n```\n\nHere's the result for example 1:\n\n| Field | Value |                   \n| :--- | :--- |                     \n| CURRENCY | AED |                  \n| DECIMALS | 2 |                    \n| CURRENCYISOCODE | AED |           \n| ALTERNATIVECURRENCYKEY | 784 |    \n| ISPRIMARYCURRENCYFORISOCRCY |  |  \n  \nHere's the result for example 2 (showing only two entries, there are more):\n  \n| CURRENCY | DECIMALS  | CURRENCYISOCODE  | ALTERNATIVECURRENCYKEY  | ISPRIMARYCURRENCYFORISOCRCY |  \n| :--- | :---  | :---  | :---  | :--- |                                                              \n| AED | 2 | AED | 784 |  |                                                                           \n| AFN | 2 | AFN | 971 |  |                                                                           \n| ALL | 2 | ALL | 008 |  |       \n\nHere's the result for example 3:\n\n| ICON | TYPE | ID  | NUMBER  | MESSAGE  | LOG_NO  | LOG_MSG_NO  | MESSAGE_V1  | MESSAGE_V2  | MESSAGE_V3  | MESSAGE_V4  | PARAMETER  | ROW  | FIELD  | SYSTEM |  \n| :--- | :--- | :---  | :---  | :---  | :---  | :---  | :---  | :---  | :---  | :---  | :---  | :---  | :---  | :--- |                                            \n| :red_circle: | E | SY | 499 |  |  | 000000 | Hi | there! |  |  |  | 0 |  |  |                                                                                   \n| :red_circle: | A | SY | 499 |  |  | 000000 | Hi | there! |  |  |  | 0 |  |  |                                                                                   \n| :yellow_circle: | I | SY | 499 |  |  | 000000 | Hi | there! |  |  |  | 0 |  |  |                                                                                \n| :yellow_circle: | W | SY | 499 |  |  | 000000 | Hi | there! |  |  |  | 0 |  |  |                                                                                \n| :green_circle: | S | SY | 499 |  |  | 000000 | Hi | there! |  |  |  | 0 |  |  |                                                                                 \n\n## Notice\n\nI stumbled across some problems during development involving non-released development objects for SAP BTP, specifically methods of typical classes like CL_ABAP_STRUCTDESCR (really missing GET_DDIC_FIELD_LIST). In an on-premises system, some things such as the column headings of the Markdown table could certainly be designed better ([CamelCase](https://en.wikipedia.org/wiki/Camel_case)).\n\nMore important note is that I didn't implement any suitable error handling. Maybe someone wants to add that to this project? :wink:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeller-michael%2Fmarkdown_from_table_or_structure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeller-michael%2Fmarkdown_from_table_or_structure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeller-michael%2Fmarkdown_from_table_or_structure/lists"}