Skip to Content
0
Former Member
Feb 19, 2014 at 06:59 AM

fetching data from multiple table with select option

142 Views

hello experts,

I am new to abap development.

This is my requirement. I want to fetch data with the help of below three structures


types: begin of ty_bbpm_but_frg0061,

PARTNER_GUID type BU_PARTNER_GUID,

PURCHASE_ORG type BBP_PROC_ORG,

end of ty_bbpm_but_frg0061.

types: BEGIN OF ty_but000,

PARTNER type BU_PARTNER,

PARTNER_GUID type BU_PARTNER_GUID,

END OF ty_but000.

types: BEGIN OF ty_but100,

partner TYPE BU_PARTNER,

RLTYP TYPE BU_PARTNERROLE,

END OF ty_but100.



with the selection screen

select-OPTIONS : s_org_id for wa_bbpm_but_frg0061-PURCHASE_ORG NO INTERVALS no-EXTENSION.

now the main thing is i will fetch data from ty_bbpm_but_frg0061 with reference to rest of the tables.

select PARTNER_GUID

PURCHASE_ORG

from bbpm_but_frg0061

into TABLE it_bbpm_but_frg0061

where PURCHASE_ORG in s_org_id.

select partner

partner_guid

from but000

into TABLE it_but000

for ALL ENTRIES IN it_bbpm_but_frg0061

where partner_guid = it_bbpm_but_frg0061-partner_guid.

select partner

rltyp

from but100

into TABLE it_but100

FOR ALL ENTRIES IN it_but000

where partner = it_but000-partner and

rltyp = 'bbp000'.

now the prob is my select option is not working and i am not able to filter the data extraction.

please help with the coding.

Regards,

Sarnava