FUNSTKACC: Too many constants sqlCstAnalyse 128 >= 128 or "Too many constants"

Cause

GDOSLEG variable was increased to 250 when more legislations were added to the system. Find command cannot handle more than 127 characters.

Solution

1. To be fixed on patch 26

Workaround

1. Run the function site by site or 

2. Change the value of gobal variable GDIMLEG to 127 from 250 in Global variables function (GESAGB)

  • Thank you, changing the size of GDIMLEG to 127 worked for us. (We are on v12 p25)

  • If someone is looking for a reason of this error, please check your Where statements, each statement inside where counts as 1 but Find equals number of values. it has to be less than 128. 
    1. example - 4 statements

    Filter [SIH] where BPR='SAGE' & ACCDAT>[2023/05/08] & FCY='FR1' and (ORIMOD=1 or ORIMOD=5 )

    2. example - 5 statements, becuase each value inside find counts separately

    Filter [SIH] where BPR='SAGE' & ACCDAT>[2023/05/08] & FCY='FR1' and find(ORIMOD,1,5)

    3. example - 130 statements, and we will get an error because we have too long where clause

    Filter [SIH] where BPR='SAGE' & ACCDAT>[2023/05/08] & FCY='FR1' and find(ORIMOD,1,5) and find(NUM,[L]SALES_NUMS(0..125)