cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in creating OData Service

Former Member
0 Kudos

Hi

I was following the steps in the guide

And ran into following error.

Can someone please help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello ,

In the Guide which you referring to please see the below screen where we are mapping all the entity properties to one output table called header data are you doing the same ?

multiple output tables cannot be mapped to single entity type with Mapping approach where as you can do that using Code based approach by Redefining entity set method in DPC_EXT

Thanks

Sri

Answers (7)

Answers (7)

AshwinDutt
Active Contributor
0 Kudos

Hello Ahmed,

You are mapping an input structure of your BAPI ES_HEADER as output which is causing the error.

You need to map the out put table as the response while performing mapping.

Correct this and issue will be resolved.

Also note that while mapping in SEGW you cannot map more than one table as response.

only one table can be mapped as response in SEGW while using performing mapping option.

If at all you need to map more than one table as GW Response then in that case you need to create GW Model with different entities and association between them with appropriate cardinality and Create run-time objects.

Then manually implement Expand Entity/Entity Set method by calling that BAPI inside it in DPC_EXT class.

Refer ->

Also while implementing QUERY there is no rule that input must be mapped. Its always an optional.

Only rule is the Key properties of your GW Model need to be a part of out put mapping.

Regards,

Ashwin

former_member206574
Active Participant
0 Kudos

Hi,

and one more thing map that GET_Detail BAPI in GET_ENTITY (Read) operation. your issue will get resolved.

Regards,

Venu

former_member206574
Active Participant
0 Kudos

hi

The following are some of the mapping rules for the query operation:

  • If the data source parameter you are mapping is a table, or structure, the mapping attribute is automatically defined according to the data source parameter type.In case, the data source parameter is of type, changing, Service Builder does not automatically set the direction; you must manually set the mapping direction.
  • If the data source attribute you are mapping is a table, the mapping attribute is changed to the type, output.
  • If the data source attribute you are mapping is a range table, the mapping attribute is changed to the type, input.
  • You can map only one table of type, output.
  • When mapping a property that is set as key, it must be of type, output.Key property must be mapped to one of the attributes in a table parameter in the remote function module or data source.Also, it can be mapped to the input parameter of a remote function module.In this case, it allows you to filter the results by the key property as well.

You have to map  atleast one attribute to Output table of RFC. Query operation expecting this.

Regards,

Venu

Former Member
0 Kudos

Hi

Thanks for the help all I was able to solve the mapping thing but still output table error remains

Any thoughts on it would really be appreciated

Thanks

Former Member
0 Kudos
EkanshCapgemini
Active Contributor
0 Kudos

The error is because you have mapped the properties to the ES_HEADER i.e. a structure and not the table thus it can contain only a single line. Since this is a GET_ENTITYSET or query mapping, the gateway expects that you would map the property to the table so that it can contain multiple lines to serve the purpose of Query.

Hope this resolves your issue.

former_member206574
Active Participant
0 Kudos

Hi,

I am assuming  in your RFC Mandatory input  Parameters orderid and number is there, which are mandatory to do input mapping. I didn't find any mapping for inputs in your mapping screen shot to RFC.

If you dont want to do input mapping then for input parameters in RFC mark Optional check box.. and again check in segw.

Regards,

Venu

Former Member
0 Kudos

Hi

Thanks Ekansh and Srikanth

Your answer were really helpful, now i have only one table, but getting another error

If anyone can shed some light here, really appreciate it

Former Member
0 Kudos
EkanshCapgemini
Active Contributor
0 Kudos

Hi,

Can you please check your mapping again as the error shows that you have not mapped anything with output table. The mapping should be exactly like the image attached with the Srikanth's reply.

Former Member
0 Kudos

Hello Dilshad,

would really appreciate if you can attach mapping screen

i suspect you are mapping a Import parameter of RFC and not to table , As it is a query operation you need to map to a table

Please verify .

thanks

Sri

Former Member
0 Kudos

Hi

We have mapped two entity types to two separate data sources..

Mapping for both are shown in the screen sht below.

Thanks for your help in advance

EkanshCapgemini
Active Contributor
0 Kudos

Hi,

The screenshot of error states that the error is in the mapping of entityset WORKORDER_STANDARDset. Can you please send the full screen (with the RFC structure at the right hand side) screenshot of mapping for this entityset in query method.

EkanshCapgemini
Active Contributor
0 Kudos

Hi Dilshad,

As the error itself states that you can not use more than 1 output table in case of query. Please check your mapping. The SEGW tool will not let you map properties from 2 o/p tables.

If in any case you need to get the output from more than one table, you can do that in the GET_ENTITYSET method of respective entity set. In that method, you will find the code where we loop at the output table and populate the et_entityset table. Here you can alter the code as per your need and read the data from multiple tables.

Regards,

Ekansh