Skip to Content
0
Former Member
Jan 09, 2012 at 05:54 AM

Re: Table joining between ekko ekpo essr

1963 Views

Hi Experts,

As i have developed a report but in table joining between ekko ekpo and essr i am facing problen as in my selection screen

ENTRY SHEET NUMBER and also in the ouput also i need ENTRY SHEET NUMBER with other field which i have mention i the IT_FINAL table.Below is my code.How to display all the field which is present in my final table it_final.

types: begin of ty_gtab1,

lblni type lblni,

lblne type lblne,

erdat type erdat,

ebeln type ebeln,

netwr type netwr,

banfn type banfn,

warpl type warpl,

fknum type fknum,

spec_no type spec_no,

end of ty_gtab1.

data: it_gtab1 type STANDARD TABLE OF ty_gtab1.

data: wa_gtab1 type ty_gtab1.

Types: Begin of ty_output,

ebeln type ekko-ebeln,

bsart type ekko-bsart, " esart,

lifnr type ekko-lifnr, "ELIFN,

ekorg type ekko-ekorg,

ekgrp type ekko-ekgrp, "BKGRP,

waers type ekko-waers,

bedat type ekko-bedat, "EBDAT,

frggr type ekko-frggr,

frgsx type ekko-frgsx,

frgke type ekko-frgke,

frgzu type ekko-frgzu,

txz01 type ekpo-txz01,

werks type ekpo-werks, "EWERK,

matkl type ekpo-matkl,

end of ty_output.

types: begin of ty_final,

ebeln type ekko-ebeln,

bsart type ekko-bsart,

lifnr type ekko-lifnr,

ekorg type ekko-ekorg,

ekgrp type ekko-ekgrp,

waers type ekko-waers,

bedat type ekko-bedat,

frggr type ekko-frggr,

frgsx type ekko-frgsx,

frgke type ekko-frgke,

frgzu type ekko-frgzu,

txz01 type ekpo-txz01,

werks type ekpo-werks,

matkl type ekpo-matkl,

lblni type essr-lblni,

erdat type essr-erdat,

netwr type essr-netwr,

end of ty_final.

data: gt_output type STANDARD TABLE OF ty_output.

data: wt_output type ty_output.

data: gt_final type STANDARD TABLE OF ty_final.

data: wt_final type ty_final.

*selection-screen begin of block b1 with frame title text-001.

*

  • SELECT-OPTIONS: S_FRGCO FOR T16FC-FRGCO NO-EXTENSION no INTERVALS,

  • S_FRGGR FOR T16FC-FRGGR.

*

  • selection-screen end of block b1.

selection-screen begin of block b2 with frame TITLE text-002.

select-OPTIONS: S_EBELN FOR EKKO-EBELN,

S_BEDAT FOR EKKO-BEDAT,

S_BSART FOR EKKO-BSART,

S_LIFNR FOR EKKO-LIFNR,

S_EKORG FOR EKKO-EKORG,

S_EKGRP FOR EKKO-EKGRP,

S_WERKS FOR EKPO-WERKS,

S_MATKL FOR EKPO-MATKL,

S_FRGCO FOR T16FC-FRGCO NO-EXTENSION no INTERVALS,

S_FRGGR FOR T16FC-FRGGR.

SELECTION-SCREEN END OF BLOCK B2.

selection-screen begin of block b3 with frame title text-004.

parameters: p_ch1 as checkbox.

parameters: p_ch2 as checkbox .

parameters: p_ch3 as checkbox.

selection-screen end of block b3.

selection-screen begin of block b4 with frame TITLE text-003.

select-options: S_LBLNI FOR ESSR-LBLNI,

S_LBLNE FOR ESSR-LBLNE,

S_ErDAT FOR ESSR-ERDAT,

S_SPEC FOR ESSR-SPEC_NO,

S_BANFN FOR ESSR-BANFN,

S_WARPL FOR ESSR-WARPL,

S_FKNUM FOR ESSR-FKNUM.

SELECTION-SCREEN END OF BLOCK B4.

  • fetching data**************************

select lblni

lblne

erdat

ebeln

netwr

banfn

warpl

fknum

spec_no

from essr into table it_gtab1

where lblni in s_lblni

and lblne in s_lblne

and erdat in s_erdat

and spec_no in s_spec

and banfn in s_banfn

and warpl in s_warpl

and fknum in s_fknum.

select t1~ebeln " ekko

t1~bsart

t1~lifnr

t1~ekorg

t1~ekgrp

t1~waers

t1~bedat

t1~frggr

t1~frgsx

t1~frgke

t1~frgzu

t2~txz01 "ekpo

t2~werks

t2~matkl

into corresponding fields of table gt_output

from ekko as t1 inner join ekpo as t2 on

t1ebeln = t2ebeln

where t1~ebeln in s_ebeln

and t1~bsart in s_bsart

and t1~lifnr in s_lifnr

and t1~ekorg in s_ekorg

and t1~ekgrp in s_ekgrp

and t1~bedat in s_bedat

and t1~frggr in s_frggr

and t2~werks in s_werks

and t2~matkl in s_matkl.

  • and t1~ebeln = wa_gtab1-lblni.

loop at gt_output into wt_output.

endloop.

Please any one can through some light.

Regards,

Am