Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding input in screens

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

Selection screen or Dialog?

0 Kudos

it si dia log programming

0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.