cancel
Showing results for 
Search instead for 
Did you mean: 

Can I access table in backend ABAP server from frontend ABAP server ?

Momen_Allouh
Advisor
Advisor
0 Kudos

I developed an oData service in a Front-end ABAP NW server gateway, the oData data provider is custom ZTABLE in the front end ABAP NW server.

If I create a table in backed NW ABAP server, will I be able to access that table from Front-end ABAP NW server in same way I am currently doing ?

{ orange color text is the custom table name }

method TIRES_GET_ENTITYSET.


DATA: lt_tires TYPE TABLE OF ztires,
ls_tires
LIKE LINE OF lt_tires,
lt_entityset
TYPE zcl_ztrucktire_mpc=>tt_tiresentity,
ls_entity   
TYPE zcl_ztrucktire_mpc=>ts_tiresentity.


...

.

.


endmethod.


currently I have query written in the oData CRUD methods that modify the table which is created in the Fronted ABAP server, I just use the table name to get or set the data from the service, what If the table in another Backed NW server will I be able to do the same ? also will I be able to call and access SAP tables and functions that is in backed server ?

Accepted Solutions (1)

Accepted Solutions (1)

former_member184867
Active Contributor
0 Kudos

The trick lies in system alias configuration. The system alias needs to to configured as per the way mentioned in document

Under Example 1.

However you need to do a small adjustment in your data fetching logic. You need to create one RFC function module in your ABAP server. In the RFC you need to write the logic to select data from the table from the same system.

This RFC needs to be called from the DPC(which is in your Gateway system) using the RFC destination configured with the SYSTEM ALIAS. You can fetch the RFC destination from the system alias using the following code in your DPC

DATA lo_destination_finder TYPE REF TO /iwbep/if_destin_finder.

DATA lo_dp_facade TYPE REF TO /iwbep/if_mgw_dp_int_facade.

DATA lv_destination TYPE rfcdest.

* Get RFC destination

lo_dp_facade         ?= /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).

lo_destination_finder = lo_dp_facade->get_destination_finder( ).

lv_destination        = lo_destination_finder->get_rfc_destination_via_rout( ).

Answers (0)