‎2008 Sep 25 1:18 PM
Hello All,
I want to create a SELECT-OPTION field that will have different default values, NON EDITABLE, in selection screen depending on transaction that calls the program.
Please give me some advices to complete this work.
I did something like this:
SELECT_OPTIONS: P_DEP for DBTAB-DBFIELD.
case sy-tcode.
when 'ZT1'.
P_DEP = 'VALUE1'.
when 'ZT2'.
P_DEP = 'VALUE2'.
endcase.
But it doesn't work.
Thank you,
Diana.
‎2008 Sep 25 1:29 PM
Hello.
TABLES: sbook.
SELECTION-SCREEN BEGIN OF BLOCK bl01.
SELECT-OPTIONS: p_sel1 FOR sbook-carrid MODIF ID so1,
p_sel2 FOR sbook-connid MODIF ID so2.
SELECTION-SCREEN END OF BLOCK bl01.
INITIALIZATION.
p_sel1-low = 'AA'.
p_sel1-high = 'BB'.
APPEND p_sel1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'SO1'.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Regards
‎2008 Sep 25 1:21 PM
Hi,
A select option is set as follows:
p_dep-sign = 'EQ'.
p_dep-option = 'I'.
p_dep-low = 'VALUE1'.
append p_dep.To make them output only use the at selection-screen output event and loop at screen.
Regards,
Darren
‎2008 Sep 25 1:27 PM
Hi Diana,
First question is if you are trying to create a select-option or parameter on the selection screen.
In order to check the difference between the two please refer to the below link:
http://www.sap-basis-abap.com/abap/difference-between-select-options-and-parameters.htm
You code should work if you are creating parameters on the selection screen but if you are creating select-options you have to populate low and high values like below :
SELECT_OPTIONS: P_DEP for DBTAB-DBFIELD.
at selection-screen output.
case sy-tcode.
when 'ZT1'.
P_DEP-low = 'VALUE1'.
when 'ZT2'.
P_DEP-high = 'VALUE2'.
endcase.
To make the fields non-editable you have to use the below code.
loop at screen.
if screen-name = 'P_DEP-low' or screen-name = 'P_DEP-high '.
screen input = 0.
modify screen.
endif.
endloop.
Also this has to be done at the event at selection-screen output.
‎2008 Sep 25 1:27 PM
Hi Diana,
First question is if you are trying to create a select-option or parameter on the selection screen.
In order to check the difference between the two please refer to the below link:
http://www.sap-basis-abap.com/abap/difference-between-select-options-and-parameters.htm
You code should work if you are creating parameters on the selection screen but if you are creating select-options you have to populate low and high values like below :
SELECT_OPTIONS: P_DEP for DBTAB-DBFIELD.
at selection-screen output.
case sy-tcode.
when 'ZT1'.
P_DEP-low = 'VALUE1'.
when 'ZT2'.
P_DEP-high = 'VALUE2'.
endcase.
Also this has to be done at the event at selection-screen output.
‎2008 Sep 25 1:29 PM
Hello.
TABLES: sbook.
SELECTION-SCREEN BEGIN OF BLOCK bl01.
SELECT-OPTIONS: p_sel1 FOR sbook-carrid MODIF ID so1,
p_sel2 FOR sbook-connid MODIF ID so2.
SELECTION-SCREEN END OF BLOCK bl01.
INITIALIZATION.
p_sel1-low = 'AA'.
p_sel1-high = 'BB'.
APPEND p_sel1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'SO1'.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Regards
‎2008 Sep 25 1:31 PM
select options is like a range table having four fields
sign
option
low
high
so, first populate the work area(like line of select option) and then append it to select option..
Secondly to keep it display only u can set the screen-input = 0 by looping at screen.
‎2008 Sep 25 2:00 PM