Skip to content

Commit

Permalink
User parameters (SU3) added to call template
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrdjan committed Jan 30, 2021
1 parent 5401904 commit ef64f21
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 52 deletions.
2 changes: 1 addition & 1 deletion abap-api-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ The call template provides a source code for ABAP function module invocation, wi

- Optional parameters are commented and initialized with ABAP default values
- Required parameters are initialized with empty string, buffer or zero number
- Conversion Exit ("ALPHA Exit"), if attached to data element, is mentioned in data element comment
- Conversion Exit ("ALPHA Exit") and User Profile parameter (SU3) are mentioned in parameter or field comment

More than one ABAP function module

Expand Down
4 changes: 2 additions & 2 deletions abap-api-tools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion abap-api-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "abap-api-tools",
"description": "ABAP api tools",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://github.com/sap/fundamental-tools",
"author": "SAP",
"license": "Apache-2.0",
Expand Down
72 changes: 24 additions & 48 deletions abap-api-tools/src/ts/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,7 @@ export class Frontend {
result.init = this.abapConfig[result.abaptype].initial;
if (Field.input) {
if (Field.input.CONVEXIT) result.alpha = Field.input.CONVEXIT;
if (Field.input.MEMORYID) {
result.mid = Field.input.MEMORYID;
}
if (Field.input.MEMORYID) result.mid = Field.input.MEMORYID;
}
} else {
result["init"] = '"native ABAP type"';
Expand Down Expand Up @@ -260,11 +258,9 @@ export class Frontend {
if (!isEmpty(Field)) {
result.abaptype = Field.format.DATATYPE;
result.leng = `${Field.format.LENG}`;
if (Field.input && Field.input.CONVEXIT) {
result.alpha = Field.input.CONVEXIT;
}
if (Field.input && Field.input.MEMORYID) {
result.mid = Field.input.MEMORYID;
if (Field.input) {
if (Field.input.CONVEXIT) result.alpha = Field.input.CONVEXIT;
if (Field.input.MEMORYID) result.mid = Field.input.MEMORYID;
}
} else {
if (!Param.nativeKey) {
Expand Down Expand Up @@ -399,7 +395,7 @@ export class Frontend {
// parameter init
//

const paramText = Param.PARAMTEXT
let paramText = Param.PARAMTEXT
? Param.PARAMTEXT
: `no text (${this.argv.lang})`;
let left = Param.paramName;
Expand All @@ -418,28 +414,17 @@ export class Frontend {
jsWriter.write(sprintf("%-33s // %s", left, paramText));
} else {
const right = this.get_param_initializer(Param, Field);
if (right.alpha) {
jsWriter.write(
sprintf(
`%-${paramNameLen}s: %12s, // %s ALPHA=%s %s`,
left,
right.init,
right.abaptype,
right.alpha,
paramText
)
);
} else {
jsWriter.write(
sprintf(
`%-${paramNameLen}s: %12s, // %s %s`,
left,
right.init,
right.abaptype,
paramText
)
);
}
if (right.mid) paramText = `SU3=${right.mid} ` + paramText;
if (right.alpha) paramText = `ALPHA=${right.alpha} ` + paramText;
jsWriter.write(
sprintf(
`%-${paramNameLen}s: %12s, // %s %s`,
left,
right.init,
right.abaptype,
paramText
)
);
}
}
jsWriter.write("};");
Expand Down Expand Up @@ -643,26 +628,17 @@ export class Frontend {
left = `""`; // line type table
field_text += ` [line type table]`;
}
let line: string;
if (right["alpha"]) {
line = sprintf(
"%-33s: %4s, // %s ALPHA=%s %s",
left,
right["init"],
right["abaptype"],
right["alpha"],
field_text
);
} else {
line = sprintf(
if (right.mid) field_text = `SU3=${right.mid} ` + field_text;
if (right.alpha) field_text = `ALPHA=${right.alpha} ` + field_text;
jsWriter.write(
sprintf(
"%-33s: %4s, // %s %s",
left,
right["init"],
right["abaptype"],
right.init,
right.abaptype,
field_text
);
}
jsWriter.write(line);
)
);
if (htmlWriter) {
const field = this.html_field(Param, Field, field_name);
if (field) {
Expand Down

0 comments on commit ef64f21

Please sign in to comment.