‎2007 Sep 29 2:50 PM
Hi all,
I need to join two database tables adrc and BUT020 and to display empty fields (e.g. house_num1) in ADRC by partner, rather than addrnumber. If an inner join is appropriate, how do I define it? Are there other ways.
‎2007 Sep 29 2:53 PM
‎2007 Sep 29 3:05 PM
Hi Darlighgton,
You have to use FOR ALL ENTRIES.
The other way is using join statement.
Thanks
Vkranth Khimavath
‎2007 Oct 01 9:03 AM
Thanks a lot. Now here is a piece of code I wrote for the select statement.
SELECT house_num1 city1 street
FROM adrc
INTO TABLE jtab
FOR ALL ENTRIES IN it_but020
WHERE addrnumber = it_but020-addrnumber.
jtab is an internal table of type adrc and but020 is an internal table of type but020. There is no partner field in adrc, so i would like to display empty records for house_num1 for example, how then do i fit it in?
‎2007 Oct 01 9:05 AM
Thanks a lot. Now here is a piece of code I wrote for the select statement.
SELECT house_num1 city1 street
FROM adrc
INTO TABLE jtab
FOR ALL ENTRIES IN it_but020
WHERE addrnumber = it_but020-addrnumber.
jtab is an internal table of type adrc and but020 is an internal table of type but020. There is no partner field in adrc, so i would like to display empty records for house_num1 by PARTNER for example, how then do i fit it in?
‎2007 Oct 01 10:41 AM
If I'm to use inner join ,would it be correct to do the following if I'm to display empty fields of house_num1 by PARTNER:
DATA: BEGIN OF address,
partner TYPE but020-partner,
addrnumber TYPE adrc-addrnumber,
street TYPE adrc-street,
house_num1 TYPE adrc-house_num1,
city1 TYPE adrc-city1,
END OF address,
jtab LIKE STANDARD TABLE OF address WITH HEADER LINE.
SELECT but020partner adrcaddrnumber adrc~house_num1
INTO TABLE jtab
FROM but020
INNER JOIN adrc
ON but020addrnumber = adrcaddrnumber
where adrc~house_num1 = space.
if sy-dbcnt = 0.
uline.
write:/ 'There are no empty entries in the field: Address'.
uline.
else.
uline.
WRITE: / 'The Field: Address, has',SY-DBCNT,'empty fields for the following Business Partner entries:'.
uline.
LOOP AT jtab INTO address.
WRITE: / address-PARTNER.
ENDLOOP.
endif.
‎2007 Oct 01 10:47 AM
Hi ..
Yes .. you can do this if you want to get the records where House_num is BLANK.
<b>reward if Helpful.</b>
‎2007 Oct 01 3:01 PM
But it's not working as it should. It's extracting something totally different from what I expect.
‎2007 Oct 02 3:17 PM