Application Development and Automation 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: 
Read only

Sample code

Former Member
0 Likes
793

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
740

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!

4 REPLIES 4
Read only

ferry_lianto
Active Contributor
0 Likes
740

Hi Kumar,

Have you looked at this FM?

<b>ST_LOCATION_ADDR_GET</b>

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
740

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>

Read only

Former Member
0 Likes
740

once u get ADRNR, put that as ADDRNUMBER in ADRC table n get the address.

Hope it helps,

Regards,

Bikash

Read only

Former Member
0 Likes
741

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!