Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: test

on:
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: |
npm install
npm run build
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<div id="horizon" class="table">
<div id="container1" class="container">Dropdown, Revert</div>
<div id="container1" class="container">Todo: Dropdown, Revert</div>

<div id="gutter1" class="gutter"></div>

Expand Down
63 changes: 63 additions & 0 deletions src/abap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// this is a temporary hack, it needs to update whenever the demos repo update

export const zif_excel_demo_output = `INTERFACE zif_excel_demo_output PUBLIC.
CLASS-METHODS run
RETURNING
VALUE(ro_excel) TYPE REF TO zcl_excel
RAISING
zcx_excel.
ENDINTERFACE.`;

export const zcl_excel_demo1 = `CLASS zcl_excel_demo1 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES zif_excel_demo_output.
ENDCLASS.

CLASS zcl_excel_demo1 IMPLEMENTATION.

METHOD zif_excel_demo_output~run.

DATA: lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
lo_column TYPE REF TO zcl_excel_column,
lv_date TYPE d,
lv_time TYPE t.

CREATE OBJECT ro_excel.

" Get active sheet
lo_worksheet = ro_excel->get_active_worksheet( ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ).
lv_date = '20211231'.
lv_time = '055817'.
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = lv_date ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = lv_time ).
lo_hyperlink = zcl_excel_hyperlink=>create_external_link( iv_url = 'https://abap2xlsx.github.io/abap2xlsx' ).
lo_worksheet->set_cell( ip_columnrow = 'B4' ip_value = 'Click here to visit abap2xlsx homepage' ip_hyperlink = lo_hyperlink ).

lo_worksheet->set_cell( ip_column = 'B' ip_row = 6 ip_value = '你好,世界' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 6 ip_value = '(Chinese)' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 7 ip_value = 'नमस्ते दुनिया' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 7 ip_value = '(Hindi)' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Hola Mundo' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 8 ip_value = '(Spanish)' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 9 ip_value = 'مرحبا بالعالم' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 9 ip_value = '(Arabic)' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 10 ip_value = 'ওহে বিশ্ব ' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 10 ip_value = '(Bengali)' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 11 ip_value = 'Bonjour le monde' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 11 ip_value = '(French)' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 12 ip_value = 'Olá Mundo' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 12 ip_value = '(Portuguese)' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 13 ip_value = 'Привет, мир' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 13 ip_value = '(Russian)' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 14 ip_value = 'ہیلو دنیا' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 14 ip_value = '(Urdu)' ).
lo_worksheet->set_cell( ip_column = 'B' ip_row = 15 ip_value = '👋🌎, 👋🌍, 👋🌏' ).
lo_worksheet->set_cell( ip_column = 'C' ip_row = 15 ip_value = '(Emoji waving hand + 3 parts of the world)' ).

lo_column = lo_worksheet->get_column( ip_column = 'B' ).
lo_column->set_width( ip_width = 11 ).
ENDMETHOD.

ENDCLASS.`;
6 changes: 6 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ body, html, .inner, .outer {

select {
width: 100%;
}

iframe {
display: block;
width: 100%;
height: 100%;
}
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import {ABAP, MemoryConsole} from "@abaplint/runtime";
import * as abaplint from "@abaplint/core";
import * as abapMonaco from "@abaplint/monaco";
import Split from "split-grid";
import { zcl_excel_demo1 } from "./abap";

const reg = new abaplint.Registry(new abaplint.Config(JSON.stringify(config)));
abapMonaco.registerABAP(reg);

const filename = "file:///zcl_demo.clas.abap";
const model1 = monaco.editor.createModel(
"WRITE 'hello'.",
zcl_excel_demo1,
"abap",
monaco.Uri.parse(filename),
);
Expand Down