Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

selection in internal table

Former Member
0 Likes
848

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

6 REPLIES 6
Read only

Former Member
0 Likes
799

Hi Bala,

you cannot write a select Query on Internal table.

thanks,

Venkat

Read only

Former Member
0 Likes
799

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.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
799

Hello Bala,

Source of the select has to be a database table or view. You cannot select data from internal tables.

BR,

Suhas

Read only

Former Member
0 Likes
799

Hi Bala,

You can READ from an internal table but cant SELECT from an internal table.

Regards

Abhii....

Read only

former_member191735
Active Contributor
0 Likes
799

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.

Read only

Former Member
0 Likes
799

Moderator message - It's hard to figure out where to start pointing out what's wrong with this thread - locked