Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds NROB #144

Merged
merged 18 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from 13 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
20 changes: 20 additions & 0 deletions file-formats/nrob/examples/z_aff_nr.nrob.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/nrob/nrob.json",
"header": {
"description": "Aff example object for type NROB",
"originalLanguage": "EN",
"abapLanguageVersion": "standard"
},
"interval": {
"numberLengthDomain": "NUM10",
"percentWarning": 10.0,
"subType": "",
"untilYear": false,
"rolling": true,
"prefix": false
},
"configuration": {
"buffering": "none",
"bufferedNumbers": "0"
}
}
9 changes: 9 additions & 0 deletions file-formats/nrob/format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# File Format for Object Type NROB

The file representation for object `Z_AFF_NR` is provided [here](./examples/z_aff_nr.nrob.json).

The JSON schema is provided [here](./nrob.json).

File | Content
--- | ---
[`z_aff_nr.nrob.json`](./examples/z_aff_nr.nrob.json) | File representation of a number range object
150 changes: 150 additions & 0 deletions file-formats/nrob/nrob.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/nrob/nrob.json",
"title": "NROB Object Type",
"description": "Object type NROB",
"type": "object",
"properties": {
"$schema": {
"title": "Schema",
"description": "Format version",
"type": "string"
},
"header": {
"title": "Header",
"description": "Header",
"type": "object",
"properties": {
"description": {
"title": "Description",
"description": "Description of the ABAP object",
"type": "string",
"maxLength": 60
},
"originalLanguage": {
"title": "Original Language",
"description": "Original language of the ABAP object",
"type": "string",
"maxLength": 2
},
"abapLanguageVersion": {
"title": "ABAP Language Version",
"description": "ABAP language version",
"type": "string",
"enum": [
"standard",
"keyUser",
"cloudDevelopment"
],
"enumDescriptions": [
"Standard",
"ABAP for key user extensibility",
"ABAP cloud development"
]
}
},
"additionalProperties": false,
"required": [
"description",
"originalLanguage",
"abapLanguageVersion"
]
},
"interval": {
"title": "Interval",
"description": "Interval",
"type": "object",
"properties": {
"numberLengthDomain": {
"title": "Number Length Domain",
"description": "Name of domain, which determines the length of the number range number. Define the amount of characters available for number range intervals. It must be of type NUMC or CHAR and have a field length of at least 1 and at most 20.",
"type": "string",
"maxLength": 30
},
"percentWarning": {
"title": "Percent Warning",
"description": "Percentage of numbers remaining in a number range, upon reaching which in number assignment a warning is given. It must be between 0.1 and 99.9.\n\nExample: You have defined an interval from 1 to 1000. If you want to issue a warning at the number 900, enter 10 (%) here.",
"type": "number",
"minimum": -9999.9,
huber-nicolas marked this conversation as resolved.
Show resolved Hide resolved
"maximum": 9999.9
},
"subType": {
"title": "Sub Type",
"description": "If you want to create subobjects for the elements of a field of the application table, specify the relevant data element for this table field. This data element must be active in the Data Dictionary and must have a check table. The domain of the data element must have a field length of between 1 and 6.",
"type": "string",
"maxLength": 30
},
"untilYear": {
"title": "Until Year",
"description": "If you want the records of the business object to be differentiated by financial year, you set this option true. This structures the intervals of a number range object.",
"type": "boolean"
},
"rolling": {
"title": "Rolling",
"description": "For each interval of a number range object, the system checks when the available characters are used up. In the true setting, once the available characters of an interval are used up, the system starts again from the beginning and the lowest number is assigned again. You can suppress this behavior by setting this option false. If you do this, no more characters from an interval are assigned once the characters of the interval are used up. You can suppress rollover for tshe entire number range object, that is, the setting applies to all the intervals contained in the object.",
"type": "boolean"
},
"prefix": {
"title": "Prefix",
"description": "If it is set to true determined numbers consist of the prefix (name of subobject) and the numbers.",
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"numberLengthDomain",
"percentWarning",
"subType",
"untilYear",
"rolling",
"prefix"
]
},
"configuration": {
"title": "Configuration",
"description": "Configuration-specific fields",
"type": "object",
"properties": {
"transactionId": {
"title": "Transaction ID",
"description": "Transaction code for application specific transaction",
"type": "string",
"maxLength": 20
},
"buffering": {
"title": "Buffering",
"description": "Choose a buffer type for no buffering, for buffering via main memory or for parallel buffering. Default is mainBuffer.",
"type": "string",
"enum": [
"mainBuffer",
huber-nicolas marked this conversation as resolved.
Show resolved Hide resolved
"parallel",
"none"
],
"enumDescriptions": [
"Main memory buffering. \n\n Main memory buffering is the most efficient buffering solution with regards to system performance. Almost all number range objects use main memory buffering. However, it does have two restrictions: Numbers can no longer be assigned in chronological order. The numbering may contain gaps.",
"Parallel buffering, \n\n Parallel buffering works in the same way as main memory buffering, with the difference that the number packages are not stored in the main memory, but are written to the table NRIVSHADOW.",
"No buffering \n\n A number is taken from an interval stored in database NRIV. The table line is locked and this lock remains until the application that requested the number is closed, either with a COMMIT WORK or a ROLLBACK."
]
},
"bufferedNumbers": {
"title": "Buffered Numbers",
"description": "This value specifies the numbers in buffer. In case of parallel and main memory buffering, add a number for \u0027bufferedNumbers\u0027. It determines how many numbers are reserved in buffer for the intervals.Default number of buffers is 10.",
"type": "string",
"maxLength": 8
huber-nicolas marked this conversation as resolved.
Show resolved Hide resolved
}
},
"additionalProperties": false,
"required": [
"buffering",
"bufferedNumbers"
]
}
},
"additionalProperties": false,
"required": [
"$schema",
"header",
"interval",
"configuration"
]
}
117 changes: 117 additions & 0 deletions file-formats/nrob/type/zif_nr_aff_nrob_v1.intf.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
INTERFACE zif_nr_aff_nrob_v1
PUBLIC.

TYPES:
"! <p class="shorttext">Schema</p>
"! Format version
"! $required
BEGIN OF ty_interval,
"! <p class="shorttext">Number Length Domain</p>
"! Name of domain, which determines the length of the number range number.
"! Define the amount of characters available for number range intervals.
"! It must be of type NUMC or CHAR and have a field length of at least 1 and at most 20.
"! $required
number_length_domain TYPE c LENGTH 30,
"! <p class="shorttext">Percent Warning</p>
"! Percentage of numbers remaining in a number range, upon reaching which in number assignment
"! a warning is given. It must be between 0.1 and 99.9.\n\nExample: You have defined an interval
"! from 1 to 1000. If you want to issue a warning at the number 900, enter 10 (%) here.
"! $required
percent_warning TYPE p LENGTH 3 DECIMALS 1,
"! <p class="shorttext">Sub Type</p>
"! If you want to create subobjects for the elements of a field of the application table, specify
"! the relevant data element for this table field. This data element must be active in the Data Dictionary
"! and must have a check table. The domain of the data element must have a field length of between 1 and 6.
"! $required
sub_type TYPE c LENGTH 30,
"! <p class="shorttext">Until Year</p>
"! If you want the records of the business object to be differentiated by financial year, you set this
"! option true. This structures the intervals of a number range object.
"! $required
until_year TYPE abap_bool,
"! <p class="shorttext">Rolling</p>
"! For each interval of a number range object, the system checks when the available characters are used up.
"! In the true setting, once the available characters of an interval are used up, the system starts again
"! from the beginning and the lowest number is assigned again. You can suppress this behavior by setting
"! this option false. If you do this, no more characters from an interval are assigned once the characters
"! of the interval are used up. You can suppress rollover for the entire number range object, that
"! is, the setting applies to all the intervals contained in the object.
"! $required
rolling TYPE abap_bool,
"! <p class="shorttext">Prefix</p>
"! If it is set to true determined numbers consist of the prefix (name of subobject) and the numbers.
"! $required
prefix TYPE abap_bool,
END OF ty_interval.


"! <p class="shorttext">Buffering</p>
"! Choose a buffer type for no buffering, for buffering via main memory or for parallel buffering.
"! $values {@link zif_nr_aff_nrob_v1.data:co_buffering}
TYPES ty_buffering TYPE c LENGTH 1.

CONSTANTS:
"! <p class="shorttext">Buffering</p>
"! Choose a buffer type for no buffering, for buffering via main memory or for parallel buffering.
BEGIN OF co_buffering,
"! <p class="shorttext">Main Buffer</p>
"! Main memory buffering. \n\n Main memory buffering is the most efficient buffering solution with regards
"! to system performance. Almost all number range objects use main memory buffering. However, it does have
"! two restrictions: Numbers can no longer be assigned in chronological order. The numbering may contain gaps.
main_buffer TYPE ty_buffering VALUE 'X',
"! <p class="shorttext">Parallel</p>
"! Parallel buffering, \n\n Parallel buffering works in the same way as main memory buffering, with the
"! difference that the number packages are not stored in the main memory, but are written to the
"! table NRIVSHADOW.
parallel TYPE ty_buffering VALUE 'S',
"! <p class="shorttext">None</p>
"! No buffering \n\n A number is taken from an interval stored in database NRIV. The table line is
"! locked and this lock remains until the application that requested the number is closed, either
"! with a COMMIT WORK or a ROLLBACK.
none TYPE ty_buffering VALUE ' ',
END OF co_buffering.

TYPES:
"! <p class="shorttext">Configuration</p>
"! Configuration-specific fields
"! $required
BEGIN OF ty_configuration,
"! <p class="shorttext">Transaction ID</p>
"! Transaction code for application specific transaction
transaction_id TYPE c LENGTH 20,
"! <p class="shorttext">Buffering</p>
"! Choose a buffer type for no buffering, for buffering via main memory or for parallel buffering.
"! Default is mainBuffer.
"! $required
buffering TYPE ty_buffering,
"! <p class="shorttext">Buffered Numbers</p>
"! This value specifies the numbers in buffer. In case of parallel and main memory buffering, add a
"! number for \u0027bufferedNumbers\u0027. It determines how many numbers are reserved in buffer for
"! the intervals.Default number of buffers is 10.
"! $required
buffered_numbers TYPE n LENGTH 8,
END OF ty_configuration.

TYPES:
"! <p class="shorttext">NROB Object Type</p>
"! Object type NROB
BEGIN OF ty_main,
"! <p class="shorttext">Schema</p>
"! Format version
"! $required
schema TYPE string,
"! <p class="shorttext">Header</p>
"! Header
"! $required
header TYPE zif_aff_types_v1=>ty_header_60,
"! <p class="shorttext">Interval</p>
"! Interval
"! $required
interval TYPE ty_interval,
"! <p class="shorttext">Configuration</p>
"! Configuration-specific fields
"! $required
configuration TYPE ty_configuration,
END OF ty_main.

ENDINTERFACE.
8 changes: 8 additions & 0 deletions file-formats/nrob/type/zif_nr_aff_nrob_v1.intf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/intf/intf.json",
"header": {
"description": "Interface with the NROB AFF Type",
"originalLanguage": "EN",
"abapLanguageVersion": "standard"
}
}