Application Development and Automation 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: 
Read only

native sql query in sap

former_member190312
Active Participant
0 Likes
967

Hi all,

my open SQL query is like

select matnr matkl from mara into corresponding fields of table i_mara for all entries in i_marc

where matnr = marc-matnr.

can u plz tell me the native sql for the same query?

Thanks.

pabi

4 REPLIES 4
Read only

Former Member
0 Likes
645

hi,

EXEC SQL PERFORMING form.

Native SQL Anweisung

ENDEXEC.

EXEC SQL

select matnr matkl from mara into corresponding fields of table i_mara for all entries in i_marc

where matnr = marc-matnr.

ENDEXEC.

For further ref pls refer to link...

Read only

Former Member
0 Likes
645

hi,

demo prg ADBC_DEMO provided by SAP ,,,,use CL_SQL_STATEMENT to start

http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3b8b358411d1829f0000e829fbfe/content.htm

u can try

EXEC SQL.

SELECT connid, cityfrom, cityto

INTO :itab_mytable

FROM spfli

ENDEXEC.

thanks

Read only

former_member222860
Active Contributor
0 Likes
645

Hi,

Use this :

data: begin of i_mara occurs 0,
          matnr like mara-matnr,
          matkl like mara-matkl,
       end of i_mara.

exec sql.
select matnr, matkl from mara where matnr in (select matnr from marc) into :i_mara
endexec.


loop at i_mara.
write:/ i_mara-matnr, i_mara-matkl.
endloop.

thanks\

Mahesh

Read only

former_member190312
Active Participant
0 Likes
645

ans