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: 

how to retrive data for different data types

Former Member
0 Kudos

Hi

I want retrive data 2 tables using forall entries. and tables are EQUI and AUSP.

EQUI table primary key is EQUNR

here EQUNR is equal to AUSP table OBJEK

My problem is here EQUNR and OBJEK have different data type length.

Please tell me how to retrive data using for all entries.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

try like this.

It is working.

data : itab1 type STANDARD TABLE OF equi,

itab2 type STANDARD TABLE OF ausp,

wa_itab1 type equi.

data : v_objek type ausp-objek.

data : begin of itab3 occurs 0,

objek type ausp-objek,

end of itab3.

select * from equi into table itab1 up to 100 rows.

loop at itab1 into wa_itab1.

v_objek = wa_itab1-equnr.

append v_objek to itab3.

endloop.

select * from ausp into table itab2 for all entries in itab3 where

objek = itab3-objek.

Regards

Sandeep Reddy

6 REPLIES 6

Former Member
0 Kudos

Hi,

It is having same or not. the data type is same char but the length only the difference

I think it won't be a problem, If you are sure both are having same data, you use for all entries.

Regards

Ganesh

0 Kudos

Hi

Thanks for your Quick reply.

It is having same data. EQUNR and OBJNR are Char type only. But lenght different.EQUNR-18, OBJEK-50.

Here I am retriving data first EQUNR values

Next using forall entries i'm retriving data OBJEK

How to retrive ?

0 Kudos

If you are retrieving only some field from the database table into ans internal table, you might have declared the fields in the internal table. In the data declaration define both the fields as Char 50

Former Member
0 Kudos

Hi,

try like this.

It is working.

data : itab1 type STANDARD TABLE OF equi,

itab2 type STANDARD TABLE OF ausp,

wa_itab1 type equi.

data : v_objek type ausp-objek.

data : begin of itab3 occurs 0,

objek type ausp-objek,

end of itab3.

select * from equi into table itab1 up to 100 rows.

loop at itab1 into wa_itab1.

v_objek = wa_itab1-equnr.

append v_objek to itab3.

endloop.

select * from ausp into table itab2 for all entries in itab3 where

objek = itab3-objek.

Regards

Sandeep Reddy

0 Kudos

Hi

I tried this method, but i didn't get output.

Please can u tell me is there any other process.

0 Kudos

Hi,

what is your porblem I could't get you want code.

see Eg: using for all entries.

If you have already created 2 internal tables. using with that tables.

step1: select * from <DB tablename>

into table <Internal table Name>

where <field> = <condtion>

step2: select * from <DB tablename>

into table <Internal table Name>

for all entriesn in <1st internal table>

where <field> = <1st internaltable-field>.

select * from mara

into table it_mara

were matnr = p_matnr.

select * from makt

into table it_makt

for all entries in it_mara

where matnr = it_mara-matnr.

Regards

Ganesh