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

classical report

Former Member
0 Likes
864

Hi guru's,

here iam trying to write some code for the following requirement,but at select statement i want to use innerjoin how can i? and wat will happen if i'll use this corresponding .is there any chance to write a select statement as nested select if possible how pls help me . full points.urgent

if usefull full points.to all

thanx regards

lokanadhan

Req: by using classical report

-


vendor from -


to -


-


output:-

-


vno p.o itemno material

-


-


tables : lfa1,ekko,ekpo,mara.

parameters : vendor like lfa1-lifnr.

data : begin of itab occurs 0,

lifnr like lfa1-lifnr,

ebeln like ekko-ebeln,

ebelp like ekpo-ebelp,

matnr like mara-matnr,

end of itab.

select lfa1lifnr ekkoebeln ekpoebelp maramatnr

into corresponding fields of table itab

from lfa1 join ekko on lfa1lifnr = ekkolifnr

join ekpo on ekkoebeln = ekpoebeln

join matnr on ekpomatnr = maramatnr.

loop at itab.

write : / itab-lifnr ,itab-ebeln,itab-ebelp,itab-matnr.

endloop.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
835

HI..,

No need to use the CORRESPONDING FIELDS OF here..

Nested SELECTS and INTO CORRESPONDING FIELDS degrades the performance..

just check this..

tables : lfa1,ekko,ekpo,mara.

parameters : vendor like lfa1-lifnr.

data : begin of itab occurs 0,

lifnr like lfa1-lifnr,

ebeln like ekko-ebeln,

ebelp like ekpo-ebelp,

matnr like mara-matnr,

end of itab.

select lfa1lifnr ekkoebeln ekpoebelp maramatnr

into table itab

from lfa1

inner join ekko on lfa1lifnr = ekkolifnr

inner join ekpo on ekkoebeln = ekpoebeln

inner join mara on ekpomatnr = maramatnr

where lfa1~lifnr eq vendor.

loop at itab.

write : / itab-lifnr ,itab-ebeln,itab-ebelp,itab-matnr.

endloop.

regards,

sai ramesh

6 REPLIES 6
Read only

Former Member
0 Likes
836

HI..,

No need to use the CORRESPONDING FIELDS OF here..

Nested SELECTS and INTO CORRESPONDING FIELDS degrades the performance..

just check this..

tables : lfa1,ekko,ekpo,mara.

parameters : vendor like lfa1-lifnr.

data : begin of itab occurs 0,

lifnr like lfa1-lifnr,

ebeln like ekko-ebeln,

ebelp like ekpo-ebelp,

matnr like mara-matnr,

end of itab.

select lfa1lifnr ekkoebeln ekpoebelp maramatnr

into table itab

from lfa1

inner join ekko on lfa1lifnr = ekkolifnr

inner join ekpo on ekkoebeln = ekpoebeln

inner join mara on ekpomatnr = maramatnr

where lfa1~lifnr eq vendor.

loop at itab.

write : / itab-lifnr ,itab-ebeln,itab-ebelp,itab-matnr.

endloop.

regards,

sai ramesh

Read only

0 Likes
835

hi ramesh,

for the same code i need an nested select statement.how can i write tht...,is there any chance to go with for all entries.if possible how?

thanx

yogi

Read only

0 Likes
835

hi ramesh,

is there any difference b/w inner join and join.

thanx

yogi

Read only

Former Member
0 Likes
835

Hi,

use the inner join statemnet only.its better to use join statement compared to nested selection statements.this is the efficient way in performance wise.

select lfa1lifnr ekkoebeln ekpoebelp maramatnr

into corresponding fields of table itab

from lfa1 inner join ekko on lfa1lifnr = ekkolifnr

inner join ekpo on ekkoebeln = ekpoebeln

inner join mara on ekpomatnr = maramatnr.

rgds,

bharat.

Read only

Former Member
0 Likes
835

HI..

Just paste this code...<b>which is modified..</b>

select-options:

vendor for lfa1-lifnr.

data : begin of itab occurs 0,

lifnr like lfa1-lifnr,

ebeln like ekko-ebeln,

ebelp like ekpo-ebelp,

matnr like mara-matnr,

end of itab.

select lfa1lifnr ekkoebeln ekpoebelp maramatnr

into corresponding fields of table itab

from lfa1 join ekko

on lfa1lifnr = ekkolifnr

join ekpo

on ekkoebeln = ekpoebeln

join mara

on ekpomatnr = maramatnr.

loop at itab.

write : / itab-lifnr ,itab-ebeln,itab-ebelp,itab-matnr.

endloop.

Read only

Former Member
0 Likes
835

Hi ..

join mara <i>(mistake matnr</i>) on ekpomatnr = maramatnr.