2024 Jun 20 2:16 PM - edited 2024 Jun 20 2:18 PM
Hi Community,
we have created an ODATA V4 in ABAP via the RAP process, which works without any problems and a CDS data query and action call is possible.
We have also implemented a query with parameters, which is to be called with the parameters and returns a list which is sorted in the ABAP backend and the parameter "menge" is used to decide how many data records (lines) are returned.
in eclipse with "service bindings" in the preview this works exactly as desired and the abap code is processed
We have defined the query in this way:
@EndUserText.label: 'MM: Data Model Bestandsübersicht'
@ObjectModel.query.implementedBy: 'ABAP:ZCL_MM_BESTAND_PGMVT_LITE'
define root custom entity ZMM_I_BESTAND_PGMVT_LITE
with parameters
matnr : matnr,
werks : werks_d,
menge : zmm_de_menge_dec
{
key charge : charg_d;
key mhd : vfdat;
@Semantics.quantity.unitOfMeasure : 'ZMM_I_BESTAND_PGMVT_LITE.EINHEIT'
bestand : labst;
einheit : meins;
}
i have tried to work with the examples that can be found in the following link:
Parameters - Documentation - Demo Kit - SAPUI5 SDK (ondemand.com)
With the help of this documentation, however, I have not even managed to send a request to the abap backend, it always goes to an error in the browser console.
How can I call the query with parameters which I pass to the backend and get back a list as seen in the eclipse preview?
Metadata:
<EntityType Name="BESTANDType">
<Key>
<PropertyRef Name="charge"/>
<PropertyRef Name="mhd"/>
</Key>
<Property Name="charge" Type="Edm.String" Nullable="false" MaxLength="10"/>
<Property Name="mhd" Type="Edm.Date" Nullable="false"/>
<Property Name="bestand" Type="Edm.Decimal" Nullable="false" Precision="13" Scale="3"/>
<Property Name="einheit" Type="Edm.String" Nullable="false" MaxLength="3"/>
<NavigationProperty Name="Parameters" Type="com.sap.gateway.srvd.zmm_ui_pgmvt_lite.v0001.BESTANDParameters" Nullable="false"/>
</EntityType>
<EntityType Name="BESTANDParameters">
<Key>
<PropertyRef Name="matnr"/>
<PropertyRef Name="werks"/>
<PropertyRef Name="menge"/>
</Key>
<Property Name="matnr" Type="Edm.String" Nullable="false" MaxLength="40"/>
<Property Name="werks" Type="Edm.String" Nullable="false" MaxLength="4"/>
<Property Name="menge" Type="Edm.Decimal" Nullable="false" Precision="13" Scale="3"/>
<NavigationProperty Name="Set" Type="Collection(com.sap.gateway.srvd.zmm_ui_pgmvt_lite.v0001.BESTANDType)" Partner="Parameters" ContainsTarget="true"/>
</EntityType>
many thanks in advance!
Best regards,
Lukas
Request clarification before answering.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.