on 10-19-2005 4:30 PM
Hi ,
I,m trying to create an internal table from 5 databse tables namely
PA0001-PERNR, PA0002-NACHN, VORNA, PA0009-BANKN, PA0002-PERID, PA0000-STAT2, PA0006-STRAS,PSTLZ,LAND1 (when the PA0006-SUBTY is 1)
Condition for this is that this internal table should contain all the records that are present in the PPOIX table for which I wrote the following code
SELECT * FROM PPOIX
INTO wa_ppoix.
APPEND wa_ppoix TO it_ppoix.
ENDSELECT.
DELETE ADJACENT DUPLICATES FROM it_ppoix comparing PERNR.
Now I want to build a internal table for all the unique values fetched in it_ppoix
my structure looks as below
BEGIN OF rere_KuLe,
reId type PA0001-PERNR,
reTy(1) type c,
reNav1 type PA0002-NACHN,
reNav2 type PA0002-VORNA,
bnkAcNo type PA0009-BANKN,
enhNr type PA0002-PERID,
status type PA0000-STAT2,
crCn(20) type c,
add1 type PA0006-STRAS,
add2 type PA0006-PSTLZ,
add3 type PA0006-LAND1,
date(8) type c,
date1(8) type c,
END OF rere_KuLe.
can someone please help on the same or give me an general approach on achieving the same.
Thanks for your help in advance.
Thanks,
Advait.
You will need to loop at your IT_PPOIX and do some select statements against each table.
Here is an example of selecting against one of your tables, PA0002.
LOOP at IT_PPOIX.
select Single nachn vorna into corresponding fields of iT_PPOIX
from pa0002
where pernr = IT_PPOIX-pernr.
modify IT_PPOIX.
ENDLOOP.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok, then all you need to do is move the fields to the new internal table and this time APPEND it.
data: xpa0002 type pa0002.
LOOP at IT_PPOIX.
select Single nachn vorna
into corresponding fields of xpa0002
from pa0002
where pernr = IT_PPOIX-pernr.
move-corresponding xpa0002 to new_itab.
append new_itab.
ENDLOOP.
Regards,
Rich Heilman
Thanks, that solved my problem, I'm trying to reward points but says error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But the final Itab I want to populate is rere_KuLe and not it_ppoix. Any suggesstions
Thanks
Advait.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.