-
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
No underscore before digits in AFF field names #385
Comments
yea, I think so but I'm not sure what to_mixed/from_mixed do in this case, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abencase_functions.htm https://github.com/SAP/abap-file-formats/blob/main/docs/json.md#writing-json-schema-with-abap-types |
I tested it with this coding: data abap_name type string.
data json_name type string.
data reconstructed_abap_name type string.
abap_name = 'element1'.
json_name = to_mixed( abap_name ).
reconstructed_abap_name = from_mixed( json_name ).
out->write( |abap_name = { abap_name } => to_mixed( ) = json_name: { json_name } => from_mixed( ) reconstructed abap_name from jsonname: { reconstructed_abap_name }| ).
abap_name = 'element_1'.
json_name = to_mixed( abap_name ).
reconstructed_abap_name = from_mixed( json_name ).
out->write( |abap_name = { abap_name } => to_mixed( ) = json_name: { json_name } => from_mixed( ) reconstructed abap_name from jsonname: { reconstructed_abap_name }| ).
abap_name = 'element_1_'.
json_name = to_mixed( abap_name ).
json_name = to_mixed( abap_name ).
reconstructed_abap_name = from_mixed( json_name ).
out->write( |abap_name = { abap_name } => to_mixed( ) = json_name: { json_name } => from_mixed( ) reconstructed abap_name from jsonname: { reconstructed_abap_name }| ).
abap_name = 'element_1_a'.
json_name = to_mixed( abap_name ).
json_name = to_mixed( abap_name ).
reconstructed_abap_name = from_mixed( json_name ).
out->write( |abap_name = { abap_name } => to_mixed( ) = json_name: { json_name } => from_mixed( ) reconstructed abap_name from jsonname: { reconstructed_abap_name }| ).
The output is this: |
I run into problems when trying to map a json field name back to the corresponding abap field name. This happens when the abap field name has underscores in front of a digit. For example: element_1. In json this will become "element1" and when mapping "element1" back to abap there are 2 possibilities. It could have been "element1" or "element_1" in abap.
So should we forbid underscores in front of digits, so that we can reconstruct the abap field name?
The text was updated successfully, but these errors were encountered: