‎2009 Nov 12 3:11 PM
Dear all,
My requirement is to make selection from one internal to another internal table.
but i am getting error at the "from internal table" is not a database table or projection table.
Please find select statment
Select salesdoc salesitem sline into it_maxpreview from it_max
for all entries in DATA_PACKAGE
where
salesdoc = DATA_PACKAGE-doc_number
salesitem = DATA_PACKAGE-s_ord_item
sline = DATA_PACKAGE-sched_line.
Error message
E:"IT_MAX" is not defined in the ABAP Dictionary as a table, projection
Declaration.
TYPES: BEGIN OF itab_pdate_max,
salesdoc TYPE /bic/azvfosdp200-doc_number,
salesitem TYPE /bic/azvfosdp200-s_ord_item,
sline TYPE /bic/azvfosdp200-sched_line,
pdate TYPE /bic/azvfosdp200-/bic/zpviewdt,
END OF itab_pdate_max.
DATA : it_pdate_max TYPE STANDARD TABLE OF itab_pdate_max,
wa_pdate_max TYPE itab_pdate_max.
DATA : it_max TYPE STANDARD TABLE OF itab_pdate_max,
wa_max TYPE itab_pdate_max.
Could anyone help on this
Regards
Bala
‎2009 Nov 12 3:13 PM
Hi Bala,
you cannot write a select Query on Internal table.
thanks,
Venkat
‎2009 Nov 12 3:15 PM
Hi,
You should always have data dictionary table or view in the FROM cluase and an internal table in the FOR ALL ENTRIES IN clause. Please use F1 help for more details of the syntax.
Regards,
Nilesh.
‎2009 Nov 12 3:17 PM
Hello Bala,
Source of the select has to be a database table or view. You cannot select data from internal tables.
BR,
Suhas
‎2009 Nov 12 3:18 PM
Hi Bala,
You can READ from an internal table but cant SELECT from an internal table.
Regards
Abhii....
‎2009 Nov 12 3:36 PM
You cannot select from internal table.
Select statement only works with db tables or views
here is what you can do for this statement.
Select salesdoc salesitem sline into it_maxpreview from it_max
for all entries in DATA_PACKAGE
where
salesdoc = DATA_PACKAGE-doc_number
salesitem = DATA_PACKAGE-s_ord_item
sline = DATA_PACKAGE-sched_line.
You can write as
loop at data_package into Work_area_of_data_package (if any)
read table it_max into workarea_of_it_max with key salesdoc = work_area_of_data_package-doc_number
salesitem = work_area_of_data_package-s_ord_item
sline = work_area_of_data_package-sched_line.
write your logic for your selected data
endloop.
‎2009 Nov 12 3:46 PM
Moderator message - It's hard to figure out where to start pointing out what's wrong with this thread - locked