$npx -y skills add jfilak/sapcli-claude-plugin --skill abap-snippetRun ABAP code snippet to very syntax, execute Function Modules or perform complicate queries.
| 1 | ## What I do |
| 2 | |
| 3 | I create a temporary ABAP class implementing the interface `IF_OO_ADT_CLASSRUN` |
| 4 | and put your ABAP code snippet into implementation of the method `IF_OO_ADT_CLASSRUN~MAIN`. |
| 5 | |
| 6 | I run syntax check for the temporary class and if there are no syntax errors, I execute |
| 7 | the method `IF_OO_ADT_CLASSRUN~MAIN` and print the output of the execution into |
| 8 | the standard output. |
| 9 | |
| 10 | |
| 11 | ## Basic usage: one-liner |
| 12 | |
| 13 | ```bash |
| 14 | echo "out->write( |Hello, { sy-uname }!| )." | sapcli abap run - |
| 15 | ``` |
| 16 | |
| 17 | ## Multiple lines of ABAP code |
| 18 | |
| 19 | ```bash |
| 20 | sapcli abap run - <<EOF |
| 21 | out->write( |Hello, { sy-uname }!| ). |
| 22 | out->write( |Current date is { sy-datum }| ). |
| 23 | EOF |
| 24 | ``` |
| 25 | |
| 26 | ## Running ABAP code snippet from file |
| 27 | |
| 28 | First create a file `snippet.abap` with the following content: |
| 29 | |
| 30 | ```abap |
| 31 | out->write( |Hello, { sy-uname }!| ). |
| 32 | out->write( |Current date is { sy-datum }| ). |
| 33 | ``` |
| 34 | |
| 35 | Then run the code snippet from the file: |
| 36 | |
| 37 | ```bash |
| 38 | sapcli abap run snippet.abap |
| 39 | ``` |