cancel
Showing results for 
Search instead for 
Did you mean: 

oData service development based RFC

Former Member
0 Kudos

Hi Firends,

I am developing a oData service based on RFC. Our setup is central hub deployment. We have Gateway server and ERP in separate boxes.

Question 1: In which server I have to develop the oData service? is it in SAP DEV box or SAP Gateway box?

I tried initially developing oData service in Gateway Server but I did not find any data elements or references ,  data types in Gateway server so I had to switch my oData service development to ERP DEV system, then I can run the service in SAP Gateway client via System Alias usign RFC connection.

is it best practice?

2. As part of the oData service development.  I have created custom z RFC wrapper with two import parameters likeIM_MODUS , IM_BEGDA and EX_ACCOUNTS as Export parameter. Now I am calling the below FM in my custom wrapper as ZAccounts_GET.

CALL FUNCTION 'PT_ARQ_ACCOUNTS_GET'

       EXPORTING

         im_pernr     = '1234'

         im_begda     = '20141111'

         im_modus     = 'R'

       IMPORTING

         ex_accounts  = ex_accounts

       TABLES

         ex_messages  = l_messages

         ex_commands  = lx_commands.

   ENDIF.


3. In Data Model imported RFC which created Entity Types.


4. Now in the service implementation , I have selected GetEntitySet(Query)--> Map to data source, here I am not seeing input parameters, why are they not showing up ? attached screen doesn't have imPernr, im_begda, im_modus.  Some reason these are created in separate Entity type.  Screens attached.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Krish.

As for your first question. Given you're using a central hub deployment, you should develop your services in the backend - your ERP, once you're done, you will have to register them on your Gateway Server.

If I'm not mistaken, your services should be always coded where the IW_BEP component is installed.

As for the deployment of your service.

My advice would be that, instead of trying to use the RFC directly for the service implementation, to use a code oriented focus, this is to go to ABAP workbench option:

And redefine the service, this way you would directly be able to call your RFC and implement your logic there.

This is, of course just an opinion and maybe not the best approach if you're not familiar with ABAP.

EDIT:

Reading your question I think I know what happend with your data getting separated in multiple entities.

I ran a test using a RFC to create the model:

As you can see, there's a flag that reads "Assign Structure". If you leave it unchecked, the data you have chosed will be set into ONE entity.

If however you leave it checked, it will create one entity for each one.

Hopefully this would give you some insight on some of your issues.

Cheers.

Message was edited by: Emmanuel Gonzalez

Former Member
0 Kudos

Thanks Emmanuel for the clarification.

Thanks

Krish

Answers (1)

Answers (1)

EkanshCapgemini
Active Contributor
0 Kudos

Hi Krish,

For the Question 1, there are two cases in Central Hub architecture as well. The difference is that in one scenario, the hub system also contains IWBEP component along with IWFND and GW_CORE but in the other scenario, hub system only contains GW_CORE and IWFND but IWBEP is in the backend system. Gateway service can be developed on the system where IWBEP is installed so if your Hub system contains IWBEP, you can also develop the service in gateway system.

The will provide you benefit in case of multiple backend system. If you have to support multiple backend systems for the same service, you just need to have that particular RFC available in other systems and then assign respective multiple system aliases to the same OData service.

Regards,

Ekansh