Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Functional module to get table entries in another system

pradeepmathewch
Employee
Employee
0 Kudos

Hi all,

Is there any functional module with which we can get the data of a table which

belongs to another system(Using RFC calls)

Thanks and Regads, Pradeep

1 ACCEPTED SOLUTION

Former Member
0 Kudos

yes - u can use<b> RFC_READ_TABLE</b>.

You can pass -

1. Fieldnames you want to select.

2. WHERE Condition.

3. Max number of rows

SKC.

3 REPLIES 3

Former Member
0 Kudos

Hi,

check on your 'target' system where you want to read whether there are

function modules which provide the necessary data

and then check wheter they are remote enabled (in attibutes tab)

if so, you have found what you're looking for, call that function like this:

call function 'something'

destination x

exporting

importing

check <a href="http://help.sap.com/saphelp_nw04/helpdata/en/26/64f61dfa8911d386e70000e82011b8/frameset.htm">documentation</a>

grtz,

Koen

Message was edited by:

Koen Labie

Former Member
0 Kudos

Hi Pradeep

you can acess another table in the database directly .Follow this way.

1 transaction code : dbco : configuration about database that you would like to connect

2.tell basis team to set system file (example Oracle ) to know the database.

3.coding , you can use code below to select the data from another database by native SQL .

PARAMETERS dbs TYPE dbcon-con_name default 'SDB'.

DATA carrid_wa TYPE scarr-carrid.

DATA lv_int TYPE i.

*Types

data: begin of ty_equi,

equipment(25) type c,

SERIALENERGY(25) type c,

end of ty_equi.

*Internal Tables

data it_equi like table of ty_equi.

data wa_equi like line of it_equi.

DATA dbtype TYPE dbcon_dbms.

SELECT SINGLE dbms

FROM dbcon

INTO dbtype

WHERE con_name = dbs.

IF dbtype = 'ORA'.

TRY.

EXEC SQL.

CONNECT TO :dbs

ENDEXEC.

IF sy-subrc <> 0.

RAISE EXCEPTION TYPE cx_sy_native_sql_error.

ENDIF.

EXEC SQL.

OPEN dbcur FOR

SELECT

EQUIPMENT,

SERIALENERGY

FROM emd.meter

ENDEXEC.

DO.

EXEC SQL.

FETCH NEXT dbcur INTO :wa_EQUI

ENDEXEC.

IF sy-subrc <> 0.

EXIT.

ELSE.

WRITE: /

wa_equi-equipment,

wa_equi-SERIALENERGY.

ENDIF.

ENDDO.

EXEC SQL.

CLOSE dbcur

ENDEXEC.

EXEC SQL.

DISCONNECT :dbs

ENDEXEC.

CATCH cx_sy_native_sql_error.

MESSAGE `Error in Native SQL.` TYPE 'I'.

ENDTRY.

ENDIF.

Best Regards

wiboon

Former Member
0 Kudos

yes - u can use<b> RFC_READ_TABLE</b>.

You can pass -

1. Fieldnames you want to select.

2. WHERE Condition.

3. Max number of rows

SKC.