Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Type Editor in SEGW

bojani
Explorer

Can anyone tell my why is everything in my ABAP Type Editor actually uneditable?
I'm trying to create odata service and as you can see in messages below I came across some warnings. I tried to change Type Kind to PACKED, length to 8 and Decimals to 0, but I was unable to do that cuz I cant edit anything in ABAP Type Editor.
If anyone have an answer to how I can change this to be editable or some other way to fix my problem I would be very pleased 🙂

Here is a prtsc of my issue.

12 REPLIES 12

LaurensDeprost
Contributor

Hi Bojan,

Please try changing the mode to 'Explicit Assignment'.

Check out Mappings and ABAP Type Editor on the SAP Help Portal for more info.

Regards,
Laurens

0 Kudos

Thank you for you answer Lauren,

The thing is that I can't change anything in ABAP Type editor. Like I said its uneditable whatever I do. I tried clicking on the highlighted button but it doesn't make it editable. Do you have any other proposal?

0 Kudos

That is strange indeed.
Can you debug the event handler for the button and check the logical that is executed?
You can put a breakpoint in method HANDLE_COMMAND_SB_EDIT of class /IWBEP/CL_SBUI_CONTROLLER.

0 Kudos

I am fairly new to SAP, but I managed to place the brakepoint there and debugger caught it when I clicked on the button but I couldn't see where the problem is. I don't get it, when I click on the highlighted button from the picture in my last comment, everything else gets changed from "display" to "change" mode except that ABAP Type Editor window.

0 Kudos

dep
Is there any other way to resolve these 2 problems I have?


Thanks for the answers in advance.

0 Kudos

Your primary goal should be to understand why the framework is warning you.

From Mappings and ABAP Type Editor:

"Exact correlations between ABAP types and EDM types are not always possible due to their individual facets and the automatic determination of a corresponding ABAP or EDM type might not be a perfect match."

It's up to you as the developer to determine whether or not specific warnings need to be addressed.
In your example, you should be able to ignore the warnings without complications. Alternatively, you can opt to work around them.

For example, the first warning indicates that an ABAP field of type 'Date' is mapped to an Edm.DateTime property.
The ABAP field only stores the date itself and no time information (in contrast to the suggested TIMESTAMPL data type). The framework did the mapping this way is because there is no date-only data type in OData 2.0.
That said, there is a primitive data type for dates, Edm.Date, in OData v4. If your system supports it you could opt to create an OData V4 service in SEGW.

0 Kudos

I understood the mapping problem of it, but as far as I could see for now the solution to that problem is changing things in ABAP type editor (which I can't for some strange reason). I tried just ignoring this warning, but when I try to fetch the data in gateway client it gives me status_code 500.

Thanks anyway for the explanation, it helped. I'll continue looking for the solution. If something comes to mind, feel free to comment again. 🙂

0 Kudos

Without an error message or abnormal behavior in the debugger I don't have any further ideas concerning the type editor. Have you tried manually correcting the data type for the currency amounts (Hsl, Ksl, etc.)?

Try adjusting from precision 24, scale 3 to precision 23, scale 2.

0 Kudos

Great suggestion! That did help remove the warnings for Hsl and Ksl. I will try to look further into debugger, maybe that I am overlooking something. Only data type for dates is left to be resolved.

For the date properties you have different options.

  • Try to use OData V4 as described above and map to Edm.Date instead of Edm.DateTime
    This is recommended if your system supports it.
  • You can simply ignore the warning. There shouldn't be an issue except that for initial/empty dates runtime errors will occur if the dates contain invalid 'initial' values (spaces or blanks) in the backend before the framework tries to map the value. Make sure all empty dates in the backend are filled with the correct initial value for DATE types: '00000000'.
  • You can change the ABAP data type mapped to by changing the data element of the field to a timestamp type as suggested by your warning. Probably you'll need to update the structure you're using for your model.
    This is recommended if none of the options above work out.
  • You might be tempted to change the Edm type to a string of length 8. This is not recommended.

0 Kudos

dep

Hi Laurens, I tried using Odata v4 as you suggested. I managed to register it, its just that now Im not sure how and where do I write my query to get all the data I need from the database so I can consume it afterwards. In Odata v2 I just wrote select statement in GetEntitySet, but here I don't have that option. This is a basic question, I know, I would appreciate an answer to it.

Thanks for your time.

p.s. I followed these steps https://blogs.sap.com/2020/02/13/implementation-of-sap-odata-v4/ but still couldn't achieve my goal.

Hi Bojan,

One of the biggest drawbacks of OData V4 is indeed that it is new (relatively speaking) and the bulk of the online documentation today will be about OData V2 implementations. Definitely something to keep in mind when making a decision.

To get the data for your entity or entity set you can redefine the method /iwbep/if_v4_dp_basic~read_entity or /iwbep/if_v4_dp_basic~read_entity_list respectively. Check out the documentation on interface /IWBEP/IF_V4_DP_BASIC.

Good luck!