Application Development 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: 

Inner join

Former Member
0 Kudos

hello experts,

I have to retrieve the data for the fields

SELECT EKPOEBELN EKPOEBELP EKPOMENGE EKPOMEINS EKPOMATNR EKPOIDNLF MAKT~MAKTX

EKETMENGE EKETWEMNG MARD~LGORT into table iekpo from ekpo inner join.....................................FOR ALL ENTRIES IN iekko.

Plz any one help me to complete this select statement...

SIRI

12 REPLIES 12

Former Member
0 Kudos

Hello Sri,


SELECT EKPO~EBELN EKPO~EBELP EKPO~MENGE EKPO~MEINS EKPO~MATNR EKPO~IDNLF MAKT~MAKTX 
EKET~MENGE EKET~WEMNG MARD~LGORT into table iekpo from ekpo inner join EKET on EKPO~EBELN eq EKET~EBELN
                    EKPO~EBELP eq EKET~EBELP
                   FOR ALL ENTRIES IN iekko
                   where EKPO~EBELN eq IEKKO-EBELP. 

Regards,

Vasanth

Former Member
0 Kudos

SELECT EKPOEBELN EKPOEBELP EKPOMENGE EKPOMEINS EKPOMATNR EKPOIDNLF MAKTMAKTX EKETMENGE EKETWEMNG MARDLGORT

INTO TABLE iekpo

From EKPO INNER JOIN EKET

ON EKPO-EBELN = EKET-EBLEN AND EKPO-EBEL = EKET-EBELN

INNER JOIN MARD

ON MARD-MATNR = EKPO-MATNR AND MARD-LGORT = EKPO-LGORT AND MARD-WERKS = EKPO-WERKS

FOR ALL ENTRIES IN iekko

WHERE EKPO-EBELN = iekpo-ebeln.

Former Member
0 Kudos

hi,

SELECT EKPOEBELN EKPOEBELP EKPOMENGE EKPOMEINS EKPOMATNR EKPOIDNLF

EKETMENGE EKETWEMNG

MAKT~MAKTX

MARDLGORT into table iekpo from ekpo inner join. eket on ekpoebeln = eketebeln and ekpoebelp = eket~ebelp join makt on

ekpomatnr = maktmatnr join mard

on ekpomatnr = mardmatnr and

ekpowerks = mardwerks and

ekpolgort = mardlgort

FOR ALL ENTRIES IN iekko.

where

give all conditions

finally write makt~spras = sy-langu.

Regards,

Anji

0 Kudos

Hi anji reddy,

can complete your code with the for all entries becz i am getting the error

Former Member
0 Kudos

hi,

do this way..


SELECT EKPO~EBELN 
              EKPO~EBELP 
              EKPO~MENGE 
              EKPO~MEINS
              EKPO~MATNR 
              EKPO~IDNLF
              MAKT~MAKTX
              EKET~MENGE 
              EKET~WEMNG 
              MARD~LGORT 
              into table iekpo from ekpo as ekpo
                inner join makt as makt
                on < Conditions>
                innerjoin eket as eket
                on < Conditons >
                innerjoin mard as mard
                on < Conditions >
               FOR ALL ENTRIES IN iekko
               where <Conditions >.

but it is always better to avoid joins and use for all entries in this way ..

if not iekko[]  is  initial.
  select * from ekpo into table iekpo
for all enries in 
endif.

if not iekpo[] is intial.
select * from makt into table imakt ..
for all enries in 
endif.


if not imakt[] is intial.
select * from eket into table ieket ..
for all enries in 
endif.


if not ieket[] is intial.
select * from mard into table imakt ..
for all enries in 
endif.

Regards,

Santosh

0 Kudos

Ya everything is fine

but after the for all entries can any one tell me the correct where condition because when i put the where condition it is giving error to me

in the selection screen i am having the fields ekpo-matnr, eket-eindt.

thanks alot for your anticipation and valuable time...

SIRI

Former Member
0 Kudos

can anyone help me plz...

0 Kudos

Try this......

SELECT EKPOEBELN EKPOEBELP EKPOMENGE EKPOMEINS EKPOMATNR EKPOIDNLF

EKETMENGE EKETWEMNG

MAKT~MAKTX

MARD~LGORT into table iekpo from ekpo inner join

eket on ekpoebeln = eketebeln and

ekpoebelp = eketebelp join makt on

ekpomatnr = maktmatnr join mard

on ekpomatnr = mardmatnr and

ekpowerks = mardwerks and

ekpolgort = mardlgort

FOR ALL ENTRIES IN iekko

where EKPO~MATNR eq ekpo-matnr

and EKET~eindt eq eket-eindt.

0 Kudos

chandra

I am using selection screen with select options how to give those options in the where clause of this select statement

0 Kudos

hiii sri..

Try this..

SELECT EKPO~EBELN

EKPO~EBELP

EKPO~MENGE

EKPO~MEINS

EKPO~MATNR

EKPO~IDNLF

MAKT~MAKTX

EKET~MENGE

EKET~WEMNG

MARD~LGORT

into table iekpo from ekpo as ekpo

inner join makt as makt

on < Conditions>

innerjoin eket as eket

on < Conditons >

innerjoin mard as mard

on < Conditions >

FOR ALL ENTRIES IN iekko

where ekko~vbeln eq iekko-vbeln

and ekpo-matnr eq p_para1

and eket-eindt eq p_para2. ( p_Para1, p_para2 are the selection screen field's names )

select ...

....

for all enries in ietab

where <field> eq ietab-<field>

and ....~... eq p_para1

and ....~... eq p_para2.

When u use for all entries... u have to put a condition in where clause on the table which u have used in for all entries .. otherwise it will give u an error...

reward if it helps u..

sai ramesh

Former Member
0 Kudos

hi sri,

if u r using a select options try to give <b>in</b> instead of eq in the where condition.

where EKPO~MATNR <b>IN</b> ekpo-matnr

and EKET~eindt <b>IN</b> eket-eindt.

Regards...

Arun.

Former Member
0 Kudos

Hi!

whenever we use SELECT-OPTIONS, we have to use IN instead of EQ in WHERE clause.

Regards,

Neha Bansal