Application Development 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: 

Problem in Select options.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi buddy,

I guess the code is fine.

Whats the exact problem which u are facing ??

Regards.

Former Member
0 Kudos

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.

kesavadas_thekkillath
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

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

s_vkorg

s_vtweg

s_spart

Check your query once.

Rgds,

Bujji

Former Member
0 Kudos

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