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

SELECT

hi all

i have a select statement

SELECT * FROM BKPF

INTO CORRESPONDING FIELDS OF TABLE it_bkpf1

WHERE bukrs = p_bukrs AND gjahr = p_gjahr.

In the above statement i have bukrs and gjahr which is selected from the parameters statement as mentione below.

*PARAMETERS : P_BUKRS TYPE BKPF-BUKRS OBLIGATORY. "Company Code

PARAMETERS : P_GJAHR TYPE BKPF-GJAHR OBLIGATORY. "Fiscal Year*

Now i need to create a SELECT statement which along with the bukrs and gjhar also filters the BELNR field.The problem is the belnr field is SELECT-OPTIONS statement and it has two values low and high.

SELECT-OPTIONS : s_belnr FOR bkpf-belnr. "Document number.

Please help and tell me how to use the select statement along with the belnr field.

Vijay

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Posted on Dec 26, 2007 at 05:42 AM

    SELECT * FROM BKPF

    INTO CORRESPONDING FIELDS OF TABLE it_bkpf1

    WHERE bukrs = p_bukrs AND gjahr = p_gjahr and belnr in s_belnr.

    Kanagaraja L

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 26, 2007 at 05:42 AM

    Just pass IN s_belnr into your select query

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 26, 2007 at 05:44 AM

    SELECT * FROM BKPF

    INTO CORRESPONDING FIELDS OF TABLE it_bkpf1

    WHERE bukrs = p_bukrs AND gjahr = p_gjahr

    and belnr in s_blenr.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 26, 2007 at 05:45 AM

    hi

    SELECT * FROM BKPF

    INTO CORRESPONDING FIELDS OF TABLE it_bkpf1

    WHERE bukrs = p_bukrs AND gjahr = p_gjahr

    and belnr in s_belnr.

    regards,

    pavan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 26, 2007 at 05:53 AM

    h

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 26, 2007 at 06:32 AM

    Hi Vijay,

    Decalre the parameters as

    tables: bkpf.

    SELECT-OPTIONS: P_BUKRS FOR BKPF-BUKRS NO INTERVALS OBLIGATORY. "Company Code

    SELECT-OPTIONS: P_GJAHR FOR BKPF-GJAHR NO INTERVALS OBLIGATORY. "Fiscal Year*

    And use the following select statement

    SELECT * FROM BKPF

    INTO CORRESPONDING FIELDS OF TABLE it_bkpf1

    WHERE bukrs IN p_bukrs AND gjahr IN p_gjahr AND belnr IN s_belnr

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 26, 2007 at 06:39 AM

    Hi Vijay Krishna

    please use this:-

    SELECT * FROM BKPF

    INTO CORRESPONDING FIELDS OF TABLE it_bkpf1

    WHERE bukrs = p_bukrs AND gjahr = p_gjahr

    and belnr in s_belnr.

    hope it will resolve your issue

    Regards

    Deepanker

    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.