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

how to see the abap code in sql language.

Former Member
0 Likes
755

hello gurus,

very simply put,i dont know sql,but have to write some basic select queries to talk to oracle db...

i would like to see the SQL transaltion of the ABAP code which i cant write.

for eg: SELECT SINGLE * FROM MARA WHERE MATNR = 'XXXX'.

How wud u write this on ORACLE.

i would also like to see for all entries etc...

NOW,i have tries st05..it doesnt give meaningful sql..

pls help

1 ACCEPTED SOLUTION
Read only

Rui_Dantas
Active Contributor
0 Likes
712

ST05 does give you the SQL. What do you mean by "meaningful" SQL ?

5 REPLIES 5
Read only

Rui_Dantas
Active Contributor
0 Likes
713

ST05 does give you the SQL. What do you mean by "meaningful" SQL ?

Read only

0 Likes
712

hai

i wrote this in se38

report zdsd.

data wmatnr type mara.

select single * from mara into wmatnr where matnr = '0001'.

write wmatnr.

_from st05_

41 PROGDIR REOPEN 0 0 SELECT WHERE "NAME" = 'ZTEST123' AND "STATE" = 'A'

1,182 PROGDIR FETCH 1 0

4 DWINACTIV REOPEN 0 0 SELECT WHERE "OBJECT" = 'REPS' AND "OBJ_NAME" = 'ZTEST123'

592 DWINACTIV FETCH 0 1403

8 MARA REOPEN 0 0 SELECT WHERE "MANDT" = '001' AND "MATNR" = '0001'

9,388 MARA FETCH 1 0

i would like

select matnr

into :vi_matnr

from PPS_SUB_BDZ.lm1_lagerpl

where matnr = '0001'

basicaly i need to work on new database (NON SAP) by making connections..

i write the code in FM's in ABAP.

I write Select queries between EXEC SQL. and

ENDEXEC.

I have to use SELECT SINGLE...FOR ALL ENTRIES ...counterparts now...

Read only

0 Likes
712

The one you want is the last one, obviously (for MARA).

Double click on it (or, better, select it and use button "Replace placeholders"). That's as good as it gets. You should get something like:

SELECT                                                                                
*                                                                 
FROM                                                                
  "MARA"                                                            
WHERE                                                               
  "MANDT" = '<your_mandt>' AND "MATNR" = '0001'

(remember that mandt is automatically added when accessing the db)

Read only

0 Likes
712

ok thanks ..will check and come back..

Read only

HermannGahm
Product and Topic Expert
Product and Topic Expert
0 Likes
712

Hi,

could you please explain what you have done?

Any correct OPEN SQL traced by ST05 will show the native SQL that has been sent to the database.

For simple cases you can use SE16 and don't have to write OPEN SQL.

Kind regards,

Hermann