cancel
Showing results for 
Search instead for 
Did you mean: 

RFC and Odata Services

former_member186838
Active Participant
0 Kudos

Hi,

I've a RFC with an interface like this

IMPORTING

    VALUE(SNR) TYPE  STRING
EXPORTING
    VALUE(SERVICELIST) TYPE  B1BKSERVTAB

the type B1BKSERVTAB is of type standard table.


depending on the SNR value the RFC return the table with several rows.

If SNR is not valid the RFC return an empty table.

 

My question is now can I use such an RFC for an ODATA Service?

here is my entity definition and the mapping.

Is there a way to pass the SNR to the RFC via the URL to get the complete entityset?

if I call

.../E2E_CHECK_SRV/BookingsSet('100')

I get no result because GetEntity is not implemented (don't know how to do the mapping to get the complete table)

and with .../E2E_CHECK_SRV/BookingsSet

I get nothing because the RFC do not know the SNR to fill the table.

Thanks in advance for any help

BR

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Sturm,

You can use it.

For this You need to implement QUERY / Get_Entity_Set method under the Service Implementation in SEGW.

Right click in QUERY / Get_Entity_Set and select ' Map To Data Source ' option, import that RFC and perform mapping operation.

In URL,

You need to send SNR value as part of filter parameter as below and hence you will get table of data as GW response.

sample :

/E2E_CHECK_SRV/<EntitySetName>?$filter=Snr eq 'XXXX'


Before would help ->



Regards,

Ashwin

former_member186838
Active Participant
0 Kudos

Hi Ashwin,

thanks for the help but this is not working because SNR is not part of TYPE booking.

I get the error that "Property SNR can't be found in type bookings."

best regards,

Stefan

EkanshCapgemini
Active Contributor
0 Kudos

Hi Stefan,

As I can see, you have a property named 'Snr' so it is part of your entity booking. I think this error is because of spelling mistake while calling the gateway service. As you mentioned:


SNR is not part of TYPE booking.

I get the error that "Property SNR can't be found in type bookings."

You seem to pass 'SNR' instead of 'Snr'.

Try passing .../E2E_CHECK_SRV/BookingsSet?$filter=Snr eq 'XXXX' as also mentioned by Ashwin.

Regards,

Ekansh

AshwinDutt
Active Contributor
0 Kudos

Hello Stefan,

Property names defined in gateway model are case sensitive. You need to pass  ' Snr '.

Please check again.

Regards,

Ashwin

Answers (1)

Answers (1)

former_member186838
Active Participant
0 Kudos

Thx Ashwin,

it is working.

Regards

Stefan