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

ME51n F4 help for field AFNAM

hi,

I have a requirement to add f4 help for standard t-code me51 for the field AFNAM ( Requisitioner ). f4 should be based on view values ( maintainence view ) .I got access key for doing this.

i tried changing it in the table control by adding search help for field , it didnt reflect in the screen and also tried through POV also which didnt reflect.

Can any one tell how to get this F4 Help AFNAM for me51n .

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 08, 2014 at 10:10 AM

    hi,

    It is possible using enchancements without accesskey. Following are the steps to achieve this without using accesskey.

    Step 1:

    Goto Tcode : SE 38

    Include : LMEGUICJM

    ***Adding Coding - Before Endmethod ( METHOD get_fields_for_f4 -- ENDMETHOD )

    ENHANCEMENT 1 ZME51N_F4_HELP3.

    “for making f4 symbol available in the field afnam

    if sy-TCODE = 'ME51N' OR SY-TCODE = 'ME52N' OR SY-TCODE = 'ME53N'.

    lmac_upd_then_ins 'AFNAM' 'X'.

    ENDIF.

    ENDENHANCEMENT.

    Step 2:

    Goto Tcode : SE 38 - Include : LMEGUICJM

    ********* Adding Coding - Before Endmethod ( METHOD handle_f4 -- ENDMETHOD )

    ENHANCEMENT 1 ZME51N_F4_HELP_V1. "active version

    DATA : l_AFNAM TYPE mereq3211grid-AFNAM.

    CASE e_fieldname.

    WHEN 'AFNAM'.

    CALL FUNCTION 'ZHELP_VALUES_AFNAM'

    EXPORTING

    I_PROGRAM = PROG

    I_DYNNR = DYNPRO

    IMPORTING

    E_AFNAM = L_AFNAM .

    IF sy-subrc IS INITIAL AND l_ch EQ mmpur_yes.

    ls_modi-value = l_AFNAM.

    ENDIF.

    IF NOT ls_modi IS INITIAL.

    ASSIGN er_event_data->m_data->* TO <fs_t_modi>.

    ls_modi-row_id = es_row_no-row_id.

    ls_modi-fieldname = e_fieldname.

    APPEND ls_modi TO <fs_t_modi>.

    ENDIF.

    ENDCASE.

    ENDENHANCEMENT.

    Step 3:

    Goto Tcode : SE 37 - Create Zfunction module

    ZHELP_VALUES_AFNAM

    Source Code

    ************* Source Code for Function module - ZHELP_VALUES_AFNAM *******

    FUNCTION ZHELP_VALUES_AFNAM.

    *"----------------------------------------------------------------------

    *"*"Local Interface:

    *" IMPORTING

    *" VALUE(I_PROGRAM) LIKE SY-CPROG

    *" VALUE(I_DYNNR) LIKE SY-DYNNR

    *" VALUE(I_AFNAM) LIKE EBAN-AFNAM OPTIONAL

    *" EXPORTING

    *" VALUE(E_AFNAM) LIKE EBAN-AFNAM

    *"----------------------------------------------------------------------

    TABLES: T024W.

    DATA: LV_VALUE TYPE CHAR10.

    DATA : LV_FLAG(1).

    DATA: BEGIN OF I_DYNPREAD OCCURS 10.

    INCLUDE STRUCTURE DYNPREAD.

    DATA: END OF I_DYNPREAD.

    DATA: BEGIN OF FULL_TABLE_WERKS OCCURS 0,

    AFNAM TYPE ZAFNAM_F4-AFNAM,

    TEXT TYPE ZAFNAM_F4-TEXT,

    END OF FULL_TABLE_WERKS.

    DATA: T_RETURN LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.

    CLEAR : LV_FLAG.

    IF I_AFNAM IS INITIAL.

    REFRESH I_DYNPREAD.

    CLEAR I_DYNPREAD.

    I_DYNPREAD-FIELDNAME = 'MEREQ3211GRID-AFNAM'.

    APPEND I_DYNPREAD.

    CALL FUNCTION 'DYNP_VALUES_READ'

    EXPORTING

    DYNAME = I_PROGRAM

    DYNUMB = I_DYNNR

    TABLES

    DYNPFIELDS = I_DYNPREAD

    EXCEPTIONS

    OTHERS = 1.

    IF SY-SUBRC EQ 0.

    READ TABLE I_DYNPREAD INDEX 1.

    LV_VALUE = I_DYNPREAD-FIELDVALUE.

    ELSE.

    LV_FLAG = 'X'.

    ENDIF.

    ENDIF.

    IF LV_FLAG = 'X'.

    SELECT ABTNR VTEXT FROM TSABT

    INTO TABLE FULL_TABLE_WERKS

    WHERE SPRAS = 'EN'.

    SORT FULL_TABLE_WERKS.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    RETFIELD = 'AFNAM'

    VALUE_ORG = 'S'

    TABLES

    VALUE_TAB = FULL_TABLE_WERKS

    RETURN_TAB = T_RETURN[]

    EXCEPTIONS

    OTHERS = 1.

    READ TABLE T_RETURN INDEX 1.

    IF SY-SUBRC = 0.

    READ TABLE FULL_TABLE_WERKS WITH KEY AFNAM

    = T_RETURN-FIELDVAL BINARY SEARCH.

    E_AFNAM = FULL_TABLE_WERKS-AFNAM.

    ENDIF.

    ENDIF.

    ENDFUNCTION.

    Step 4:

    Goto Tcode : SE 37 - F4IF_FIELD_VALUE_REQUEST

    ****** Add coding - Function Module - F4IF_FIELD_VALUE_REQUEST *********

    ********** First line of Source code **********

    ENHANCEMENT 1 ZF4_FUN_MOD_CS. "active version

    DATA : LV_SEARCH_NAME TYPE CHAR25.

    BREAK ABAP.

    IF SY-TCODE = 'ME51N' OR SY-TCODE = 'ME52N' OR SY-TCODE = 'ME53N'.

    CLEAR : LV_SEARCH_NAME.

    IF fieldname = 'AFNAM'.

    LV_SEARCH_NAME = 'TSABT'.

    searchhelp = LV_SEARCH_NAME.

    ENDIF.

    ENDIF.

    ENDENHANCEMENT.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 25, 2014 at 10:32 AM

    You need to change only at the Data Element level.

    Create a Search Help assign it with your view and assign this Search help at Data Element level.

    This will help.

    Had a similar requirement long back.

    Thereafter it will appear wherever that Data Element is referred directly or indirectly.

    So eventually you don't even need to bother for F4 help in Select Options of AFNAM at Purchase Requisition related reports like ME5A.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 25, 2014 at 11:35 AM

    Hi,

    First you need to create a search help as per your requirement.

    Then attach it to the screen field.

    For T-Code ME51:

    1. Go to Screen painter ( TCode SE51 )
    2. Open screen number 0100 of program SAPMM06B.
    3. Double click on the Requistioner input box to open the properties of the field.
    4. In the attributes section you will find the field Search Help , enter name of the search help you created above.
    5. Save and activate the screen.
    6. Done.
    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      That will not reflect for AFNAM everywhere. I told you the solution specific to the TCODE ME51, it will only reflect everywhere if you attach it in the DDIC and not on screen.

      But if you need solution for ME51N then it a different procedure. will get back to you with it in a while.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 26, 2014 at 12:47 PM

    hi ashish,

    Its me51n only. Ok will try this and let u know .

    Thanks.

    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.