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: 

Question of field with input disabled

Former Member
0 Kudos
606

Hi all,

I had a requirement where one of my field need to be disables (user not permitted to key in anything) but there are a searh help attached to this fields and the entry to this field is only possible after the search help selection. Is this possible? Since I have tried to set the field to not possible at the screen painter and once the Search Help is attached, I couldn't select anything from the search help.

My question is, is it possible for a field with no input possible (manual input) but with a search help (input is only possible through Search Help).

THanks in advance.

10 REPLIES 10

Former Member
0 Kudos
72

Hi Mil,

I don't think it is possible.

I haven't seen any such field till date.

Regards,

Atish

Former Member
0 Kudos
72

Hi Mil ,

I dont think it is possible in the case of search help , what i would suggest is try adding a drop down , so that the user is able to select only from that drop down.

Regards

Arun

0 Kudos
72

How can I implement a drop down?

0 Kudos
72

hi Mil,

To implement drop down you need to define the field as list box.

Reward points if useful.

Regards,

Atish

0 Kudos
72

Hi,

to implement drop down see the standard program DEMO_DYNPRO_DROPDOWN_LISTBOX .

regards,

Ruchika

reward if useful.............

0 Kudos
72

Hi Mil ,

First for the element you want the drop down , change the properties of the element in the screen painter.

Set <b>VALUE LIST</b> as <b>A</b>

In the PBO of the screen you need to select the valid set of values for the range and then assign it as a dropdown using the FM

'VRM_SET_VALUES'.

Hope this helps , do feel free to revert back in case of any queries.

Assign points if helpful.

Regards

Arun

0 Kudos
72

I got another question. In my screen, I have 2 fields, A & B. The dropdown list (field B) is determine by the value in another field (field A), thus it looks like a dynamic dropdown. Thanks in advance.

0 Kudos
72

Hi,

there's a few ways. The easiest is to refer to a dictionary field, then you can automatically inherit the dropdown if one exists .

eg

parameters p_matnr like mara-matnr.

Another way is to populate a table and use an fm, 'F4IF_INT_TABLE_VALUE_REQUEST':

eg,

initializaton.

SELECT * FROM z903

join tfdir on tfdirfuncname = z903ztext

INTO CORRESPONDING FIELDS OF TABLE t_z903

WHERE type = 'LOG'.

SORT t_z903.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_func-low.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ZTEXT'

dynprofield = 'S_FUNC'

dynpprog = sy-cprog

dynpnr = sy-dynnr

value_org = 'S'

TABLES

value_tab = t_z903.

go thorugh this link

http://www.sapdesignguild.org/resources/MiniSG/2_Layout/2_Dropdown_Listbox.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm

http://www.sap-img.com/ab012.htm

<b>Reward points</b>

Regards

0 Kudos
72

In response to the original question, it is possible with a searchhelp as the code below demonstrates... the "trick" is the F to force the searchhelp to display this way.


report zlocal_f4_on_locked_field.

*=======================================================================
* Selection screen
*=======================================================================
parameters:
  p_ebeln           like ekpo-ebeln.

*=======================================================================
* Events
*=======================================================================
at selection-screen output.
  perform lock_fields.
  set cursor field 'P_EBELN'.

at selection-screen on value-request for p_ebeln.
  perform f4_help_for_field.

*&---------------------------------------------------------------------*
*&      Form  lock_fields
*&---------------------------------------------------------------------*
form lock_fields.
* Force all fields to output only
  loop at screen.
    if screen-name = 'P_EBELN'.
      screen-input = '0'.
      modify screen.
      exit.
    endif.
  endloop.
endform.                    "lock_fields

*&---------------------------------------------------------------------*
*&      Form  f4_help_for_field
*&---------------------------------------------------------------------*
form f4_help_for_field.
* Call date help directly

  data:
    l_fldval            like help_info-fldvalue,
    l_repid             like sy-repid,
    l_dynnr             like sy-dynnr,
    lt_return           like ddshretval occurs 1,
    ls_dynpread         like dynpread,
    lt_dynpread         like dynpread occurs 1.

  l_repid = sy-repid.
  l_dynnr = sy-dynnr.
*
* Use F=Force to make the list selectable..
*
* Bei DISPLAY = 'F' wie FORCE, wird auch dann zurückgestellt,
* wenn das Feld auf dem Dynpro nicht eingabebereit ist.
*
  call function 'F4IF_FIELD_VALUE_REQUEST'
    exporting
      tabname           = space
      fieldname         = space
      searchhelp        = 'MEKK'
      dynpprog          = l_repid
      dynpnr            = l_dynnr
      dynprofield       = 'P_EBELN'
      stepl             = 0
      value             = l_fldval
      display           = 'F'   "Force
    tables
      return_tab        = lt_return
    exceptions
      field_not_found   = 1
      no_help_for_field = 2
      inconsistent_help = 3
      no_values_found   = 4
      others            = 5.

  if not sy-subrc is initial.
    message s398(00) with 'Call to Searchhelp failed'
      space space space.
    exit.
  endif.

endform.                    "f4_help_for_field

0 Kudos
72

Wonderful. Thanks Jon.