Skip to Content
avatar image
Former Member

how to declare and retrive data for 3 tables

requirement

need retrive vbak-vkbur from there tvbur- adrnr from there adrc- addrnum. how to declare it n retrive data ? plz help me

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 19, 2008 at 02:51 PM

    hi,

    please see the follwing code,

    select vbak~vkbur

    tvbur~adrnr

    adrc~addrnum

    from ( vbak as vbak innerjoin tvbur as tvbur on

    vbakernam = tvburernam

    innerjoin adrc as adrc on

    tvburadrnr = adrcaddrnum ).

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 19, 2008 at 08:24 PM

    Hey Lakshmi,

    Welcome to SDN,

    There are a lot of resources out there. Often the F1 help that SAP provides can give you all the information you need.

    Below is a sample code with what I understand your requirements to be, as well as links to help pages.

    Hope this information helps.

    "Declare a type to create the table

    Link: [http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb2fcc358411d1829f0000e829fbfe/content.htm]

    Types:begin of t_tab,

    vbak type vkbur-vbak,

    tvbur type adrnr-tvbur,

    adrc type addrnum-adrc,

    end of t_tab.

    "You can declare an internal table to store the data:

    Link: [http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb367a358411d1829f0000e829fbfe/content.htm]

    Data: i_tab type standard table of t_tab.

    "Have some sort of parameter for your selection criteria

    Parameters: p_vbeln type vbak-vbeln.

    "There are several ways to do inner joins

    Link: [http://help.sap.com/saphelp_nw70/helpdata/EN/cf/21ec77446011d189700000e8322d00/content.htm]

    Select a~vkbur

    b~adrnr

    c~addrnum

    into table i_tab

    from vbak as a inner join tvbur as b

    on avkbur = bvkbur

    inner join adrc as c

    on badrnr = caddrnum

    where a~vbeln = p_vbeln.

    Regards,

    C

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 20, 2008 at 05:34 AM

    need retrive vbak-vkbur from there tvbur- adrnr from there adrc- addrnum. how to declare it n retrive data ? plz help me

    data:begin of it_vbak occurs 0,

    vkbur type vbak-vkbur,

    end of it_vbak.

    data: begin of it_tvbur occurs 0,

    vkbur type tvbur-vkbur,

    adrnr type tvbur-adrnr,

    end of it_tvbur.

    data:begin of it_adrc occurs 0,

    addrnum type adrc-addrnum,

    end of it_adrc.

    select vkbur from vabk into table it_vbak where <>.

    if not it_vbak[] is initial.

    select vkbur adrnr from tvbur into table it_tvbur for all entries in it_vbak where vkbur = it_vbak-vkbur.

    endif.

    if not it_adrc[] is initial.

    select addrnum from adrc inot table it_adrc for all entries in it_adrc where addrnum = it_tvbur-adrnr.

    endif.

    Add comment
    10|10000 characters needed characters exceeded