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

Indexname in Database

rainer_hbenthal
Active Contributor
0 Likes
1,571

Hi,

creating an index on a table will result in nameschema like tablename~inx where inx is the three letter name you enter in SE11(Indexes).But: the indexname for the index in the database is limited in the dictionary to 18 chars. So some truncation occurs, eg the index Z10 on table ZSD_RU_CUSTOMLOG will result in ZSD_RU_CUSTOMLOGZ1

I thought the indexname in the database is stored in table DD12L in field DBINDEX, but in this case this field is blank? The index exists for sure and SE11 stated Index ZSD_RU_CUSTOMLOGZ1 exists in database system ORACLE

So where is this information stored? Unfortunetly, pressing F1 and F4 does not reveal any information where this comes from.

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
1,082

I found this in MSGTBF01:

" AW: Manche generierte Indizes haben das Feld DD12V-DBINDEX
        " nicht gepflegt. >> Falls dies der Fall ist: bestimme
        "                                             Indexname neu.

        call function 'DD_INDEX_NAME'
             exporting
                  indexname = dd12v-indexname
                  tabname   = dd12v-sqltab
             importing
                  dbindex   = dd12v-dbindex.

So you would need to call this function to determine the name in case DD12L-DBINDEX is empty.

Thomas

Hi,

creating an index on a table will result in nameschema like tablename~inx where inx is the three letter name you enter in SE11(Indexes).But: the indexname for the index in the database is limited in the dictionary to 18 chars. So some truncation occurs, eg the index Z10 on table ZSD_RU_CUSTOMLOG will result in ZSD_RU_CUSTOMLOGZ1

I thought the indexname in the database is stored in table DD12L in field DBINDEX, but in this case this field is blank? The index exists for sure and SE11 stated Index ZSD_RU_CUSTOMLOGZ1 exists in database system ORACLE

So where is this information stored? Unfortunetly, pressing F1 and F4 does not reveal any information where this comes from.

4 REPLIES 4
Read only

ThomasZloch
Active Contributor
0 Likes
1,083

I found this in MSGTBF01:

" AW: Manche generierte Indizes haben das Feld DD12V-DBINDEX
        " nicht gepflegt. >> Falls dies der Fall ist: bestimme
        "                                             Indexname neu.

        call function 'DD_INDEX_NAME'
             exporting
                  indexname = dd12v-indexname
                  tabname   = dd12v-sqltab
             importing
                  dbindex   = dd12v-dbindex.

So you would need to call this function to determine the name in case DD12L-DBINDEX is empty.

Thomas

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,082

The logic lies inside the fm DD_LIST_INDEX & DB_GET_INDEXES. Place a debug point and check it

Read only

0 Likes
1,082

Brrrr, SAP Coding... data: sections inside an if-statement

Read only

0 Likes
1,082

Little late to reply, just to share the way the text "Index ZSD_RU_CUSTOMLOGZ1 exists in database system ORACLE" in SE11 is determined.

If length of concatenated value of TABLENAME and INDEXNAME > 15

concatenate [tablename] [indexname] to [dbindex name variable] (of length 18).

In your case, table length is already 16, as per above logic {dbindex name variable} will have truncated text.

See Program "LSDD0F02", sub-routine "DD_INDEX_NAME" called from Function module DB_EXISTS_INDEX.

Regards, Vinod