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

Join statement

Former Member
0 Likes
1,084

Hi All ,

Is there any join statement like that retrives 'ALL THE DATA' from different table other than using select * statemnts...

thxs,

vin.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,052

Hi V,

To retrieve all the fields from Table(s) you just would have to write SELECT * from a instead of SELECT a~perner.

Join is just used to related two or more tables in question.

Hopefully this is the thing you were looking for.

Regards.

10 REPLIES 10
Read only

Former Member
0 Likes
1,052

JOIN statement is used only in conjunction with select statements. There is no JOIN statement without select statement.

What is your actual requirement?

here is a smaple usage for join:

<i><b>DATA: DATE LIKE SFLIGHT-FLDATE,

CARRID LIKE SFLIGHT-CARRID,

CONNID LIKE SFLIGHT-CONNID.

SELECT FCARRID FCONNID F~FLDATE

INTO (CARRID, CONNID, DATE)

FROM SFLIGHT AS F INNER JOIN SPFLI AS P

ON FCARRID = PCARRID AND

FCONNID = PCONNID

WHERE P~CITYFROM = 'FRANKFURT'

AND P~CITYTO = 'NEW YORK'

AND F~FLDATE BETWEEN '20010910' AND '20010920'

AND FSEATSOCC < FSEATSMAX.

WRITE: / DATE, CARRID, CONNID.

ENDSELECT.</b></i>

Read only

0 Likes
1,052

Hi Ravi ,

Usually join statments r like this avbeln bkunnr c~matnr which retrives data for tht particular fields from the table a , b , c but my requirment is to retrive all the feilds present in table a , b , c using join statemetns...

thxs,

vin

Read only

Former Member
0 Likes
1,052

Hi Vind,

Can you please elaborate your problem statement. Join is nothing to do with the col/fields, it works on record basis. For fields either you have to mention field names or you fetch all fields of the given table(s) using '*'.

Please make me clear if I'm getting you wrong.

Regards.

Shabbar

Read only

Former Member
0 Likes
1,052

Hi,

You can use field-groups to get data from diffrent

tables instead of join

field-group: header,items

insert mara-matnr into header.

insert makt-maktx into item .

extract item.

loop.

write:mara-matnr,mara-maktx.

endloop.

Regards

amole

Read only

Former Member
0 Likes
1,052

Join can only be used in conjunction with select statement but the other ways of retriving data from database tables is using LDBs

Regards

Anurag

Read only

Former Member
0 Likes
1,053

Hi V,

To retrieve all the fields from Table(s) you just would have to write SELECT * from a instead of SELECT a~perner.

Join is just used to related two or more tables in question.

Hopefully this is the thing you were looking for.

Regards.

Read only

0 Likes
1,052

hi,

If you want to select all the fields from some table, then use * instead of individual fields. Join is used to relate table based on some fields.

Regards,

Richa

Read only

0 Likes
1,052

Hi richa,

How to join the two r more differnt tables with all fields to display in an ALV and how to deifne the two r more tables is it ?? to pass the table to ALV..

DATA : BEGIN OF ITAB OCCURS 0.

INCLUDE STRUCTURE MARA.

INCLUDE STRUCTURE VBAK.

DATA : END OF ITAB.

THXS,

vin.

Read only

Former Member
0 Likes
1,052

I think u have go for FOR ALL ENTRIES in your select statemant.

Cheers

Badri

Read only

Former Member
0 Likes
1,052

Hi,

One option you can use is native sql

Exec sql.

select a.* b.* c.* ....

endexec.

Regards

Amole