on 04-11-2013 10:31 AM
Hi folks,
I am using the service builder to define my gateway ODATA services ...
I have some data model fields which are booleans and are defined as type 'Edm.Boolean' ...
I am unable to map those fields to RFC ABAP fields with domain 'BOOLEAN' (char 1) ... I am always getting the error:
Data source attribute ACTIVE and model property IsActive have different types
Message no. /IWBEP/SBDSP_DM031
I looked at the help documentation and did some searches here but I could not find any specific information on the requirements for this EDM type ...
Thanks,
Steven
Thanks folks for all the suggestions & replies ...
SP06 seems to have solved this issue apparently 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By the way, I was looking at this document on MSDN, according to which EDM.Boolean can have true/false by default. Which means that C1 is not a ideal mapping for Boolean. EDM.Byte was mentioned as alternative to EDM.Boolean in one of the threads.
http://msdn.microsoft.com/en-us/library/vstudio/ee382832(v=vs.100).aspx
As you said this has been fixed in SP06, this i no longer valid.
Hello,
just now I ran into the same problem for a prototype implementation. Since I couldn't get around the error, I switched the type in the Entity Type back to Edm.String:
However, if I call my service/$metadata, it suprisingly yields an Edm.Boolean
<Property Name="Selected" Type="Edm.Boolean" Nullable="false" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
Have a nice evening,
Björn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Björn,
For SP6, note 1803227 should solve the issue you are facing with the
errors for mapping an Edm.Boolean:
https://service.sap.com/sap/support/notes/1803227
Best regards,
Sagi
Hi Folks,
Did some further debugging and to me this seems to be a BUG in the standard SAP code which determines the EDM type for the linked attribute data.
Method 'get_ds_attr_edm_type' of class '/IWBEP/CL_SBDSP_UTILITY' creates an internal data type with the internal length ( = 2 ) for a type C length 1 in a unicode system ...
when 'c' or 'n' or 'x'. | |
create data lo_ds_dref type lv_ds_data_type) length lv_ds_int_length. |
Then in method 'get_edm_type_from_ddic_type' of class '/iwbep/cl_mgw_med_edm_util' the length needs to be 'one' in order to potentially qualify as a 'boolean' ... but it is always '2' for a type C length 1 ... hence the mismatch ...
when cl_abap_typedescr=>typekind_char.
rs_edm_type-core_type = /iwbep/if_mgw_med_odata_types=>gcs_edm_data_types-string. "'Edm.String'.
if ls_dfies is initial. "Not a DDIC type, that is it is ABAP Core type
rs_edm_type-length = rs_edm_type-length. "number of characters
rs_edm_type-internal_length = rs_edm_type-length * cl_abap_char_utilities=>charsize. "length in bytes / Unicode needs double
elseif rs_edm_type-length eq 1."boolean detection (guessing)
if ls_dfies-domname cs 'BOOL'.
rs_edm_type-core_type = /iwbep/if_mgw_med_odata_types=>gcs_edm_data_types-boolean. "'Edm.Boolean'.
endif.
endif.
Hopefully somebody from the SAP gateway team is watching this Will see whether we can create an OSS customer request as well ...
Regards,
Steven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This is usually because the data type in the implementation is different that the data type in the model. Could you check out that?
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jorge,
Thanks for your feedback ...
At first sight there does not seem to be a difference in type ...
The model class defines it local type as:
isactive type c length 1,
The data dictionary domain linked with the actual field is 'BOOLEAN' which has the same data type 'C' with length '1'.
To me that seems like being identical .. not sure what the 'Edm.Boolean' type would otherwise expect ?
Thanks,
Steven
Hi Rajesh,
Did you check out the following SAP Note ?
Note 1763390 - Date Time data source mapping validations (SEGW transaction)
Regards,
Steven
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.