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

Reg: Native SQL statement

Former Member
0 Likes
541

Hi Experts,

using the below native SQL statment get the Document Number.

But its going to Short dump

EXEC SQL.

SELECT BELNR

INTO :lv_belnr-low

FROM RFBLG WITH ( INDEX ( "RFBLG~0" ) )

WHERE MANDT = :p_mandt

AND BUKRS = :lv_bukrs

AND BELNR > :lv_belnr-high

AND GJAHR = :p_gjahr

ORDER BY MANDT, BUKRS, BELNR, GJAHR

ENDEXEC.

DUMP Is: INDEX of ( "RFBLG~0") is not available.

Please suggest me what I need to do to resolve this.

First time I am working in Native Sql statements.

Thnx,

Sam

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
502

Hi,

Try using class CL_SQL_STATEMENT, it is use to trigger the native sql statement. for reference you can also see the demo program ADBC_DEMO provided by SAP.

although I haven't used this class, but I have seen it in a program.

Hope this will help.

With best regards,

Navneet Chaubey

3 REPLIES 3
Read only

Former Member
0 Likes
502

Can you explain what you are trying to do. There must be dozens of easier ways.

Rob

Read only

Former Member
0 Likes
503

Hi,

Try using class CL_SQL_STATEMENT, it is use to trigger the native sql statement. for reference you can also see the demo program ADBC_DEMO provided by SAP.

although I haven't used this class, but I have seen it in a program.

Hope this will help.

With best regards,

Navneet Chaubey

Read only

former_member222860
Active Contributor
0 Likes
502

Sam,

your requirement is not very clear., still u can do the following.

Try re-activate the indexes.

Since it is Table Cluster, you may not find the indexes at the Data Dictionary (SE11).

you can write another Native Sql statement for re-build the indexes of the table like:

EXEC SQL.

ALTER INDEX RFBLG~0 REBUILD

ENDEXEC.

do the above for all the available indexes of the table

Pl. check the above and tell me the result

thanks\

Mahesh