10-08-2007 7:05 PM
Hello Experts.
in the selection screen i need to have an option to enter the movement types.suppose if user will give like 10 and 100.The system should not take all the values between 10 to 100 like select options. It SHOULD GIVE ONLY 10 AND 100 RECORDS so please tell me how to code this . Already i declared like .. select-options s_bwart for mseg-bwart. so please tell me how to restrict this even if i use select options also. Thanks for all the replies.
10-08-2007 7:08 PM
Hi
You dont need to do anything. Instead of the user giving 10 and 100 in the lower and the upper fields. He needs to use the extension and enter the single values 10 and 100. This way your program will take care of the selections. You need not do anything in the program.
Cheers
VJ
10-09-2007 12:00 AM
Use the FM SELECT_OPTIONS_RESTRICT to restrict the select-options.
10-09-2007 4:57 AM
write your select otipn as below
Select *
From MSEG
Into GT_MSEG
Where ( bwart EQ S_BWART-LOW
OR bwart EQ S_BWART-HIGH ) .
<b>OR</b>
Select *
From MSEG
Into GT_MSEG
Where bwart IN S_BWART.
LOOP AT GT_MSEG.
IF ( GT_MSEG-BWART <> S_BWART-LOW OR GT_MSEG-BWART <> S_BWART-HIGH ).
DELETE GT_MSEG.
ENDIF.
ENDLOOP.
Rewards if useful...........
Minal
10-09-2007 5:27 AM
Hi,
You can declare 2 parameters on the same line instead of declaring it as select options and later use these parameters in your select statement.
Regards,
Raghavendra
10-09-2007 5:35 AM
Dear,
This is quite simple.
Do like this in your declration.
SELECT-OPTIONS : S_BWART FOR MSEG-BWART NO-EXTENSION .
here you have single input field for BWART in your selection screen, with a arrow in front of it.
Click on this arrow and now enter all values which need to be entered.
10
100
and now only these which you put here is considered only.
reward if useful.
Amit Singla
Message was edited by:
Amit Singla
10-09-2007 5:39 AM
Hello Shiva,
If Functionally your select options can have only single values, then you can declare your select options with NO-INTERVALS. then the user can enter only single values. OR alternatively you can create a range object say r_bwart and fill the same with EQ for s_bwart-low and s_bwart-high. Further restriction on Select options can be achved by using the FM mentioned above.
Regards
Saket Sharma
10-09-2007 6:00 AM
Hi,
Use the below code.
TABLES: mseg.
SELECT-OPTIONS s_bwart FOR mseg-bwart.
DATA: BEGIN OF itab OCCURS 0,
bwart LIKE mseg-bwart,
END OF itab.
IF NOT s_bwart-low IS INITIAL AND
NOT s_bwart-high IS INITIAL.
WHILE s_bwart-low LE s_bwart-high.
itab-bwart = s_bwart-low.
APPEND itab.
s_bwart-low = s_bwart-low + 1.
ENDWHILE.
ELSEIF NOT s_bwart-low IS INITIAL.
LOOP AT s_bwart.
itab-bwart = s_bwart-low.
APPEND itab.
ENDLOOP.
ENDIF.
LOOP AT itab.
WRITE:/5 itab-bwart.
ENDLOOP.