‎2007 Jan 25 9:27 PM
Hi ,
I have an issue with an ABAP load program that uploads a spreadsheet and calls a function module to update prices via IDoc. This program is a generic load program to maintain SD and MM pricing. The issue is that the user is getting a short dump with the
error <b>'SAPSQL_INVALID_FIELDNAME</b>'.
And the <i>error analysis says:</i>
SELECT clause was specified in an internal table at runtime. It contains the fieldname "ZZJ_3AGEND", but this doesn't occur in any of the database tables listed in the FROM clause.
It says the error is in the lines:
FORM edit_other USING p_key.
DATA count_rows TYPE i.
IF NOT itab_dd03l-checktable IS INITIAL.
CLEAR where_tab.
REFRESH where_tab.
CONCATENATE itab_dd03l-fieldname ' = ''' p_key ''''
INTO where_tab
.
APPEND where_tab.
-
> SELECT COUNT( * )
INTO count_rows
FROM (itab_dd03l-checktable)
WHERE (where_tab). { Error is Here}
Here where_tab is an internal table which is filled up at runtime. And select statement is in error.
How to rectify it??
Please help and advise.
Thanks,
Das.
‎2007 Jan 25 10:41 PM
Hi,
Execute the program again..After it goes to short dump..Press the debugging screen..it will stop at the SQL select
-
> SELECT COUNT( * )
INTO count_rows
FROM (itab_dd03l-checktable)
WHERE (where_tab).
Now in the debugging..check what is the value in the variable ITAB_DD03L-checktable..
Take that value ..and go to se11 and give that value..Check in the table if the corresponding field ZZ_J3AGEND is available or not..
Thanks,
Naren
‎2007 Jan 25 9:43 PM
I think the below code is trying to find out no. of rows for given condition. Here, may be you can use
DESCRIBE TABLE <tablename> LINES <lines>.
DATA: LV_LINES TYPE I.
DATA: BEGIN OF IT_FIELDNAME OCCURS 0,
FIELDNAME TYPE FIELDNAME,
END OF IT_FIELDNAME.
SELECT <FIELDNAME>
INTO (IT_FIELDNAME)
FROM (itab_dd03l-checktable)
WHERE (where_tab). { Error is Here}
DESCRIBE TABLE IT_FIELDNAME LINES LV_LINES.
Thanks,
Santosh
‎2007 Jan 25 10:04 PM
Hi,
Thank you for reply. But the problem here is with the 'WHERE' condition. the where_tab has a entry or a condition with a particular field. And this field is not in itab_dd03l-checktable.
Please advise.
Thanks,
Das
‎2007 Jan 25 10:41 PM
Hi,
Execute the program again..After it goes to short dump..Press the debugging screen..it will stop at the SQL select
-
> SELECT COUNT( * )
INTO count_rows
FROM (itab_dd03l-checktable)
WHERE (where_tab).
Now in the debugging..check what is the value in the variable ITAB_DD03L-checktable..
Take that value ..and go to se11 and give that value..Check in the table if the corresponding field ZZ_J3AGEND is available or not..
Thanks,
Naren
‎2007 Jan 26 1:32 AM
Hi Naren,
Thanks. I looked at it. The table has no field ZZ_J3AGEND in it. So what should i do now?
Please suggest.
Thanks,
Das.
‎2007 Jan 26 1:45 AM
In that case you need to check if the table name getting stored in "itab_dd03l-checktable" is a correct table or not.
I mean, is that the table which has this field name or not.
Thanks,
Santosh