cancel
Showing results for 
Search instead for 
Did you mean: 

Database query

Former Member
0 Kudos

What is the technique to fetch data from outside(not using ABAP ) from SAP SYSTEM?

What is the limitation of Native SQL?

Accepted Solutions (1)

Accepted Solutions (1)

ferry_lianto
Active Contributor
0 Kudos

Hi,

What is the technique to fetch data from outside(not using ABAP ) from SAP SYSTEM?

You can use Native SQL statement.


EXEC SQL [PERFORMING <form>].
  <Native SQL statement>
ENDEXEC.

What is the limitation of Native SQL?

In my past experience, only when DB connection is down which can cause an issue for native SQL statement (you may get dump error). Other than that it works fine.

Regards,

Ferry Lianto

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can use Native SQL to fetch data from SAP system.

The main limitation of Native SQL is that it is Database specific. Hence, if the underlying database is changed, your native SQL statements will stop working which can cause a lot of problems in the system.

Regards,

Mukul

Former Member
0 Kudos

Check with below Links :

http://help.sap.com/saphelp_nw04/helpdata/en/bb/9f039a4b9b11d189750000e8322d00/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/bb/9f04624b9b11d189750000e8322d00/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/bb/9f038d4b9b11d189750000e8322d00/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/bb/9f047c4b9b11d189750000e8322d00/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/bb/9f03c14b9b11d189750000e8322d00/frameset.htm

You can use CL_GUI_FRONTEND_SERVICES->EXECUTE to start an external application from SAP.

or

Try using the function module below:

call function 'RFC_REMOTE_PIPE' destination 'SERVER_EXEC'

exporting

command = w_command

read = 'X'

tables

pipedata = it_ret

exceptions

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

others = 5

or you can use NATIVE SQL

check this example.

DATA: exc_ref TYPE REF TO cx_sy_native_sql_error,

error_text TYPE string.

TRY.

EXEC SQL.

INSERT INTO scarr

(MANDT, CARRID, CARRNAME, CURRCODE, URL)

VALUES ('000', 'FF', 'Funny Flyers', 'EUR',

'http://www.ff.com');

INSERT INTO scarr

(MANDT, CARRID, CARRNAME, CURRCODE, URL)

VALUES ('000', 'EF', 'Easy Flyers', 'EUR',

'http://www.ef.com');

ENDEXEC.

Thanks

Seshu