Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select issue : not getting output.

Former Member
0 Likes
1,536

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.

1 ACCEPTED SOLUTION
Read only

0 Likes
1,412

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.

6 REPLIES 6
Read only

matt
Active Contributor
0 Likes
1,412

Impossible to answer as we don't know what's in your EKBE, nor do we know what you've given in s_ebeln.

Read only

0 Likes
1,412

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.

Read only

0 Likes
1,412

In the selection screen i dont want ebelp...then how can i pass ebelp ?

Read only

0 Likes
1,413

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.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,412

Your query condition makes no sense at this place:

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

because WA_EKBE has not been initialized yet.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,412

The most important question is what do you want to achieve, in plain English words?