04-08-2008 3:37 PM
Hai Sdn members,
i have two fields in the screen both the fields are having search helps only these search help values should be allowed on screen if we enter other then searc help values it should show an error. and both the search helps are created based on two predifened tables.and added on the screen.
04-08-2008 3:58 PM
04-09-2008 12:24 PM
04-09-2008 12:31 PM
from your PBO module this type of routine.
*&---------------------------------------------------------------------*
*& Module init_0110 OUTPUT
*&---------------------------------------------------------------------*
MODULE init_0110 OUTPUT.
REFRESH ltype_result. CLEAR ltype_result.
* Drop down values
SELECT ltype ltypex
INTO TABLE ltype_result
FROM zlmltyp
WHERE auth NE '9'. "System Only
* Field name to assign drop down values
ltype_field = 'WK_LTYPE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = ltype_field
values = ltype_result
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
IF prev_ltype NE wk_ltype.
CLEAR: wk_status.
ENDIF.
REFRESH lstat_result. CLEAR lstat_result.
* Drop down values
SELECT status statx
INTO TABLE lstat_result
FROM zlmstyp
WHERE ltype = wk_ltype
AND auth NE '9'. "System Only
* OR status = zlmlead-status ).
SORT lstat_result.
* Field name to assign drop down values
lstat_field = 'WK_STATUS'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = lstat_field
values = lstat_result
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
prev_ltype = wk_ltype.
ENDMODULE. " init_0110 OUTPUT
In your Global area (usually your _TOP include
TYPE-POOLS vrm.
DATA: ltype_field TYPE vrm_id,
ltype_result TYPE STANDARD TABLE OF vrm_value,
ltype_val LIKE LINE OF ltype_result.
DATA: atype_field TYPE vrm_id,
atype_result TYPE STANDARD TABLE OF vrm_value,
atype_val LIKE LINE OF ltype_result.
DATA: lstat_field TYPE vrm_id,
lstat_result TYPE STANDARD TABLE OF vrm_value,
lstat_val LIKE LINE OF lstat_result.
DATA: wk_ltype LIKE zlmlead-ltype,
prev_ltype LIKE zlmlead-ltype,
wk_status LIKE zlmlead-status.
Lastly on the field attributes in Screen Painter indicate that the Search Help comes from your Program.
04-08-2008 4:11 PM
Hi,
in your PAI event you have to work with
FIELD yourfield MODULE yourmodule
in YOURMODULE you have to prove the entered value with your table. Eventually you might work with CHAIN.
04-08-2008 10:44 PM
You could lock both fields so they are output only and use the "force" trick I've included at the end of the following thread to allow selection in display fields via searchhelps:
Otherwise, if you want input fields, just validate the field values entered in your PAI logic to prevent bad entries.
Jonathan
04-09-2008 8:13 AM
For This type of requirement ,you have to use list box insted of search help and use the FM 'F4IF_INT_TABLE_VALUE_REQUEST' to populate the data in your list box. Then the user can only select a value from list box.