Skip to Content
author's profile photo Former Member
Former Member

Function Module query

hi all ,

In my FM , i have a importing parameter kna1-kunnr

i want to select a field from table knvp

based on my importing parameter

how do i use it??

select field from knvp where ""

can anybody help me with this

thnkx

bhanu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jan 22, 2008 at 08:20 AM

    Hi,

    If the name of ur Importing parameter is kna1-kunnr then

    select fields

    from knvp

    where kunnr = kna1-kunnr.

    if the name of ur importing parameter is i_kna1-kunnr then

    select fields

    from knvp

    where kunnr = i_kna1-kunnr.

    Hope this helps.

    Regards,

    Ismail.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 08:28 AM

    hi,

    select field from knvp where kunnr = kna1-kunnr.

    try this

    tables:kna1,knvp.

    data itab like knvp occurs 0 with header line.

    select kunnr from knvp into itab where kunnr = kna1-kunnr.

    endselect.

    reward if its helpful

    Edited by: Rajasekhar Reddy on Jan 22, 2008 2:02 PM

    Edited by: Rajasekhar Reddy on Jan 22, 2008 2:07 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 08:33 AM

    Hello Bhanu,

    Just create a data object like kna1-kunnr.

    ex: kunnr1 like kna1-kunnr.

    assign the value from importing parameter of function module to kunnr1.

    then write query like:

    select <field> from knvp where kunnr eq kunnr1.

    hope it works.

    Reward If Helpful.

    Regards

    --

    Sasidhar Reddy Matli.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 08:35 AM

    Bhanu,

    Decalre the internal table with fields which you require from KNVP table.

    FOR ex: In FM if you gave v_kunnr

    select required fields into table

    i_knvp from knvp

    where kunnr EQ v_kunnr.

    Don't forget to reward if useful...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 22, 2008 at 09:23 AM

    Hi Dear,

    You have 2 use the inner join Bcaz ur using

    two tables.

    1.First u create the structure for the fields which

    u r gng to select from the KNVP table.

    In this structure mention u r import parameter

    field also.

    Eg: Begin of x_KNVP,

    Kunnr type Kunnr,

    field2 type dataelement,

    field3.....

    End of x_KNVP.

    2.Now write the select query like this

    Select Field1

    Field2

    .

    Fieldn

    into corresponding fields of table it_KNVP

    from KNVP as C

    inner join KNA1 as D

    on CKUNNR = DKUNNR.

    I hope it will help you.If it helps reward me points.

    Regards

    AshokChowdhary.M

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.