‎2013 Oct 04 3:06 PM
Hi,
I have select-options statement written as select-options in_ktokd for kna1-ktokd no intervals. In this, field ktokd of table kna1 has 20 values and I want to use 8 values among them as default and should always appear as default values while selection. Also I can be able to change/delete/add values in the input selection. Any idea how to do this ?
Thanks.
‎2013 Oct 04 3:12 PM
In the event INITIALISATION in your report , you can populate the select options table with the required 8 values .
Then the 8 values will show up the selection screen and also you can change /delete / add the values
BR
Venkat
‎2013 Oct 04 3:16 PM
Hi,
Requirement is not like that. I want 8 default values which will always be there when I click on multiple selection button. Also when I click on F4 help then all the 20 values also should appear.
‎2013 Oct 07 8:06 AM
I think as Venkat suggested populating the select options table in the initialization event would be the way to go about it.
TABLES kna1.
select-options in_ktokd for kna1-ktokd no intervals.
INITIALIZATION.
in_ktokd-sign = 'I'.
in_ktokd-option = 'EQ'.
in_ktokd-low = '1000'.
APPEND in_ktokd.
in_ktokd-sign = 'I'.
in_ktokd-option = 'EQ'.
in_ktokd-low = '2000'.
APPEND in_ktokd.
in_ktokd-sign = 'I'.
in_ktokd-option = 'EQ'.
in_ktokd-low = '3000'.
APPEND in_ktokd.
in_ktokd-sign = 'I'.
in_ktokd-option = 'EQ'.
in_ktokd-low = '4000'.
APPEND in_ktokd.
in_ktokd-sign = 'I'.
in_ktokd-option = 'EQ'.
in_ktokd-low = '5000'.
APPEND in_ktokd.
in_ktokd-sign = 'I'.
in_ktokd-option = 'EQ'.
in_ktokd-low = '6000'.
APPEND in_ktokd.
in_ktokd-sign = 'I'.
in_ktokd-option = 'EQ'.
in_ktokd-low = '7000'.
APPEND in_ktokd.
in_ktokd-sign = 'I'.
in_ktokd-option = 'EQ'.
in_ktokd-low = '8000'.
APPEND in_ktokd.
Here on executing, you get all your default values in the multiple entries option.
You can add, or delete or modify entries as required in the selection screen.
The F4 will continue to show the initial values.
‎2013 Oct 04 3:57 PM
Hi
Please note that the default values given in select options does not affect the F4 help. No matter whatever values you give as default values, the F4 help will have no effect on it.
F4 means possible entries.
Thanks,
Anju
‎2013 Oct 04 4:01 PM
Hi,
Since you want a specific set of values to be defaulted, I would recommend the best way to do it is as follows:
Write the following set of code in the AT SELECTION-SCREEN OUTPUT Event or INITIALIZATION Event depending on your requirement.
in_ktokd-sign = 'I'.
in_ktokd-option = 'BT'.
in_ktokd-low = specific value.
APPEND in_ktokd.
You would have to repeat this for the number of values you want defaulted in your selection screen.
In case you do not prefer hardcoding, you can determine a pattern for these 8 values and retrieve it from any customizing or database table and append the values in a loop.
Hope this helps.
Regards,
Subhrangsu
‎2013 Oct 04 4:55 PM
You can use default variant and can save it while in transaction SE93.
In this variant you can set desired 8 values in your select option.
‎2013 Oct 07 7:03 AM
Hi,
Suppose you are using the below code,
SELECT-OPTIONS : carrid FOR sflight-carrid.
START-OF-SELECTION.
Select * from sflight into table t_sflight WHERE carrid in carrid.
If sy-subrc eq 0.
WRITE 'Hi'.
ENDIF.
Now when you execute you need to press the multiple selection button Which provides a screen.
If your "8" values are in series the go with Select Range tab and if your values are random then go with Select single values tab.
Insert your desired values and Press execute and then save button and provide name and description as save the variant.
Now you can use both the variant or the F4 help(To get all the values)..
This will help.
Regards.
‎2013 Oct 07 8:47 AM
Hi
From what i was able to understand about your requirement you can put those 8 values in default addition..
Now your user will be able to remove those default 8 values......to handle that u can write code in initialization event to not to allow them further to run the program.
and as anju suggested
Please note that the default values given in select options does not affect the F4 help. No matter whatever values you give as default values, the F4 help will have no effect on it.
Your f4 help will be the default help defined for KTOKD element.
and u can assign other value request (f4) only if u are using logical databases in your programs , for further info please refer help on Select-options statements.
http://help.sap.com/saphelp_45b/helpdata/en/34/8e72da6df74873e10000009b38f9b8/content.htm
Regards
Arpit Gupta