diff --git a/file-formats/aifa/README.md b/file-formats/aifa/README.md new file mode 100644 index 000000000..b3cc9f321 --- /dev/null +++ b/file-formats/aifa/README.md @@ -0,0 +1,13 @@ +# Action File Format + +## Object Type Information + +Object Type | Description | Group +:--- | :--- | :--- +AIFA | Action | Application Interface Framework + +## File Structure + +File | Cardinality | Definition | Schema | Example +:--- | :--- | :--- | :--- | :--- +`.aifa.json` | 1 | [`zif_aff_aifa_v1.intf.abap`](./type/zif_aff_aifa_v1.intf.abap) | [`aifa-v1.json`](./aifa-v1.json) diff --git a/file-formats/aifa/aifa-v1.json b/file-formats/aifa/aifa-v1.json new file mode 100644 index 000000000..2eeb765ce --- /dev/null +++ b/file-formats/aifa/aifa-v1.json @@ -0,0 +1,217 @@ +{ + "$comment": "This file is autogenerated, do not edit manually, see https://github.com/SAP/abap-file-formats for more information.", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/aifa/aifa-v1.json", + "title": "Action", + "description": "Action", + "type": "object", + "properties": { + "formatVersion": { + "title": "ABAP File Format Version", + "description": "The ABAP file format version", + "type": "string", + "const": "1" + }, + "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", + "minLength": 2 + }, + "abapLanguageVersion": { + "title": "ABAP Language Version", + "description": "ABAP language version", + "type": "string", + "enum": [ + "standard", + "cloudDevelopment" + ], + "enumTitles": [ + "Standard", + "ABAP Cloud Development" + ], + "enumDescriptions": [ + "Standard", + "ABAP cloud development" + ], + "default": "standard" + } + }, + "additionalProperties": false, + "required": [ + "description", + "originalLanguage" + ] + }, + "generalInformation": { + "title": "General Information", + "description": "General information", + "type": "object", + "properties": { + "namespace": { + "title": "Namespace", + "description": "Namespace", + "type": "string", + "maxLength": 15 + }, + "aifAction": { + "title": "AIF Action", + "description": "AIF action", + "type": "string", + "maxLength": 20 + }, + "mainComponentType": { + "title": "Main Component Type", + "description": "Main component type", + "type": "string", + "maxLength": 30 + }, + "class": { + "title": "Class", + "description": "Class", + "type": "string", + "maxLength": 30 + } + }, + "additionalProperties": false, + "required": [ + "namespace", + "aifAction" + ] + }, + "fieldsToRestore": { + "title": "Fields To Restore", + "description": "Fields to restore", + "type": "array", + "items": { + "title": "Field To Restore", + "description": "Field to restore", + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "Name", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "checks": { + "title": "Checks", + "description": "Checks", + "type": "array", + "items": { + "title": "Check Details", + "description": "Check details", + "type": "object", + "properties": { + "id": { + "title": "ID", + "description": "ID", + "type": "string", + "maxLength": 3, + "pattern": "^[0-9]+$" + }, + "check": { + "title": "Check", + "description": "Check", + "type": "string", + "maxLength": 30 + }, + "checkBehaviour": { + "title": "Check Behavior", + "description": "Check behavior", + "type": "string", + "enum": [ + "treatAsError", + "ignoreData" + ], + "enumTitles": [ + "Treat As Error", + "Ignore Data" + ], + "enumDescriptions": [ + "Treat as error if check is not successful", + "Ignore data if check is not successful" + ], + "default": "ignoreData" + }, + "fields": { + "title": "Fields", + "description": "Fields", + "type": "array", + "items": { + "title": "Field To Check", + "description": "Field to check", + "type": "object", + "properties": { + "type": { + "title": "Type", + "description": "Type", + "type": "string", + "enum": [ + "sourceStructure", + "destinationStructure", + "constant", + "systemField", + "sendingSystem", + "currentLineNumber", + "hierarchicalMapping" + ], + "enumTitles": [ + "Source Structure", + "Destination Structure", + "Constant", + "System Field", + "Sending System", + "Current Line Number", + "Hierarchical Mapping" + ], + "enumDescriptions": [ + "Field is in source structure", + "Field is in desctination structure", + "Field is constant value", + "Field is system field", + "Field is in sending systemte", + "Field is current line number", + "Fieldpath is starting from a parant node" + ], + "default": "sourceStructure" + }, + "name": { + "title": "Name/Value", + "description": "Name/Value", + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false, + "required": [ + "id", + "check" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "formatVersion", + "header", + "generalInformation" + ] +} diff --git a/file-formats/aifa/examples/z_aff_example_aifa.aifa.json b/file-formats/aifa/examples/z_aff_example_aifa.aifa.json new file mode 100644 index 000000000..329508621 --- /dev/null +++ b/file-formats/aifa/examples/z_aff_example_aifa.aifa.json @@ -0,0 +1,32 @@ +{ + "formatVersion": "1", + "header": { + "description": "Example AIFA for ABAP File Format", + "originalLanguage": "en", + "abapLanguageVersion": "cloudDevelopment" + }, + "generalInformation": { + "namespace": "ZSMA4", + "aifAction": "CREATE_PROUDCT", + "mainComponentType": "ZLC_PRODUCT", + "class": "ZLC_PRODUCT_CLASS" + }, + "fieldsToRestore": [ + { + "name": "INTERNAL_ID" + } + ], + "checks": [ + { + "id": "10", + "check": "CHECK_EMPTY", + "checkBehaviour": "ignoreData", + "fields": [ + { + "type": "sourceStructure", + "name": "BUPA" + } + ] + } + ] +} diff --git a/file-formats/aifa/type/zif_aff_aifa_v1.intf.abap b/file-formats/aifa/type/zif_aff_aifa_v1.intf.abap new file mode 100644 index 000000000..9dc33b646 --- /dev/null +++ b/file-formats/aifa/type/zif_aff_aifa_v1.intf.abap @@ -0,0 +1,134 @@ +INTERFACE zif_aff_aifa_v1 + PUBLIC. + + "! $values { @link zif_aff_aifa_v1.data:co_field_type } + "! $default { @link zif_aff_aifa_v1.data:co_field_type.source_structure } + TYPES ty_field_type TYPE c LENGTH 5. + CONSTANTS: + BEGIN OF co_field_type, + "!

Source Structure

+ "! Field is in source structure + source_structure TYPE c LENGTH 5 VALUE 'SRC_S', + "!

Destination Structure

+ "! Field is in desctination structure + destination_structure TYPE c LENGTH 5 VALUE 'DST_S', + "!

Constant

+ "! Field is constant value + constant TYPE c LENGTH 5 VALUE 'CONST', + "!

System Field

+ "! Field is system field + system_field TYPE c LENGTH 5 VALUE 'SYSTF', + "!

Sending System

+ "! Field is in sending systemte + sending_system TYPE c LENGTH 5 VALUE 'SND_S', + "!

Current Line Number

+ "! Field is current line number + current_line_number TYPE c LENGTH 5 VALUE 'LINEN', + "!

Hierarchical Mapping

+ "! Fieldpath is starting from a parant node + hierarchical_mapping TYPE c LENGTH 5 VALUE 'MAP_H', + END OF co_field_type. + + "! $values { @link zif_aff_aifa_v1.data:co_error_handling_type } + "! $default { @link zif_aff_aifa_v1.data:co_error_handling_type.ignore_data } + TYPES ty_error_handling_type TYPE c LENGTH 1. + CONSTANTS: + BEGIN OF co_error_handling_type, + "!

Treat As Error

+ "! Treat as error if check is not successful + treat_as_error TYPE c LENGTH 1 VALUE '', + "!

Ignore Data

+ "! Ignore data if check is not successful + ignore_data TYPE c LENGTH 1 VALUE 'I', + END OF co_error_handling_type. + + TYPES: + "!

Field To Check

+ "! Field to check + BEGIN OF ty_field_to_check, + "!

Type

+ "! Type + type TYPE ty_field_type, + "!

Name/Value

+ "! Name/Value + name TYPE string, + END OF ty_field_to_check, + "!

Fields To Check

+ "! Fields to check + ty_fields_to_check TYPE STANDARD TABLE OF ty_field_to_check WITH DEFAULT KEY. + + TYPES: + "!

General Information

+ "! General information + BEGIN OF ty_general_information, + "!

Namespace

+ "! Namespace + "! $required + namespace TYPE c LENGTH 15, + "!

AIF Action

+ "! AIF action + "! $required + aif_action TYPE c LENGTH 20, + "!

Main Component Type

+ "! Main component type + main_component_type TYPE zif_aff_types_v1=>ty_object_name_30, + "!

Class

+ "! Class + class TYPE zif_aff_types_v1=>ty_object_name_30, + END OF ty_general_information, + + "!

Check Details

+ "! Check details + BEGIN OF ty_check_details, + "!

ID

+ "! ID + "! $required + id TYPE n LENGTH 3, + "!

Check

+ "! Check + "! $required + check TYPE zif_aff_types_v1=>ty_object_name_30, + "!

Check Behavior

+ "! Check behavior + check_behaviour TYPE ty_error_handling_type, + "!

Fields

+ "! Fields + fields TYPE ty_fields_to_check, + END OF ty_check_details, + "!

Checks

+ "! Checks + ty_checks TYPE STANDARD TABLE OF ty_check_details WITH DEFAULT KEY, + + "!

Field To Restore

+ "! Field to restore + BEGIN OF ty_field_to_restore, + "!

Name

+ "! Name + name TYPE string, + END OF ty_field_to_restore, + "!

Fields To Restore

+ "! Fields to restore + ty_fields_to_restore TYPE STANDARD TABLE OF ty_field_to_restore WITH DEFAULT KEY, + + "!

Action

+ "! Action + BEGIN OF ty_main, + "! $required + format_version TYPE zif_aff_types_v1=>ty_format_version, + "!

Header

+ "! Header + "! $required + header TYPE zif_aff_types_v1=>ty_header_60_cloud, + "!

General Information

+ "! General information + "! $required + general_information TYPE ty_general_information, + "!

Fields To Restore

+ "! Fields to restore + fields_to_restore TYPE ty_fields_to_restore, + "!

Checks

+ "! Checks + checks TYPE ty_checks, + END OF ty_main. + +ENDINTERFACE. diff --git a/file-formats/aifa/type/zif_aff_aifa_v1.intf.json b/file-formats/aifa/type/zif_aff_aifa_v1.intf.json new file mode 100644 index 000000000..5e857eabb --- /dev/null +++ b/file-formats/aifa/type/zif_aff_aifa_v1.intf.json @@ -0,0 +1,7 @@ +{ + "formatVersion": "1", + "header": { + "description": "AFF Type for AIFA (Action)", + "originalLanguage": "en" + } +}