11-18-2005 6:31 AM
Hi,
I want to attach value help to a field. I also want to make that field as non-editable so that the user chooses only from F4 help. So i made an input field as non-editable and attached a F4 help to it. But when i try to choose value from the F4 help, it is not filling in the input field. Can some one help me with this.
Thanks and Regards,
Chander
11-18-2005 6:39 AM
Hi,
Instead of F4 Help for a parameter,if you made the parameter as listbox you can make the user to select only from the values available.
Here is the sample code.Try this and if it helps you,kindly reward points by clikcing the star on the left of reply.
PROGRAM zcmtest01.
TYPE-POOLS: vrm.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
PARAMETERS: ps_parm(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN OUTPUT.
name = 'PS_PARM'.
value-key = '1'.
value-text = 'Line 1'.
APPEND value TO list.
value-key = '2'.
value-text = 'Line 2'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = name
values = list.
START-OF-SELECTION.
WRITE: / 'Parameter:', ps_parm.
11-18-2005 6:35 AM
Hi,
See the link below.........
http://www.sapdevelopment.co.uk/reporting/alv/alvscr.htm
I hope this will serve your purpose.
Thanks.
11-18-2005 6:39 AM
Hi,
Instead of F4 Help for a parameter,if you made the parameter as listbox you can make the user to select only from the values available.
Here is the sample code.Try this and if it helps you,kindly reward points by clikcing the star on the left of reply.
PROGRAM zcmtest01.
TYPE-POOLS: vrm.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
PARAMETERS: ps_parm(10) AS LISTBOX VISIBLE LENGTH 10.
AT SELECTION-SCREEN OUTPUT.
name = 'PS_PARM'.
value-key = '1'.
value-text = 'Line 1'.
APPEND value TO list.
value-key = '2'.
value-text = 'Line 2'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = name
values = list.
START-OF-SELECTION.
WRITE: / 'Parameter:', ps_parm.
11-18-2005 6:55 AM
Hi,
In the F4 help that i am using the user is shown two columns and he needs to know the value in both these columns to make his selection.So i will not be able to use a list box.
Regards,
Chander
11-18-2005 7:04 AM
Hi,
Just try this and kindly reward points by clicking the star on the left of reply,if it helps.
tables kna1.
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
select-options s_begru for kna1-begru.
at selection-screen on value-request for s_begru-low.
refresh t_values.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
s_begru-low = t_return-fieldval.
endif.
<b>at selection-screen output.
if t_return is initial.
refresh s_begru.
endif.</b>
11-18-2005 7:53 AM
Hi,
This will work if the input field is editable. In my case, i want the input field to be non-editable and the search help should work.
I am not able to do that.
Regards,
Chander
11-18-2005 8:07 AM
Hi,
In my code,the user cannot enter any values apart from the values shown in f4.
If it doesn't meets your requirement,let me know the exact requireemnt
11-18-2005 8:56 AM
Hi,
I am using dialog programming and not selection screens.
I have an input field where the user shouldnot type any value but he should pick up from the F4 help only.
To do this, i made the input field as non-editable.
The F4 help module attached to a non-editable input field doesnt allow me to choose a value.
Regards,
Chander
11-18-2005 9:25 AM
HI Chander,
In Jayanthi's code,
at selection-screen on value-request for s_begru-low.
refresh t_values.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
s_begru-low = t_return-fieldval.
endif.
at selection-screen output.
if t_return is initial.
refresh s_begru.
endif.
Write the code uder
<b>at selection-screen on value-request for s_begru-low.</b>
in a Process on Value request section of the screen .
and the code uder at selection-screen output . by
a module in PBO section of the screen.
Regards,
Ravi
11-18-2005 9:52 AM
Hi,
You cannot make that as non-editable.But here is the way that you can restrict other values in module pool.If you pressed enter after executing this code,then if that value entered is not in f4 help,it will automatically be removed.
PROCESS AFTER INPUT.
FIELD s_begru MODULE abc ON INPUT.
Process on value-request.
field s_begru module f4_help.
REPORT ZZZ_JAYTEST1 .
tables kna1.
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
data s_begru like kna1-begru.
call screen 9000.
module f4_help input.
refresh t_values.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc = 0.
read table t_return index 1.
s_begru = t_return-fieldval.
endif.
endmodule. " f4_help INPUT
module abc input.
read table t_values with key value = s_begru.
if sy-subrc ne 0.
clear s_begru.
endif.
endmodule. " abc INPUT
Kindly let me know if you need further clarification.Otherwise,kindly reward points by clicking the star on the left of reply,if it helps.