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

how to fetch data based on this selection screen

Former Member
0 Likes
859

Hi Friends:

I've a selection screen which contains these 3 fields:

company code (t001-bukrs)

material division (mara-spart)

posting date (bkpf-budat)

based on the above fields, I've to fetch the following:

ekpo-bukrs

mara-spart

mseg-werks

mseg-lgort

bseg-hkont

bseg-kostl

bseg-hkont

skat-txt50

mseg-mblnr

mseg-zeile

bseg-belnr

bkpf-bktxt

mseg-insmk

bkpf-monat

bkpf-budat

mseg-bwart

mbew-matnr

makt-maktx

mseg-menge

mseg-meins

mbew-stprs

mseg-dmbtr

bseg-pswsl

ausp-atwrt

mara-matkl

mara-mtart

mbew-bklas

mbew-bwtar

mkpf-vgart

mcha-charg

mseg-ebeln

aufk-aufnr

mseg-ummat

vbak-vbeln

likp-vbeln

bkpf-usnam

Please help me with the logic . I want to ask that in which order I should start fetching data.How to relate it from selection screen. Which table I should fetch first based on the selection screen.how to relate mseg/bseg/mara/mbew/vbak/bkpf etc.

Please help.

Thanks for your time.

Hi Friends:

I've a selection screen which contains these 3 fields:

company code (t001-bukrs)

material division (mara-spart)

posting date (bkpf-budat)

based on the above fields, I've to fetch the following:

ekpo-bukrs

mara-spart

mseg-werks

mseg-lgort

bseg-hkont

bseg-kostl

bseg-hkont

skat-txt50

mseg-mblnr

mseg-zeile

bseg-belnr

bkpf-bktxt

mseg-insmk

bkpf-monat

bkpf-budat

mseg-bwart

mbew-matnr

makt-maktx

mseg-menge

mseg-meins

mbew-stprs

mseg-dmbtr

bseg-pswsl

ausp-atwrt

mara-matkl

mara-mtart

mbew-bklas

mbew-bwtar

mkpf-vgart

mcha-charg

mseg-ebeln

aufk-aufnr

mseg-ummat

vbak-vbeln

likp-vbeln

bkpf-usnam

Please help me with the logic . I want to ask that in which order I should start fetching data.How to relate it from selection screen. Which table I should fetch first based on the selection screen.how to relate mseg/bseg/mara/mbew/vbak/bkpf etc.

Please help.

Thanks for your time.

3 REPLIES 3
Read only

Former Member
0 Likes
651

hi no need to relate them on the selection screen but should relate them in the select statement .

write the selection-screen like this..

select-options:s_bukrs for t001-bukrs,

s_spart for mara-spart,

s_budat for bkpf-budat .

then use the select statement for fetching the data

Read only

0 Likes
651

Hi:

Actually I wanted to ask that which table I should fetch first based on my selection screen & further what should be the order of tables from which I'll fetch the data., so tat I can use for all entries.

Thanks:

Read only

Former Member
0 Likes
651

Hi,

I dont think you need EKPO to fetch your bukrs. It is available in BKPF too.

Use inner join to join MKPF, BKPF, MAKT, fetch all the related entreis.

Use Inner join on MBEW, MCHA for all entries from above query.

use inner join on AUSP for all entries from above query.

Use may use separate queries or inner joins for LIKP and VBAK with for all entries.

Use separate for all entries for BSEG and MSEG. Do not use any JOIN on BSEG as it is a pooled table.

As per the need you may change the queries..

Regards,

Subramanian