Skip to content

Commit

Permalink
cli api
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed Feb 17, 2021
1 parent f288d92 commit b47ab58
Show file tree
Hide file tree
Showing 11 changed files with 1,320 additions and 483 deletions.
2 changes: 1 addition & 1 deletion abap-api-tools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ node_modules
dist
api
config
test
ci

# editors
.idea
Expand Down
33 changes: 33 additions & 0 deletions abap-api-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Command line tool for pattern based applications with ABAP/HANA systems.
- [ui elements](#ui-elements)
- [Custom ui configurations](#custom-ui-configurations)
- [i18n](#i18n)
- [CLI API](#cli-api)
- [Known Issues](#known-issues)
- [Getting Support](#getting-support)
- [Contributing](#contributing)
Expand Down Expand Up @@ -363,6 +364,38 @@ short:
SCRTEXT_S: Postl Code
```

## CLI API

Your tools and applications can use CLI API `call` and `get` methods, to access ABAP annotations and call templates.

Either the destination id or connection parameters can be provided, together with one single RFM name or array of RFM names.

Check [unit tests](https://github.com/SAP/fundamental-tools/tree/main/abap-api-tools/tests) for data structures.

```ts
import { CliApi, CliResult, RfcConnectionParameters } from "abap-api-tools";
const cp: RfcConnectionParameters = {
user: "demo",
passwd: "welcome",
ashost: "11.12.13.14",
sysnr: "01",
client: "321",
lang: "de",
};
(async () => {
let R:CliResult;
const api = new CliApi();
R = await a.get(cp, ["stfc_connection", "stfc_structure"]); // annotations only
R = await a.call("MME", "stfc_connection"); // annotations and call templates
})();
```

## Known Issues

Click [here](https://github.com/SAP/fundamental-tools/issues) to view the current issues.
Expand Down
Loading

0 comments on commit b47ab58

Please sign in to comment.