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

pls help on oops

Former Member
0 Likes
1,301

hi every body

i had declared the internal table as

DATA: k_oib TYPE table of roib_def_index_gm.

DATA:k_oib TYPE table of oib_defaults_display.

***and selected like this

SELECT single * FROM oib_def_index_gm

INTO table k_oib

WHERE matnr = l_material

AND werks = i_plant

AND lgort = '0001'.

      • and used read

read table k_oib index 1.

i am error in select statement that table is not defined and it giving error in read table also it is not working.

pls give solutions.

11 REPLIES 11
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,266

Hi,

I think ur data declaration is not correct .

Check for roib_def_index_gm , it doesnt look like a table.

Read only

Former Member
0 Likes
1,266

Where have you declared the tables and where is the select? Are they both in the same class?

Read only

0 Likes
1,266

yes they in same class and same method

Read only

0 Likes
1,266

roib_def_index_gm is a structure

Read only

Former Member
0 Likes
1,266

Hi ,

You have declared table k_oib twice and u require a workarea for readig internal table

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,266

Hi,

You are selecting from oib_def_index_gm table but declaration on

DATA: k_oib TYPE table of roib_def_index_gm.

DATA:k_oib TYPE table of oib_defaults_display.

Replace the lines by

DATA: k_oib TYPE table of oib_def_index_gm .

Before that check oib_def_index_gm is existing in dictionary.

Read only

0 Likes
1,266

oib_def_index_gm is tranperant table

Read only

Former Member
0 Likes
1,266

first check if table oib_def_index_gm. exists in dictionary as i m not able to find this table and if it exists then write follwoing code -

DATA: k_oib TYPE table of oib_def_index_gm.

***and selected like this

SELECT single * FROM oib_def_index_gm

INTO table k_oib

WHERE matnr = l_material

AND werks = i_plant

AND lgort = '0001'.

      • and used read

read table k_oib index 1.

Read only

0 Likes
1,266

all tables exits in db.

it giving an error as

read dbtab is not supported in oo context

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,266

Hi,

Just copy paste this code and comment the previous code and check whether it is working.

<b>DATA: k_oib TYPE table of oib_def_index_gm ,

w_oib type oib_def_index_gm .</b>

SELECT single * FROM oib_def_index_gm

INTO table k_oib

WHERE matnr = l_material

AND werks = i_plant

AND lgort = '0001'.

      • and used read

read table k_oib <b>into w_oib</b> index 1.

Read only

Former Member
0 Likes
1,266

Hi,

Try declaring a workarea:

data: wa_oib type roib_def_index_gm.

Then try using the read statement as:

read table k_oib into wa_oib index 1.

Regards,

Kalpana