-
Notifications
You must be signed in to change notification settings - Fork 61
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
[SITO] File format for situation objects #364
Conversation
Initial pre-review version of SITO AFF
|
"type": "string", | ||
"maxLength": 32 | ||
}, | ||
"abapLanguageVersion": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The abap_lanuage_version is saved in the header-part. No need to save it here
"title": "Object Extensible", | ||
"description": "Extensibility Flag for Situation Objects", | ||
"type": "string", | ||
"enum": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me that for this field "type": "boolean" is sufficient. You should only use an enum if you think that in future some more values will be available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our interface, a boolean representation is CHAR(1) - as usual in ABAP.
How can we avoid that it is transformed to string instead of boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just use abap_bool
as type. This will be transferred to boolean
in the JSON schema.
Here you can see an example:
fix_point_arithmetic TYPE abap_bool, |
We should update the documentation. I have created an issue see #365
"sitnobjisreusable": { | ||
"title": "Object Reusable", | ||
"description": "Reusability Flag", | ||
"type": "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "type": "boolean" is sufficient here
"sitnobjstrucisreusable": { | ||
"title": "Object Reusable", | ||
"description": "Reusability Flag", | ||
"type": "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "type": "boolean" sufficient?
"properties": { | ||
"sitnobjstrucdesc": { | ||
"title": "Situation Object Structure Description", | ||
"description": "Situation Object Structure Description", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write the description in sentence case. This means to write the description as if it was a normal english sentence. Example: "The quick brown fox jumps over the lazy dog"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We extract these texts from our Data Elements Domains. Our UA experts want them to be camel case. Would it be really required to parse and change the texts for the json serialization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, titles shall be title style, descriptions shall be sentence style
However, for names like here, we usually stick to the definition in SAP term. I guess your UAs know whether they are written upper case. ;)
So in your case it might be a description like "The quick brown fox jumps over the Situation Object Structure Description" because "Situation Object Structure Description" is defined in SAP term this way.
We typically struggle, because object types like "class", "tables", and so on are defined as lower case in SAP term.
"sitnobjevtisreusable": { | ||
"title": "Object Reusable", | ||
"description": "Reusability Flag", | ||
"type": "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "type": "boolean" sufficient?
"title": "Object Reusable", | ||
"description": "Reusability Flag", | ||
"type": "string", | ||
"enum": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "type": "boolean" sufficient?
"title": "Object Reusable", | ||
"description": "Reusability Flag", | ||
"type": "string", | ||
"enum": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "type": "boolean" sufficient?
"description": "Reusability Flag", | ||
"type": "string", | ||
"enum": [ | ||
"yes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "type": "boolean" sufficient?
"sitnobjvhsrvcisreusable": { | ||
"title": "Object Reusable", | ||
"description": "Reusability Flag", | ||
"type": "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is "type": "boolean" sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tobiasmuenchsap Thank you for your contribution.
Before I go through details, I would like you to ask to change following in this pull request:
- Would you also upload your interface (starting with Z) and (if possible) an example object. In SAP-internal systems, there is currently still a program you can use for this step to generate the whole folder as described in our how-to. This would also help that we can do the most part of the review in the ABAP interface itself.
- I suggest to go over the field names (see one example in my comments) to get human-readable names. I would use underscores to split the name and also remove the IMHO unnecessary prefixes like
sitnobj
.
"description": "SIT2_OBJ_STR_SK", | ||
"type": "object", | ||
"properties": { | ||
"sitnobjectfieldorder": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one example, how I would rename the fields. In the ABAP interface it would be renamed to field_order
instead of sitnobjectfieldorder
:
"sitnobjectfieldorder": { | |
"fieldOrder": { |
initial commit
initial commit
|
||
"! <p class="shorttext">List of SIT2_OBJ_STRUC_T</p> | ||
"! List of SIT2_OBJ_STRUC_T | ||
ty_sit2_obj_struc_t_list TYPE STANDARD TABLE OF ty_sit2_obj_struc_t WITH EMPTY KEY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Downport EMPTY KEY
Suggest following fix,
ty_sit2_obj_struc_t_list TYPE STANDARD TABLE OF ty_sit2_obj_struc_t WITH EMPTY KEY, | |
ty_sit2_obj_struc_t_list TYPE STANDARD TABLE OF ty_sit2_obj_struc_t WITH DEFAULT KEY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. The example and the ABAP type are helpful.
I have added a bunch of comments (see below).
However, here are some general remarks:
- As mentioned before, I think the fields need to be renamed. It is really hard to understand which information needs to be specified and will be hard for users to understand the content of the JSON.
- It would be helpful at a lot of places to use enum values instead of native values like "01" or "CB" (see https://github.com/SAP/abap-file-formats/blob/main/docs/json.md#enum-values)
- Would you please fix the errors raised by abaplint?
- I guess we can remove the translations since we want to specify
descriptions
only in theoriginalLanguage
. As of now, translations shall be handled in dedicated files (tbd; see Handling translations #106).
@@ -0,0 +1,349 @@ | |||
INTERFACE if_aff_sito_v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INTERFACE if_aff_sito_v1 | |
INTERFACE zif_aff_sito_v1 |
@@ -0,0 +1,349 @@ | |||
INTERFACE if_aff_sito_v1 | |||
PUBLIC . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PUBLIC . | |
PUBLIC. |
"! SIT2_OBJECT | ||
BEGIN OF ty_sit2_object, | ||
"! <p class="shorttext">Situation Object ID</p> | ||
sitnobjectid TYPE sit2_de_object_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the object name? If so, we typically don't add them to the file formats. The object name is specified by the filename.
"! <p class="shorttext">ABAP Language Version</p> | ||
abap_language_version TYPE abap_language_version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the ABAP language version twice. It is already stored in the header...
"! <p class="shorttext">ABAP Language Version</p> | ||
abap_language_version TYPE abap_language_version, | ||
"! <p class="shorttext">Object Extensible</p> | ||
sitnobjisextensible TYPE sit2_de_extensible, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned before, I suggest to rename the fields. E.g. something like extensible
?
sitnobjisextensible TYPE sit2_de_extensible, | |
extensible TYPE sit2_de_extensible, |
Furthermore, it would be great if the types in this interface would be self-contained.
"sitnobjeventcategory": "CL", | ||
"sitnobjevtscope": "01", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enums?
"sitnactiontype": "02", | ||
"sitnobjactscope": "01", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enums?
"sit2ObjActT": [ | ||
{ | ||
"language": "en", | ||
"sitnactionname": "Upgrade Passengers", | ||
"sitnactiondescription": "Upgrade economy passengers to business class" | ||
}, | ||
{ | ||
"language": "de", | ||
"sitnactionname": "Passagiere upgraden", | ||
"sitnactiondescription": "Economy-Passagiere auf Business Class upgraden" | ||
} | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translations?
"sit2ObjCbPar": [ | ||
{ | ||
"sitncallbackparamname": "BOOKID" | ||
}, | ||
{ | ||
"sitncallbackparamname": "CARRID" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you rename the fields you can even think of something like this:
"sit2ObjCbPar": [ | |
{ | |
"sitncallbackparamname": "BOOKID" | |
}, | |
{ | |
"sitncallbackparamname": "CARRID" | |
}, | |
"callbackParameters": [ | |
{ | |
"name": "BOOKID" | |
}, | |
{ | |
"name": "CARRID" | |
}, |
or even if you don't need additional information for the parameters.
"sit2ObjCbPar": [ | |
{ | |
"sitncallbackparamname": "BOOKID" | |
}, | |
{ | |
"sitncallbackparamname": "CARRID" | |
}, | |
"parameters": [ "BOOKID", "CARRID" | |
"sitnobjvhsrvcpathtype": "01", | ||
"sitnobjvhsrvcscope": "01", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum?
As far as I can see this PR is replaced by #380 |
Initial pre-review version of SITO AFF
Please get in contact with us for review appointment