Runtime Errors SAPSQL_INVALID_FIELDNAME
Except. CX_SY_DYNAMIC_OSQL_SEMANTICS
Program SAPLV61Z
Include LV61ZU01
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS', was
not caught in
procedure "SEL_KONDTAB" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
An Open SQL clause was specified dynamically. The contained field name
"WERKS" does not exist in any of the database tables from the FROM clause.
Error found in these codes.
if se_read_all_prestep is initial.
select * from (t681-kotab) appending table <cond_tab>
up to 1 rows
where kappl = se_kappl
and kschl = se_kschl
and datbi >= se_date
and datab <= se_date
and (coding_tab).
h_subrc = sy-subrc.
I had debug the codes and found that when t681-kotab = A752 and line in coding_tab is ALAND = 'DE' and WERKS = 'XX' and VSTEL = 'XX' and LLAND = 'NL'. I will hit error because in A752 table, field WERKS does not exists!
I guess this is a config problem but I do not know how to fix it.
Appreciate helps. Thanks a lot.