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

Problem in Select options.

Former Member
0 Likes
1,021

Hi,

I couldnt able to select the values in select options. for the below code..

can anypne pls tell me what might be the error in generating.

tables : vbak,vbap.

data : begin of itab_vbak occurs 0,

vbeln like vbak-vbeln,

auart like vbak-auart,

netwr like vbak-netwr,

waerk like vbak-waerk,

end of itab_vbak.

data : begin of itab_vbap occurs 0,

zmeng like vbap-zmeng,

zieme like vbap-zieme,

posnr like vbap-posnr,

matnr like vbap-matnr,

end of itab_vbap.

select-options : s_vbeln for vbak-vbeln,

s_vkorg for vbak-vkorg,

s_vtweg for vbak-vtweg,

s_spart for vbak-spart.

Initialization.

start-of-selection.

select vbeln auart netwr waerk

into table itab_vbak

from vbak

where vbeln in s_vbeln.

loop at itab_vbak.

write : /20 itab_vbak-vbeln,30 itab_vbak-auart,35 itab_vbak-netwr,

60 itab_vbak-waerk.

endloop.

Stalin

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
996

Hi Stalin ,

I had checked your program in my system , there is nothing wrong with that

i am getting out put correctly

there might be a sitvation where you don't get any out put

i.e in your data base table you don't have data

please go through data base table and check weather there is data available for that table or not

you had declared extra things but there won't be problem with that filds but in the point of performnce sap recomonds don't declare extra things

8 REPLIES 8
Read only

Former Member
0 Likes
996

Hi Stalin,

Your code seems to be ok, probably there may be no entries for the selection criteria.

Why don't you check the sy-subrc value?

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
996

Hi,

Can u please write the code like this.

Instead of itab_vbak occurs 0 replace it with itab_vbak occurs 0 with header line.

and u are taking all the fiedls with LIKE so u r refering to the field not the TYPE.

In select options if u give like this it may work.

data g_vbeln type vbeln_va.

select-options : s_vbeln for g_vbeln.

try this by replacing all the fields....

If this is for practising u are doing it is ok, but better u start ur program

declaring TYPES :.....

Regards.

Read only

Former Member
0 Likes
996

after enetring values in selection-screen , start debugging by /h

and check select-option-low & select-option-high value by double clicking on that and check whether all values entered by u have been populated in that

Read only

Former Member
0 Likes
996

Hi buddy,

I guess the code is fine.

Whats the exact problem which u are facing ??

Regards.

Read only

Former Member
0 Likes
996

I think there are no values in the table for the values which u are entering.

So better check the tables first for some appropriate values.

Regards.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
996

Pass that vbeln to vbak table and check whether any data exists..

Read only

Former Member
0 Likes
996

Hi,

You are not using the below select-options in your query.

s_vkorg

s_vtweg

s_spart

Check your query once.

Rgds,

Bujji

Read only

Former Member
0 Likes
997

Hi Stalin ,

I had checked your program in my system , there is nothing wrong with that

i am getting out put correctly

there might be a sitvation where you don't get any out put

i.e in your data base table you don't have data

please go through data base table and check weather there is data available for that table or not

you had declared extra things but there won't be problem with that filds but in the point of performnce sap recomonds don't declare extra things