Skip to Content

No first field of table index for ACDOCA

Hi all,

I am running the Code Inspector on a slow performing piece of standard code. I receive message:

"S/4HANA - large table ACDOCA: WHERE condition does not contain any fields of an HDB table index"

Answers to previous question doesn't seem to apply here:
https://archive.sap.com/discussions/thread/3290248

Here's the statement:

SELECT (lt_columns_secure) ##DB_FEATURE_MODE[TABLE_LEN_MAX1]
	FROM acdoca 
	INTO CORRESPONDING FIELDS OF TABLE lt_acdoca_bi   
                                    FOR ALL ENTRIES IN lt_acdoca_pckg
                                    WHERE rldnr  = lt_acdoca_pckg-rldnr
                                    AND   rbukrs = lt_acdoca_pckg-rbukrs
                                    AND   gjahr  = lt_acdoca_pckg-gjahr
                                    AND   belnr  = lt_acdoca_pckg-belnr
                                    AND   docln  = lt_acdoca_pckg-docln.

Here are the database table keys:

RCLNT
RLDNR
RBUKRS
GJAHR
BELNR
DOCLN

The first field RCLNT is the Client (Data Element = MANDT). I would expect that this is not needed, right?

What do you think?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 08 at 12:55 PM

    Hey Julien,

    First I agree to your analysis, that this message should not be there, as it should be using the primary key index.

    (And: as you say RCLNT, having Data Element = MANDT should be supplied by the runtime, so it's a full-qualified primary key access.

    Second, there's a thought I have, that maybe on HDB, there's not necessarily such a thing as a primary key index?!

    I looked at the database object of ACDOCA (on my S/4HANA 1709), and indeed it doesn't show any index listing the primary-key -fields. (As opposed to VBAP, where there's the ~0 index, with all the key fields).

    So this is more a guess that an answer, but maybe it helps someone else to give a full solution/answer.

    best

    Joachim

    PS: as you mention performance, FOR ALL ENTRIES, and HANA db, there's a blog I recently saw, maybe that's helpful to you:

    https://blogs.sap.com/2018/04/17/when-for-all-entriesfae-gone-for-a-toss/

    -> it's about SAP Note 1662726 "– Optimization of select with FOR ALL ENTRIES on SAP HANA database"

    Add comment
    10|10000 characters needed characters exceeded