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

Run time error: SAPSQL_WHERE_ILLEGAL_VALUE

Former Member
0 Likes
1,841

Hi all,

Iam getting following dump in PROD.


Runtime Error          SAPSQL_WHERE_ILLEGAL_VALUE                                                               
Except.                CX_SY_DYNAMIC_OSQL_SEMANTICS                                                             
Date and Time          03/19/2007 13:18:49                                                                                
ShrtText                                                                                
A condition specified at runtime has an unexpected format.                                                                                
What happened?                                                                                
Error in ABAP application program.                                                                                
The current ABAP program "SAPLSDTX" had to be terminated because one of the                                
     statements could not be executed.                                                                                
This is probably due to an error in the ABAP program.                                                                                
What can you do?                                                                                
Print out the error message (using the "Print" function)                                                   
     and make a note of the actions and input that caused the                                                   
     error.                                                                                
To resolve the problem, contact your SAP system administrator.                                             
     You can use transaction ST22 (ABAP Dump Analysis) to view and administer                                   
      termination messages, especially those beyond their normal deletion                                       
     date.                                                                                
is especially useful if you want to keep a particular message.                                                                                
Error analysis                                                                                
An exception occurred. This exception is dealt with in more detail below                                   
. The exception, which is assigned to the class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', 
 was neither                                                                    
caught nor passed along using a RAISING clause, in the procedure                
 "RFC_READ_TABLE" "(FUNCTION)"                                                  
.                                                                                
Since the caller of the procedure could not have expected this exception        
 to occur, the running program was terminated.                                  
The reason for the exception is:                                                
The current ABAP program attempted to execute an Open SQL                       
statement containing a WHERE, ON, or HAVING condition with a dynamic            
part.                                                                           
The part of the WHERE, ON, or HAVING condition specified at                     
runtime in the internal table itab contains an invalid                          
value "DEPOT".                                                                                
Information on where terminated                                                       
    The termination occurred in the ABAP program "SAPLSDTX" in "RFC_READ_TABLE".      
    The main program was "SAPMSSY1 ".                                                                                
The termination occurred in line 172 of the source code of the (Include)          
     program "LSDTXU01"                                                               
    of the source code of program "LSDTXU01" (when calling the editor 1720).          
    Processing was terminated because the exception "CX_SY_DYNAMIC_OSQL_SEMANTICS"    
     occurred in the                                                                  
    procedure "RFC_READ_TABLE" "(FUNCTION)" but was not handled locally, not          
     declared in the                                                                  
    RAISING clause of the procedure.                                                  
    The procedure is in the program "SAPLSDTX ". Its source code starts in line 7     
    of the (Include) program "LSDTX
Runtime Error          SAPSQL_WHERE_ILLEGAL_VALUE                                                               
Except.                CX_SY_DYNAMIC_OSQL_SEMANTICS                                                             
Date and Time          03/19/2007 13:18:49                                                                                
ShrtText                                                                                
A condition specified at runtime has an unexpected format.                                                                                
What happened?                                                                                
Error in ABAP application program.                                                                                
The current ABAP program "SAPLSDTX" had to be terminated because one of the                                
     statements could not be executed.                                                                                
This is probably due to an error in the ABAP program.                                                                                
What can you do?                                                                                
Print out the error message (using the "Print" function)                                                   
     and make a note of the actions and input that caused the                                                   
     error.                                                                                
To resolve the problem, contact your SAP system administrator.                                             
     You can use transaction ST22 (ABAP Dump Analysis) to view and administer                                   
      termination messages, especially those beyond their normal deletion                                       
     date.                                                                                
is especially useful if you want to keep a particular message.                                                                                
Error analysis                                                                                
An exception occurred. This exception is dealt with in more detail below                                   
. The exception, which is assigned to the class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', 
 was neither                                                                    
caught nor passed along using a RAISING clause, in the procedure                
 "RFC_READ_TABLE" "(FUNCTION)"                                                  
.                                                                                
Since the caller of the procedure could not have expected this exception        
 to occur, the running program was terminated.                                  
The reason for the exception is:                                                
The current ABAP program attempted to execute an Open SQL                       
statement containing a WHERE, ON, or HAVING condition with a dynamic            
part.                                                                           
The part of the WHERE, ON, or HAVING condition specified at                     
runtime in the internal table itab contains an invalid                          
value "DEPOT".                                                                                
Information on where terminated                                                       
    The termination occurred in the ABAP program "SAPLSDTX" in "RFC_READ_TABLE".      
    The main program was "SAPMSSY1 ".                                                                                
The termination occurred in line 172 of the source code of the (Include)          
     program "LSDTXU01"                                                               
    of the source code of program "LSDTXU01" (when calling the editor 1720).          
    Processing was terminated because the exception "CX_SY_DYNAMIC_OSQL_SEMANTICS"    
     occurred in the                                                                  
    procedure "RFC_READ_TABLE" "(FUNCTION)" but was not handled locally, not          
     declared in the                                                                  
    RAISING clause of the procedure.                                                  
    The procedure is in the program "SAPLSDTX ". Its source code starts in line 7     
    of the (Include) program "LSDTX$01 ".                                             
 ".                                             

Any help will be appreciated.

Thanks

Sukumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
924

can you show your select statement that is responsible for the dump.

regards,

ravi.

3 REPLIES 3
Read only

Former Member
0 Likes
925

can you show your select statement that is responsible for the dump.

regards,

ravi.

Read only

0 Likes
924

Hi Ravi,

Thanks for looking.


* ----------------------------------------------------------------------
*  read data from the database and copy relevant portions into DATA
* ----------------------------------------------------------------------
* output data only if NO_DATA equals space (otherwise the structure
* information in FIELDS is the only result of the module)
IF NO_DATA EQ SPACE.

DATA: BEGIN OF WORK, BUFFER(30000), END OF WORK.

FIELD-SYMBOLS: <WA> TYPE ANY, <COMP> TYPE ANY.
ASSIGN WORK TO <WA> CASTING TYPE (QUERY_TABLE).

IF ROWCOUNT > 0.
  ROWCOUNT = ROWCOUNT + ROWSKIPS.
ENDIF.

>>>  SELECT * FROM (QUERY_TABLE) INTO <WA> WHERE (OPTIONS).

    IF SY-DBCNT GT ROWSKIPS.

*   copy all relevant fields into DATA (output) table
      LOOP AT FIELDS_INT.
        IF FIELDS_INT-TYPE = 'P'.
        ASSIGN COMPONENT FIELDS_INT-FIELDNAME
            OF STRUCTURE <WA> TO <COMP>
            TYPE     FIELDS_INT-TYPE
            DECIMALS FIELDS_INT-DECIMALS.
        ELSE.
        ASSIGN COMPONENT FIELDS_INT-FIELDNAME
            OF STRUCTURE <WA> TO <COMP>
            TYPE     FIELDS_INT-TYPE.
        ENDIF.
        MOVE <COMP> TO
            <D>+FIELDS_INT-OFFSET_DST(FIELDS_INT-LENGTH_DST).
      ENDLOOP.
*   end of loop at FIELDS_INT
      APPEND DATA.

      IF ROWCOUNT > 0 AND SY-DBCNT GE ROWCOUNT. EXIT. ENDIF.

    ENDIF.

  ENDSELECT.

ENDIF.

ENDFUNCTION.

Thanks

Sukumar

Read only

0 Likes
924

From what can be seen in the dump, there is a field 'DEPOT' in the dynamic where calsue & it doesn't exist in the db table.. PL verify your function call to RFC_READ_TABLE ie the db table you are trying to read & the fields that are in the OPTIONS itab of the function call.

~Suresh