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

what does it means???

Former Member
0 Likes
1,077

hi there?

what is the meaning of last row in the where clause.

SELECT ALIFNR ANAME1 AREGIO AKTOKK

FROM LFA1 AS A

INNER JOIN LFB1 AS B

ON ALIFNR = BLIFNR

INTO TABLE I_VENDOR

WHERE A~LIFNR IN S_LIFNR

AND B~BUKRS EQ P_BUKRS

AND B~ZWELS EQ P_ZWELS

%_HINTS DB2 '&SUBSTITUTE VALUES&'.

hi there?

what is the meaning of last row in the where clause.

SELECT ALIFNR ANAME1 AREGIO AKTOKK

FROM LFA1 AS A

INNER JOIN LFB1 AS B

ON ALIFNR = BLIFNR

INTO TABLE I_VENDOR

WHERE A~LIFNR IN S_LIFNR

AND B~BUKRS EQ P_BUKRS

AND B~ZWELS EQ P_ZWELS

%_HINTS DB2 '&SUBSTITUTE VALUES&'.

4 REPLIES 4
Read only

Former Member
0 Likes
919

Hi,

Can you paste the whole code of the program.

Not sure but may be some macro may be there. i am just trying to guess

Regards,

Atish

Read only

KjetilKilhavn
Active Contributor
0 Likes
919

It is a database hint which is a way of passing information directly to the DBMS. I know these can be used to tell the DBMS which index should be used, but they can possibly also be used for other purposes. Have never used them myself, but I remember it being mentioned as one of the new features some years ago.

Advantage: optimization and performance improvements becomes possible

Disadvantage: DBMS-specific code, but from your code it seems you can give hints for different DBMS's which would be a Good Thing for SAP and ISVs.


Kjetil Kilhavn (Vettug AS) - ABAP developer since Feb 2000, but will probably never be a Rockstar developer
Read only

Sougata
Active Contributor
0 Likes
919

<<<< %_HINTS DB2 '&SUBSTITUTE VALUES&'. >>>>>

This means that its using an index named 'SUBSTITUTE VALUES' explicitly while trying to select data which is defined in the SAP database layer (DB2 in this case).

Cheers,

Sougata.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
919

That's a "hint" to database SQL server, look at OSS <a href="https://service.sap.com/sap/support/notes/129385">Note 129385 - Database hints in Open SQL</a>

<b> &SUBSTITUTE LITERALS&</b>

<i> Explicit request to the database interface, to insert all literal values directly into the statement text. Literals are direct literals in the ABAP program text as well as global ABAP constants but not constant (FORM-)parameters. This is to supply information to the optimizer which makes it possible to utilize statistics via the value distributions.

As of Release 4. 5, the database interface for some databases with more complex statements will attempt to insert literals directly into the statement text. You should therefore verify in the SQL trace (Transaction ST05) if this require this hint.

Depending on the database, it is possible that all ABAP literals are not passed on to the database as a literal. As an example, such restrictions can apply to certain data types.

</i>

<b>&SUBSTITUTE VALUES&</b>

<i>are similar to &SUBSTITUTE LITERALS& and the explicit request to insert values directly in the statement text, to allow the optimizer to better use statistics for value distributions for optimization.

In contrast to &SUBSTITUTE LITERALS&, however, all values are inserted and not only literals. As a result, every call of the Open SQL statement in question generates a new statement and as a result a statement cache can no longer be used.

In the case of &SUBSTITUTE LITERALS& for instance, there may be database-dependent restrictions whose values are actually passed on to the database as a literal.</i>

Regards