‎2006 Mar 20 4:25 PM
Can anybody give me a sample code for the following :
I have to get the address from the following logic using joins:
To get the address number select single ADRNR from TVST into TVST where VSTEL=LIKP-VSTEL.
Then ADDR1_DATA-ADRNR=TVST-ADRNR to get the address number and then the address details .
addr_data-name1 etc..
Please advise.
Regards
Pavan
‎2006 Mar 20 5:06 PM
Hi Pavan,
if you want to select on TVST and ADRC at the same time using joins, your select statement should look something like this:
select TVSTVSTEL TVSTADRNR ADRCNAME1 ADRCNAME2 (...)
into corresponding fields of workarea
from TVST inner join ADRC on
( TVSTADRNR eq ADRCADDRNUMBER )
where TVST~VSTEL eq ...
'Inner join' will only select records with matching entries in both tables, whereas 'left join' will select data from TVST also, if no match can be found in ADRC.
Hope this helps, kind regards, Kathrin!
‎2006 Mar 20 4:36 PM
Hi Kumar,
Have you looked at this FM?
<b>ST_LOCATION_ADDR_GET</b>
Hope this will help.
Regards,
Ferry Lianto
‎2006 Mar 20 4:41 PM
Hi Pavan,
Access table ADRC for the details...
Put the below in where condition.
<b> SELECT * FROM ADRC INTO IT_ADRC
WHERE ADRC-ADDRNUMBER = TVST-ADRNR.</b>
‎2006 Mar 20 4:41 PM
once u get ADRNR, put that as ADDRNUMBER in ADRC table n get the address.
Hope it helps,
Regards,
Bikash
‎2006 Mar 20 5:06 PM
Hi Pavan,
if you want to select on TVST and ADRC at the same time using joins, your select statement should look something like this:
select TVSTVSTEL TVSTADRNR ADRCNAME1 ADRCNAME2 (...)
into corresponding fields of workarea
from TVST inner join ADRC on
( TVSTADRNR eq ADRCADDRNUMBER )
where TVST~VSTEL eq ...
'Inner join' will only select records with matching entries in both tables, whereas 'left join' will select data from TVST also, if no match can be found in ADRC.
Hope this helps, kind regards, Kathrin!