2007 Mar 13 3:09 PM
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
2007 Mar 13 3:13 PM
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
2007 Mar 13 3:15 PM
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.
2007 Mar 13 3:15 PM
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
2007 Mar 13 4:18 PM
Hi anji reddy,
can complete your code with the for all entries becz i am getting the error
2007 Mar 13 3:17 PM
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
2007 Mar 13 3:47 PM
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
2007 Mar 13 5:06 PM
2007 Mar 13 5:18 PM
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.
2007 Mar 13 6:46 PM
chandra
I am using selection screen with select options how to give those options in the where clause of this select statement
2007 Mar 14 5:26 AM
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
2007 Mar 13 6:56 PM
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.
2007 Mar 14 5:18 AM
Hi!
whenever we use SELECT-OPTIONS, we have to use IN instead of EQ in WHERE clause.
Regards,
Neha Bansal