05-19-2008 5:52 PM
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.
05-19-2008 6:45 PM
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
05-19-2008 5:58 PM
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
05-19-2008 6:47 PM
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 ?
05-19-2008 6:53 PM
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
05-19-2008 6:45 PM
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
05-19-2008 7:59 PM
Hi
I tried this method, but i didn't get output.
Please can u tell me is there any other process.
05-19-2008 8:13 PM
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