‎2007 Oct 03 2:34 PM
hai gurus can any one tell me how to read the values from a select-option
for example i use select options for customer number between 1 to 100
i want to print each value given on options based on sign and option
for ex if i give i bt 1 to 100
then it should print the values from 1 to 100
if i use e then it should print 2 to 99 and so on
regards
afzal
‎2007 Oct 03 2:38 PM
Hi Afzal..
This is the Code..
SELECT-OPTIONS : S_DATE FOR SY-DATUM.
start-of-selection.
LOOP AT S_DATE.
CASE S_DATE-OPTION
WHEN 'BT'.
Write:/ 'From ' , s_date-low , 'To ', s_date-High.
WHEN 'NB'.
WHEN 'EQ'.
Write:/ 'Equals to ' , s_date-low .
ENDCASE.
ENDLOOP.
<b>reward if Helpful.</b>
‎2007 Oct 03 2:38 PM
Hi Afzal..
This is the Code..
SELECT-OPTIONS : S_DATE FOR SY-DATUM.
start-of-selection.
LOOP AT S_DATE.
CASE S_DATE-OPTION
WHEN 'BT'.
Write:/ 'From ' , s_date-low , 'To ', s_date-High.
WHEN 'NB'.
WHEN 'EQ'.
Write:/ 'Equals to ' , s_date-low .
ENDCASE.
ENDLOOP.
<b>reward if Helpful.</b>
‎2007 Oct 03 2:45 PM
Hi afzal,
By entering values in the select option, you are not fetching anything from the database?
Let me know if you are not fetching anything from the database table.
‎2007 Oct 03 2:47 PM
Be careful: E BT 1 100 will not take interval 1-100 excluding the limits 1 and 100. It will take all the values which ARE NOT in this interval, i.e. all values lower than 1 or greater than 100.
‎2007 Oct 03 2:52 PM
Hi,
You can use the below code :
tables : bsis.
data : count type i.
select-OPTIONS : num for bsis-buzei.
INITIALIZATION.
count = 1.
start-of-SELECTION.
do num-high times.
if count = 1.
count = num-low.
write : / count.
count = count + 1.
else.
write : / count.
count = count + 1.
endif.
if count GT num-high.
exit.
ENDIF.
enddo.
if num-high is initial.
write :/ num-low.
endif.
Thanks,
Sriram Ponna.
‎2007 Oct 03 2:53 PM
Hey Afzal,
If you just want to print the numbers entered in the Select-options, I would use a Select statement to fetch those values from the Customer Master table and then print...
Report ztest.
TABLES: kna1.
SELECT-OPTIONS: s_kunnr FOR kna1-kunnr.
TYPES: BEGIN OF i_kunnr,
kunnr TYPE kna1-kunnr,
END OF i_kunnr.
DATA: i_kunnr TYPE STANDARD TABLE OF i_kunnr,
wa_kunnr LIKE LINE OF i_kunnr.
START-OF-SELECTION.
SELECT kunnr FROM kna1 INTO TABLE i_kunnr
WHERE kunnr IN s_kunnr.
LOOP at i_kunnr INTO wa_kunnr.
WRITE: / wa_kunnr.
CLEAR wa_kunnr.
ENDLOOP.
Hope this helps.
Regards,
Vivek
‎2007 Oct 03 2:59 PM
HI,
sign E mean not only excluding the first and last values.it will exclude the range from low value to high value.
rgds,
bharat.