In this section, we will code the query operation for the entity sets.
Right click on GetEntitySet (Query)
, choose Map to DataSource
Click the Propose Mapping button to automatically map from the RFC response.
Additionally, add the two input parameters SoId
and BuyerName
of the Function Module as seen manually below.
Click on the box to the left of SoId to select the first row. Click on the Insert Row button at the top.
Click on the small box in the Entity Set property box when selected. This will propose options for the field. Choose SoId
.
Click and drag SELPARAMSOID[]
from the right hand side into the Data Source Parameter box for the top row. Click the green check box on the popup window.
Similarly, click on the box to the left of BuyerName
to seleft the row. Click on the Insert Row button at the top.
Click on the small box in the Entity Set property box when selected. This will propose options for the field. Choose BuyerName
.
Click and drag SELPARAMBUYERNAME[]
from the right hand side into the Data Source Parameter box for the row. Click the green check box on the popup window.
The end result should look similar to this screenshot:
This is all that we need to do to finish the mapping of our SalesOrders Entity Set. Save the project, and re-generate the runtime objects.
In a similar manner, complete the implementation of our Entity Set LineItems
.
Additionally, manually add the required input parameter SoId
as seen below:
Now that our Query requests are ready for our entity sets, let's add a Read (GetEntity
) service implementation for our SalesOrder
entity set. We will use this in our client to get additional details about a Sales Order.
Once we're done, again, don't forget to save and re-generate the runtime objects.
Now that we have our service built and activated, let's run some queries against our service to test that it is working as expected.