-
Notifications
You must be signed in to change notification settings - Fork 68
File Format for DDLS (CDS Data Definitions) #160
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b6dc958
File Format for DDLS (CDS Data Definitions)
JuReuss dfc0c06
Fix Lint Errors
BeckerWdf 4cd90b3
Fix review comments
BeckerWdf 7022481
Merge branch 'main' into ddls
BeckerWdf 4ab6175
Fix type of "sourceOrigin"
BeckerWdf da1a3d7
Remove empty line at begin of json
BeckerWdf e37f6a2
Merge branch 'main' into ddls
BeckerWdf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/ddls/ddls.json", | ||
"title": "Object Type DDLS", | ||
"description": "DDLS object type", | ||
"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" | ||
], | ||
"default": "standard" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"description", | ||
"originalLanguage" | ||
] | ||
}, | ||
"sourceOrigin": { | ||
"title": "Source Origin", | ||
"description": "Source Origin", | ||
"type": "string", | ||
"enum": [ | ||
"abapDevelopmentTools", | ||
"customCdsViews", | ||
"customAnalyticalQueries", | ||
"customBusinessObject", | ||
"customCodeList", | ||
"customCdsViewsVariantConfg", | ||
"customFields", | ||
"extensionsForDataSources", | ||
"customSearchModeler", | ||
"serviceConsumptionModel" | ||
], | ||
"enumDescriptions": [ | ||
"ABAP Development Tools", | ||
"Custom CDS Views", | ||
"Custom Analytical Queries", | ||
"Custom Business Object", | ||
"Custom Code List", | ||
"Custom CDS Views for Variant Configurations", | ||
"Custom Fields", | ||
"Extensions for Data Sources", | ||
"Custom Search Modeler", | ||
"Service Consumption Model" | ||
] | ||
}, | ||
"sourceType": { | ||
"title": "Source Type", | ||
"description": "Source Type", | ||
"type": "string", | ||
"enum": [ | ||
"view", | ||
"viewEntity", | ||
"viewExtend", | ||
"viewEntityExtend", | ||
"tableFunction", | ||
"tableEntity", | ||
"abstractEntity", | ||
"customEntity", | ||
"hierarchy", | ||
"projectionView" | ||
], | ||
"enumDescriptions": [ | ||
"View", | ||
"View Entity", | ||
"View Extend", | ||
"View Entity Extend", | ||
"Table Function", | ||
"Table Entity", | ||
"Abstract Entity", | ||
"Custom Entity", | ||
"Hierarchy", | ||
"Projection View" | ||
] | ||
}, | ||
"parentName": { | ||
"title": "Parent Name", | ||
"description": "DDLS Name of the parent of an extend", | ||
"type": "string", | ||
"maxLength": 40 | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"$schema", | ||
"header", | ||
"sourceOrigin", | ||
"sourceType" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
define view entity z_aff_example_ddls | ||
as select from spfli | ||
{ | ||
key carrid as Carrid, | ||
key connid as Connid, | ||
countryfr as Countryfr, | ||
countryto as Countryto | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/ddls/ddls.json", | ||
"header": { | ||
"description": "AFF Example DDLS", | ||
"originalLanguage": "EN" | ||
}, | ||
"sourceOrigin": "abapDevelopmentTools", | ||
"sourceType": "viewEntity" | ||
} |
17 changes: 17 additions & 0 deletions
17
file-formats/ddls/examples/z_aff_example_ddls.ddls.objectdependencies.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"BASEINFO": | ||
{ | ||
"FROM": | ||
[ | ||
"SPFLI" | ||
], | ||
"ASSOCIATED": | ||
[], | ||
"BASE": | ||
[], | ||
"ANNO_REF": | ||
[], | ||
"VERSION":0, | ||
"ANNOREF_EVALUATION_ERROR":"" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# File Format for Object Type DDLS | ||
|
||
The files correspond to the CDS Data Definintion source code, enriched with metadata and translation relevant texts. | ||
Files with the ending `.cds` contain plain CDS source code. | ||
The JSON schema is provided [here](./ddls.json). | ||
|
||
Example files for a CDS Data Definition `z_aff_example_ddls` are provided in the following table. | ||
File | Content | ||
--- | --- | ||
[`z_aff_example_ddls.ddls.json`](./examples/z_aff_example_ddls.ddls.json) | Properties and descriptions of the CDS Data Definition | ||
[`z_aff_example_ddls.ddls.cds`](./examples/z_aff_example_ddls.cds) | CDS Source Code | ||
[`z_aff_example_ddls.ddls.objectdependencies.json`](./examples/z_aff_example_ddls.objectdependencies.json) | All direct objects that are used in the CDS Data Definition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
INTERFACE zif_aff_ddls_v1 | ||
PUBLIC. | ||
|
||
"! <p class="shorttext">Source Type</p> | ||
"! Source Type | ||
"! $values {@link zif_aff_ddls_v1.data:co_source_type} | ||
TYPES ty_source_type TYPE c LENGTH 1. | ||
|
||
"! <p class="shorttext">Source Origin</p> | ||
"! Source Origin | ||
"! $values {@link zif_aff_ddls_v1.data:co_source_origin} | ||
TYPES ty_source_origin TYPE c LENGTH 1. | ||
|
||
CONSTANTS: | ||
"! <p class="shorttext">Source Type</p> | ||
"! Source type | ||
BEGIN OF co_source_type, | ||
"! <p class="shorttext">View</p> | ||
"! View | ||
view TYPE ty_source_type VALUE 'V', | ||
"! <p class="shorttext">View Entity</p> | ||
"! View Entity | ||
view_entity TYPE ty_source_type VALUE 'W', | ||
"! <p class="shorttext">View Extend</p> | ||
"! View Extend | ||
view_extend TYPE ty_source_type VALUE 'E', | ||
"! <p class="shorttext">View Entity Extend</p> | ||
"! View Entity Extend | ||
view_entity_extend TYPE ty_source_type VALUE 'X', | ||
"! <p class="shorttext">Table Function</p> | ||
"! Table Function | ||
table_function TYPE ty_source_type VALUE 'F', | ||
"! <p class="shorttext">Table Entity</p> | ||
"! Table Entity | ||
table_entity TYPE ty_source_type VALUE 'T', | ||
"! <p class="shorttext">Abstract Entity</p> | ||
"! Abstract Entity | ||
abstract_entity TYPE ty_source_type VALUE 'A', | ||
"! <p class="shorttext">Custom Entity</p> | ||
"! Custom Entity | ||
custom_entity TYPE ty_source_type VALUE 'Q', | ||
"! <p class="shorttext">Hierarchy</p> | ||
"! Hierarchy | ||
hierarchy TYPE ty_source_type VALUE 'H', | ||
"! <p class="shorttext">Projection View</p> | ||
"! Projection View | ||
projection_view TYPE ty_source_type VALUE 'P', | ||
END OF co_source_type, | ||
|
||
"! <p class="shorttext">Source Origin</p> | ||
"! Source origin | ||
BEGIN OF co_source_origin, | ||
"! <p class="shorttext">ABAP Development Tools</p> | ||
"! ABAP Development Tools | ||
abap_development_tools TYPE ty_source_origin VALUE '0', | ||
"! <p class="shorttext">Custom CDS Views</p> | ||
"! Custom CDS Views | ||
custom_cds_views TYPE ty_source_origin VALUE '1', | ||
"! <p class="shorttext">Custom Analytical Queries</p> | ||
"! Custom Analytical Queries | ||
custom_analytical_queries TYPE ty_source_origin VALUE '2', | ||
"! <p class="shorttext">Custom Business Object</p> | ||
"! Custom Business Object | ||
custom_business_object TYPE ty_source_origin VALUE '3', | ||
"! <p class="shorttext">Custom Code List</p> | ||
"! Custom Code List | ||
custom_code_list TYPE ty_source_origin VALUE '4', | ||
"! <p class="shorttext">Custom CDS Views for Variant Configurations</p> | ||
"! Custom CDS Views for Variant Configurations | ||
custom_cds_views_variant_confg TYPE ty_source_origin VALUE '5', | ||
"! <p class="shorttext">Custom Fields</p> | ||
"! Custom Fields | ||
custom_fields TYPE ty_source_origin VALUE '6', | ||
"! <p class="shorttext">Extensions for Data Sources</p> | ||
"! Extensions for Data Sources | ||
extensions_for_data_sources TYPE ty_source_origin VALUE '7', | ||
"! <p class="shorttext">Custom Search Modeler</p> | ||
"! Custom Search Modeler | ||
custom_search_modeler TYPE ty_source_origin VALUE '8', | ||
"! <p class="shorttext">Service Consumption Model</p> | ||
"! Service Consumption Model | ||
service_consumption_model TYPE ty_source_origin VALUE '9', | ||
END OF co_source_origin. | ||
|
||
TYPES: | ||
"! <p class="shorttext">Object Type DDLS</p> | ||
"! DDLS object type | ||
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">Source Origin</p> | ||
"! Source Origin | ||
"! $required | ||
source_origin TYPE ty_source_origin, | ||
"! <p class="shorttext">Source Type</p> | ||
"! Source Type | ||
"! $required | ||
source_type TYPE ty_source_type, | ||
"! <p class="shorttext">Parent Name</p> | ||
"! DDLS Name of the parent of an extend | ||
parent_name TYPE c LENGTH 40, | ||
END OF ty_main. | ||
|
||
ENDINTERFACE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
Christopher-Hermann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"header": { | ||
"description": "AFF type for DDLS objects", | ||
"originalLanguage": "EN", | ||
"abapLanguageVersion": "standard" | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.