‎2008 May 16 7:56 AM
dear all,
how can we handle the selection screen to disable the second field if we have two fields in selection screen & one of them is entered.
kindly give me the code
‎2008 May 16 8:05 AM
HI,
1.For select-options:
... NO INTERVALS
Effect
If you specify this addition, the second input screen is not created on the selection screen.
Note
The user can only specify a single comparison in the first line in the selection table on the selection screen. The dialog box for multiple selections still allows interval selections.
Example
Declaration of a selection criterion for which a single comparison is possible on the selection screen, but multiple selection isnot possible.
DATA spfli_wa TYPE spfli.
SELECT-OPTIONS s_carrid FOR spfli_wa-carrid
NO-EXTENSION NO-INTERVALS.
2.For screens:
Depending on the flag, enable/disable the screen elements in your AT SELECTION-SCREEN OUTPUT event.
At selection-screen output is the last event triggered before selection screen displayed.
at selection screen on output is used to set screen attributes
AT SELECTION_SCREEN OUTPUT
LOOP AT SCREEN.
if VIEW = 'X' " View radio button selects
IF SCREEN-NAME = 'PR1'.
screen-INPUT = 0.
modify screen.
ENDIF.
IF SCREEN-NAME = 'PR2'.
screen-INPUT = 0.
modify screen.
ENDIF.
ENDLOOP.
Regards,
Shiva Kumar
‎2008 May 16 8:06 AM
Hi,
Try this -
TYPE-POOLS sscr.
Tables: KOMG.
Select-Options:
s_prod for komg-matnr.
DATA restrict TYPE sscr_restrict.
DATA : optlist TYPE sscr_opt_list,
ass type sscr_ass.
INITIALIZATION.
optlist-name = 'OBJECTKEY1'.
optlist-options-eq = 'X'.
APPEND optlist TO restrict-opt_list_tab.
ass-kind = 'S'.
ass-name = 'S_PROD'.
ass-sg_main = 'I'.
ass-sg_addy = space.
ass-op_main = 'OBJECTKEY1'.
APPEND ass TO restrict-ass_tab.
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = restrict
EXCEPTIONS
TOO_LATE = 1
REPEATED = 2
SELOPT_WITHOUT_OPTIONS = 3
SELOPT_WITHOUT_SIGNS = 4
INVALID_SIGN = 5
EMPTY_OPTION_LIST = 6
INVALID_KIND = 7
REPEATED_KIND_A = 8
OTHERS = 9.
Hope this helps.
Regds,
Seema.
‎2008 May 16 8:07 AM
Hi,
It is posible. but you need to press ENTER after entering the value in the first field.
parameters: p_char type c,
p_num type i.
at selection-screen output.
loop at screen.
if screen-name = 'P_NUM'.
if not p_char is initial.
screen-input = 0.
else.
screen-input = 1.
endif.
endif.
modify screen.
endloop.
‎2008 May 16 8:08 AM
Hello,
You can write the logic to disable/enable the selection screen fields in the event:
AT SELECTION-SCREEN OUTPUT...
You have to use :
LOOP AT SCREEN...
<screen field>-input = 1; Input input-enabled field
<screen field>-output = 1; Output display field
ENDLOOP.
For more details on Loop at screen, refer sap help...
Reward if useful...
Regards
Shiva
‎2008 May 16 8:08 AM
As mentioned in my earlier post, your requirement will not be possible without any user intervention like chosing the radiobutton, checkbox, or Enter..
If u wnt to use enter you can go with this code, but you have to Press ENTER after entering the value in either of the fields..
PARAMETER : p_one(10) TYPE c.
PARAMETER : p_two(10) TYPE c.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF NOT p_one IS INITIAL.
IF screen-name = 'P_TWO'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ELSEIF NOT p_two IS INITIAL.
IF screen-name = 'P_ONE'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.Regards
Gopi
P.S: Avoid using duplicate threads
‎2008 May 16 9:54 AM
‎2008 May 16 8:09 AM
HI,
enter the value in first field and press enter then the second field will get disappeared.if the first field is empty the second field will stay as it is.
check this code.
PARAMETERS:mat LIKE mara-matnr,
mtyp like mara-mtart.
DATA:flag.
AT SELECTION-SCREEN on mat.
IF mat is NOT INITIAL.
flag = 1.
ELSE.
flag = 0.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
IF flag = 1.
LOOP AT SCREEN.
IF screen-name = 'MTYP' or screen-name = '%_MTYP_%_APP_%-TEXT'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
rgds,
bharat.