‎2006 Dec 15 1:51 PM
Hi ,
I want to read the database table VBEP. for that i wrote following lines.
READ TABLE vbep WITH KEY vbeln = vbap-vbeln
posnr = vbap-posnr
etenr = '0001'.
But it showing error that '" vbeln is not present ". Please tell me how to read db table.
‎2006 Dec 15 1:52 PM
Hi
U cant use READ stmt for database table read.Its for internal tables only.
Use SELECT stmt for database table read.
Ex:
select * from vbap into corresponding fields of table itab where...
select * from vbep into into corresponding fields of table itab1 where...
loop at itab1.
READ TABLE itab WITH KEY vbeln = itab1-vbeln
posnr = vbap-posnr
etenr = '0001'.
if sy-subrc = 0.
code here.
endif.
endloop.
Regs
Manas
‎2006 Dec 15 1:52 PM
Hi
U cant use READ stmt for database table read.Its for internal tables only.
Use SELECT stmt for database table read.
Ex:
select * from vbap into corresponding fields of table itab where...
select * from vbep into into corresponding fields of table itab1 where...
loop at itab1.
READ TABLE itab WITH KEY vbeln = itab1-vbeln
posnr = vbap-posnr
etenr = '0001'.
if sy-subrc = 0.
code here.
endif.
endloop.
Regs
Manas
‎2006 Dec 15 1:52 PM
Hi,
You can't read DB table. You need to select
Select single * from VBEP
into wa_vbep
where vbeln = vbap-vbeln
posnr = vbap-posnr
etenr = '0001'.
Reward points if this Helps.
Manish
‎2006 Dec 15 1:53 PM
You cannot use READ table for database table
select all the data to internal table and use read
‎2006 Dec 15 1:53 PM
Hey,
if u r trying to read from a database table, its completely wrong..!
U need to select records from the table into an internal table & then read.
‎2006 Dec 15 1:55 PM
Hello,
Reading the Database table is Obsolete now.
Instead use select to read the data from VBEP.
DO like this.
Select * from VBAP into itab where ....
If not itab[] is intiial.
select * from VBEP into table Itab1 for all entries in itab
where vbeln = itab-vbeln
posnr = itab-posnr
etenr = '0001'.
If useful reward.
Vasanth
endif.
‎2006 Dec 15 2:01 PM
Hi shweta
the READ statement is used at internal table level only.
Plz use SELECT * / SELECT DISTINCT / SELECT <field1> ...<FIELDn> ..
statement to read data from the Dbase tables.
Regards
Pankaj