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

ST05

Former Member
0 Likes
769

HI EVERY BODY . I HAVE A QUESTION . I DEVELOP MANY PROGRAMS IN R3 AND ACTUALITY I HAVE SAP VERSION ECC 6.0 AND I EXECUTE THE TRANSACTION ST05 AND THE TRACE FOR SOME SELECTS DON'T MATCH WITH THE ABAP COMMAND FOR EXAMPLE IN THE ABAP CODE I HAVE


SELECT A~PLTYP B~PTEXT FROM T189 AS A INNER JOIN T189T AS B
    ON A~PLTYP EQ B~PLTYP
    APPENDING TABLE P_T_LISTAS
    WHERE A~PLTYP IN P_S_PLTYP AND
          B~SPRAS EQ SY-LANGU.

AND IN THE RESULT OF TRACER ON ST05 TRANSACTION SHOW ME THIS


CREATE PROC sap_XPLupgradesap3112705  
 @P0 varchar(3)  
,@P1 varchar(3)  
,@P2 varchar(1)  
 AS
BEGIN  
SELECT T_00."PLTYP",T_01."PTEXT"  
FROM "T189" T_00 INNER 
JOIN "T189T" T_01 ON T_01."MANDT" =  @P0  AND T_00."PLTYP" = T_01."PLTYP"

WHERE T_00."MANDT" =  @P1  AND T_01."SPRAS" =  @P2 
/* R3:ZSDE0006:2405 T:T189 331*/ 
/*Dynamic
SQL statement -- no cursor, upto 0, conn. 0:2*/  
  
END

Apparently DON'T INCLUDE THIS ABAP COMMAND


A~PLTYP IN P_S_PLTYP

BUT IN THE ABAP PROGRAM THE RESULT IT IS OK. BUT I DON'T UNDERSTAND WHY THE TRASNSACTION DO THIS.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
729

I NOW THAT.

BUT I DO NOT WANT TO EXECUTE SQL NATIVE ON MY ABAP PROGRAM, I NEED TO EJECUTE THE ABAP sentence WITH THE ALL RESTRICTION IN THE "WHERE" STATEMENT

4 REPLIES 4
Read only

Former Member
0 Likes
729

Hi Gibran

What you have used is the Open SQL, at runtime ABAP will convert these statements to the format that the backend database can understand.

I think this is the reason that the query you find is different in ST05.

Some info on the same,

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/content.htm

Regards

Kathirvel

Read only

Former Member
0 Likes
730

I NOW THAT.

BUT I DO NOT WANT TO EXECUTE SQL NATIVE ON MY ABAP PROGRAM, I NEED TO EJECUTE THE ABAP sentence WITH THE ALL RESTRICTION IN THE "WHERE" STATEMENT

Read only

729

Hi Gibron

<b>NEED TO EJECUTE THE ABAP sentence WITH THE ALL RESTRICTION IN THE "WHERE" STATEMENT </b>

SELECT APLTYP BPTEXT FROM T189 AS A INNER JOIN T189T AS B

ON APLTYP EQ BPLTYP

APPENDING TABLE P_T_LISTAS

WHERE A~PLTYP IN P_S_PLTYP AND

B~SPRAS EQ SY-LANGU.

The select query what you are using here is in Open SQL. All the restrictions and conditions you want will be properly executed by the ABAP engine.

The fact is there can be any database server like oracle,DB2, MS SQL as the backend for SAP where the data is stored ultimately.

So, what ABAP does is it will convert these queries into the format what these database servers will understand and fetch the data. ST05 will monitor all these activities, function calls etc and log that which can be later analysed.

I understand from your query that you feel ABAP has missed some restrictions,

<b>Apparently DON'T INCLUDE THIS ABAP COMMAND

A~PLTYP IN P_S_PLTYP</b>

I think you believe that ABAP has not put these restrictions in the query it had contructed. But definitely it would have created that, may it is not fully displayed in the ST05 trace. Thats it.

<b>BUT IN THE ABAP PROGRAM THE RESULT IT IS OK.</b>

The reason is that the restrictions you have passed were considered, as I said before they may not be displayed completely in the trace file.

Hope this clarifies your doubt.

Regards

Kathirvel

Read only

Former Member
0 Likes
729

thank you