2020 May 07 2:29 PM
LOOP AT it_tab INTO wa_tab.
v_var = wa_tab-tablename.
SELECT COUNT(*) FROM (v_var) INTO count.
WRITE:/ count.
CLEAR v_var.
while counting records in SAP tables i am getting dump like this. please provide an solution for this.
Error analysis
An exception has occurred which is explained in more detail below. The
exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SEMANTICS' was not
caught and
therefore caused a runtime error. The reason for the exception is:
The current ABAP program attempted to execute an Open SQL statement
containing a dynamic entry. The parser returned the following error: ""ERUN"
is not defined in the ABAP Dictionary as a table, projection view, or
database view."
2020 May 07 2:40 PM
Hello swathi8
At one of the loop passes v_var variable gets value of ERUN. That's not an ABAP Dictionary table, projection view or database view i.e. a ABAP dictionary object that you can read data from. Hence short dump in the SELECT statement.
As you have explained how you fill it_tab internal table, I can't help you more.
Best regards
Dominik Tylczynski
2020 May 07 2:54 PM
Hi
3a9e4ce873a94034b33dc62b0ce600ee mentioned dump is because trying to execute select query with non Dictionary table if you want to filter your it_tab with only tables then you can filter that by passing them to table dd02l where the type is TRANSP.
Thanks and regrads,
Prasanna CD.
2020 May 07 3:17 PM
Dear Swati,
I assume you are getting list of tables in your internal table it_tab.
In the loop before executing the count, please make the following check.
LOOP AT it_tab INTO wa_tab.
v_var = wa_tab-tablename.
select single tabclass from DD03VT into v_tabclass WHERE TABNAME = (v_var).
IF v_tabclass = 'TRANSP'
SELECT COUNT(*) FROM (v_var) INTO count.
WRITE:/ count.
ENDIF.
CLEAR v_var.
The reason you get dump, (as explained by Dominik and Prasanna - the object is not a table or view or any projections. It appears to be a structure and hence the dump.
This check above executes only when your object is of table type.
Please update your result.
Regards,
Venkat
2020 May 07 6:25 PM
2020 May 07 7:30 PM
I believe the answers solves your problem?
If this answer has solved your problem, accept the answer and close the thread.
This will help other who search for the same solutions.
Regards,
Venkat
2020 May 07 3:23 PM
Why don't you use the standard SAP program which already does that? (search the forum to find out its name, or even the SAP notes; I hope it doesn't short dump because I think there will be no official support).
2020 May 07 7:30 PM
I believe the answers solves your problem?
If this answer has solved your problem, accept the answer and close the thread.
This will help other who search for the same solutions.
Regards,
Venkat
2020 May 13 4:15 PM
I believe you got the answers solves your problem? If this answer has solved your problem, accept the answer and close the thread.
Please follow up comment if the problem is still not resolved.
Closing the thread with solution - will help other who search for the same solutions.