02-08-2008 7:30 AM
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
02-08-2008 12:21 PM
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
02-08-2008 7:34 AM
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.
02-08-2008 7:44 AM
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.
02-08-2008 11:03 AM
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
02-08-2008 11:11 AM
Hi buddy,
I guess the code is fine.
Whats the exact problem which u are facing ??
Regards.
02-08-2008 11:13 AM
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.
02-08-2008 11:54 AM
Pass that vbeln to vbak table and check whether any data exists..
02-08-2008 11:59 AM
Hi,
You are not using the below select-options in your query.
s_vkorg
s_vtweg
s_spart
Check your query once.
Rgds,
Bujji
02-08-2008 12:21 PM
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