‎2008 Feb 10 5:29 AM
Hi friends,
i am modifying the existing custom program .. now i am getting the run time error if i enter iput for sales organization(KK01) only for other its working fine.we have input as sales org and condition type..
if i enetr KK01 with condition type KL04 workign fine,, if i enter only KK01 its going to dump
please find the below dump and code and advise me.
code writtena as:
002730 form get_cond_number_2 tables msg structure bmmsg
002740 where_tab structure where_tab
002750 using kappl wa_tabl tmp_kschl r_kschl
002760 subrc date
002770 changing wa_knumh out structure zzsdcond.
002780 data:tmp_kbetr(20),
002790 tmp_subrc(3),
002800 tmp_konp like konp,
002810 t_kschl like konp-kschl.
002820
002830 if not r_kschl is initial.
002840 t_kschl = r_kschl.
002850 else.
002860 t_kschl = tmp_kschl.
002870 endif.
002880
-
> select single knumh into wa_knumh from (wa_tabl)
002900 where (where_tab)
002910 and kappl eq kappl
002920 and kschl eq t_kschl
002930 and datbi ge date
002940 and datab le date.
002950
002960 if sy-subrc eq 0.
002970 format intensified on color 4.
002980 ** write: / wa_knumh.
002990
003000 add_msg: msg wa_knumh '' '' '' '' ''.
dump:-
Runtime errors SAPSQL_INVALID_FIELDNAME
Exception CX_SY_DYNAMIC_OSQL_SEMANTICS
One of the field names in the SELECT clause was not recognized.
-
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
"GET_COND_NUMBER_2" "(FORM)"
.
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 SELECT clause was specified in an internal table at runtime.
It contains the field name "VKORG", but this does not occur in any of
the database tables listed in the FROM clause.
‎2008 Feb 10 4:45 PM
Hi ramesh,
the select statement tries to fetch data from a condition table. Condition tables structure is user-defined. That means you can only fetch the fields that arte present in the table.
You may set a breakpoint at the select statement and check the value of wa_tabl at runtime. Then you have to check the structure of the table with wa_tabl's name.
Check with functional guys what is difference in conditions types provided for different sales org.
Regards,
Clemens
‎2008 Feb 10 6:59 AM
Hello,
the dump is saying
"The SELECT clause was specified in an internal table at runtime.
It contains the field name "VKORG", but this does not occur in any of
the database tables listed in the FROM clause".
===> error is in the FROM clause.
===> in the OK test watch the value of the FROM clause wa_tabl and the WHERE clause where_tab.
===> in the KO test watch the value of the FROM clause wa_tabl and the WHERE clause where_tab.
Cordialement,
Chaouki.
‎2008 Feb 10 2:44 PM
Hi,
It seems to be you have an issue in the select statement. For testing purpose change can you do as below :
select single knumh into wa_knumh from (wa_tabl)
where (where_tab) "Instead of dynamic where condition chnage it to normal condition then see it will work properly because it is not identifying the dynamic where condition.
and kappl eq kappl
and kschl eq t_kschl
and datbi ge date
and datab le date.
Thanks,
Sriram Ponna.
‎2008 Feb 10 4:45 PM
Hi ramesh,
the select statement tries to fetch data from a condition table. Condition tables structure is user-defined. That means you can only fetch the fields that arte present in the table.
You may set a breakpoint at the select statement and check the value of wa_tabl at runtime. Then you have to check the structure of the table with wa_tabl's name.
Check with functional guys what is difference in conditions types provided for different sales org.
Regards,
Clemens