Application Development 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: 

select from intrenal table

Former Member
0 Kudos

hi all

i heard that i can do select from internal table with

select a1

from (itab)

into....

Regards

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You heard wrong, that can not be done, you can only use the SELECT statement against database tables. In your to read an internal table, you must use the LOOP AT syntax or the READ TABLE syntax.

Regards,

Rich Heilman

0 Kudos

o.k. thankes

i wont to buield table in se 11 to insert the data from itab to that i can do that select from there

how i declare it ?

Regards

0 Kudos

Hi,

You can insert data from Internal to Z table.

Declare the internal with fields of Z table.

Get the tables from related tables. And use insert statement to insert data into z table.

Thanks,

Sriram Ponna.

0 Kudos

Are you asking how to build a table in SE11? or are you asking how to declare the internal table which could insert data into the "Z" database table?

If the latter, you can simply declare it like this.

data: itab type table of ztab.
data: wa like line of itab.

wa-fld1 = 'ABC'.
wa-fld2 = 'DEF'.
append wa to itab.

wa-fld1 = 'GHI'.
wa-fld2 = 'JKL'.
append wa to itab.

* Now insert into the database table.
insert ztab from table itab.

Regards,

RIch Heilman

0 Kudos

hi

i ask how to buield table in se11 that i can do insert from itab to it.

size and class

Regards

0 Kudos

Hi antonio rodrigo,

use INSERT, follow a example:

INSERT INTO (TABLE) VALUES (INTERNAL TABLE).

IF SY-SUBRC = 0.

*Message if OK.

MESSAGE I398(00) WITH 'OK'.

ELSE.

*Message if error.

MESSAGE e398(00) WITH 'Error'.

ENDIF.

You can add too using the transation 'SM30'.

You need to create a "Table Maintanance Generator" at Menu "Utilities" into Maintance Table('SE11').

Regards,

Allan Cristian

Message was edited by:

Allan Cristian

abapdeveloper20
Contributor
0 Kudos

Hi..

1 . Create a table(for Eg : ZQCWHSTOCK) in SE11.

2. In your program

DATA : STOCKINT TYPE STANDARD TABLE OF ZQCWHSTOCK

INITIAL SIZE 0 WITH HEADER LINE.

SELECT * FROM ZQCWHSTOCK INTO CORRESPONDING FIELDS OF TABLE STOCKINT.

INSERT ZQCWHSTOCK FROM TABLE STOCKINT.

Regards,

Lakshmiraj

Reward points if helpful