Skip to Content
-2

select issue : not getting output.

Hi,

i am doing something wrong in this code ...i guess i am going wrong in select query..please check n let me know where i am going wrong.

Data : it_ekbe type table of ekbe,
wa_ekbe type ekbe.
select-options : s_ebeln for wa_ekbe-ebeln.

select ebeln ebelp bewtp gjahr from ekbe into corresponding fields of table it_ekbe where ebeln in s_ebeln and ebelp = wa_ekbe-ebelp and bewtp = 'E'.

loop at it_ekbe into wa_ekbe.
write:/ wa_ekbe-ebeln ,wa_ekbe-ebelp ,wa_ekbe-bewtp ,wa_ekbe-gjahr.
endloop.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Feb 10, 2019 at 07:18 AM

    Then you dont want to pass ebelp in selection screen, it will automatically fetch all the values relevant to Ebeln(Purchase Order).

    Tables:ekbe.

    Data : it_ekbe type table of ekbe,

    wa_ekbe type ekbe.

    select-options : s_ebeln for ekbe-ebeln obligatory.

    select ebeln ebelp bewtp gjahr from ekbe into corresponding fields of table it_ekbe where ebeln in s_ebeln

    and bewtp = 'E'.

    loop at it_ekbe into wa_ekbe.
    write:/ wa_ekbe-ebeln ,wa_ekbe-ebelp ,wa_ekbe-bewtp ,wa_ekbe-gjahr.
    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 10, 2019 at 06:52 AM

    Change your query like below , It will work.

    Tables:ekbe.

    Data : it_ekbe type table of ekbe,

    wa_ekbe type ekbe.

    select-options : s_ebeln for ekbe-ebeln,

    s_ebelp for ekbe-ebelp.

    select ebeln ebelp bewtp gjahr from ekbe into corresponding fields of table it_ekbe where ebeln in s_ebeln

    and ebelp in s_ebelp

    and bewtp = 'E'.

    loop at it_ekbe into wa_ekbe.
    write:/ wa_ekbe-ebeln ,wa_ekbe-ebelp ,wa_ekbe-bewtp ,wa_ekbe-gjahr.
    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 10, 2019 at 08:09 AM

    Your query condition makes no sense at this place:

    ... AND ebelp = wa_ekbe-ebelp ...

    because WA_EKBE has not been initialized yet.

    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.