Application Development 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: 

How to use hints LEADING(T_01) USE_NL(T_00) in select statement?

luobin
Explorer
0 Kudos
1,259

/*+ leading(b) use_nl(a) */

I use this statement in select, but error will happen.

: Unknown column name "/*+" field list. field list. field list. field

So, how to fix them and how to use them?

Thanks.


SELECT /*+ leading(b) use_nl(a) */
a~reswk a~aedat a~ernam a~ebeln
b~reslo b~lgort b~afnam b~zlgort_final
b~matnr b~matkl b~menge b~meins
c~j_3asize c~j_4kscat c~eindt
b~ebelp c~etenr

INTO CORRESPONDING FIELDS OF TABLE gi_transfer

FROM ekko AS a

INNER JOIN ekpo AS b

ON a~ebeln = b~ebeln

INNER JOIN eket AS c

ON b~ebeln = c~ebeln
AND b~ebelp = c~ebelp

WHERE a~bsart IN gv_stotype
AND a~bsart = p_type
...
AND c~glmng = 0.
4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos
271

That's not the correct Abap syntax, look in online Abap documentation for %HINTS or read 129385 - Database hints in Open SQL.

Regards,
Raymond

0 Kudos
271

Hi Raymond,

Thank you, could you help to show me how to write the correct statement?

Because I have no authority to search for the sap note.

0 Kudos
271

Code should be some

SELECT [..] FROM [..] WHERE [..] GROUP BY [..] HAVING [..] ORDER BY [..]  %_HINTS selector 'text' selector 'text' [..]

Where selector are related to actual database (ORACLE, DB2, etc.) and 'text' is the hint (can be a char variable or a text constant)

But there are also notes for most databases managed by SAP, so ask you basis to download the note for your database in a pdf format.

Regards,
Raymond

0 Kudos
271

Thank you Raymond.