Skip to Content
author's profile photo Former Member
Former Member

How to make input field non-editable through search help?

Hi,

I want to make field non-editable through search help. But my search help is not hitting the non-editable field.

There are 4 fields which are populated through search help, but first 2 fields are populated which are editable but remaining 2 fields which are non-editable they are not populated.

I have searched on SCN but I have not found any workaround condition in detailed.

Please suggest work around solution in detail.

Thank You.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Apr 19, 2016 at 05:37 AM

    Try below sample code:

    PARAMETERS: P_MATNR LIKE MARA-MATNR.

    DATA F4.

    INITIALIZATION.

    LOOP AT SCREEN.

    IF SCREEN-NAME = 'P_MATNR'.

    SCREEN-INPUT = '0'.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

    DATA: TABNAME TYPE DFIES-TABNAME,

    FIELDNAME TYPE DFIES-FIELDNAME.

    DATA T_VALUE TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.

    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

    EXPORTING

    TABNAME = TABNAME

    FIELDNAME = FIELDNAME

    SEARCHHELP = 'MAT1'

    TABLES

    RETURN_TAB = T_VALUE

    EXCEPTIONS

    FIELD_NOT_FOUND = 1

    NO_HELP_FOR_FIELD = 2

    INCONSISTENT_HELP = 3

    NO_VALUES_FOUND = 4

    OTHERS = 5.

    IF SY-SUBRC <> 0.

    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ELSE.

    READ TABLE T_VALUE INDEX 1.

    P_MATNR = T_VALUE-FIELDVAL.

    F4 = 'x'.

    SET SCREEN 1000. LEAVE SCREEN.

    ENDIF.

    AT SELECTION-SCREEN OUTPUT.

    IF F4 = 'x'.

    LOOP AT SCREEN.

    SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ENDLOOP.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 27, 2016 at 05:30 AM

    Be careful, you should be clear in your question, not too much theoretical. If I understand well, you don't need any ABAP.

    You have generated a table/view maintenance dialog for a given custom table(s).

    For every line, you have 2 input fields, and 2 output fields. Where do these 2 output fields come from? (I guess these are fields which do not belong to the maintained table, but these are text fields coming from a text table(s))

    When you press F4 on these 2 input fields, you want the 2 output fields being filled.

    For this scenario, you can achieve this using a view of type "maintenance view", by joining the main table, and the text table(s) (note: it is/they are to be connected to the main table via foreign key(s) in the main table, of type "text table"). In this view, you define the text fields of type "display only".

    You generate a dialog for this maintenance view.

    If it's another scenario, please clarify.

    PS: in any case, via a search help, and without any ABAP, you may press F4 on an input field, and based on the selected value, the output field can be automatically filled out.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 19, 2016 at 05:17 AM

    Hi,

    Your requirement is not clear ,

    u mean to say , when u press F4 button u r not able to see search help list ?

    Regards,

    Sabir Shah.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 19, 2016 at 05:41 AM

    Hi,

    If the field is in editable mode the f4 help values will not populated.

    The F4 help values are populated only in editable mode.

    Regards,

    Mahesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.