Skip to Content
avatar image
Former Member

Implement F4 help for AFNAM(Requested By) field of Item Overview for transaction ME51n

Hi Experts,

I need to Implement F4 help for AFNAM(Requested By) field of Item Overview for transaction ME51n - create purchase requisition.

Steps to identify the field:

-> Open T-code - ME51n

-> Expand Item overview

-> One table will be displayed, will see one field Requested By - Technical Name (AFNAM)

-> Requirement is to add F4 help on this.

PFA the screenshot and suggest what should be the approach to do this.

ME51n.PNG (47.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Sep 16, 2015 at 07:17 AM

    Hi,

    You can use below code. Have a look on below attached image

    Do Some changes as per your requirement.

    May be so many ways are exists like creating search help  by implementing the match code object in your code.

    or some other way.  the below is one of the possible way.

    TABLES : EBAN.

    SELECT-OPTIONS: S_MATNR FOR EBAN-MATNR.

    TYPES: BEGIN OF TT,

            BANFN  TYPE EBAN-BANFN,

            AFNAME TYPE EBAN-AFNAM,

            END OF TT.

    DATA: IT_TT TYPE TABLE OF TT,

           WA_TT TYPE TT.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_MATNR-LOW.

       SELECT BANFN AFNAM  FROM EBAN INTO TABLE IT_TT. "WHERE BDART EQ 'AR' and  BWART IN ('261','262') ORDER BY AUFNR.

       IF SY-SUBRC = 0.

         CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

           EXPORTING

             RETFIELD        = 'AFNAME'

             DYNPPROG        = 'ZPRAC11'

             DYNPNR          = SY-DYNNR

             DYNPROFIELD     = 'S_SCREEN'

             VALUE_ORG       = 'S'  "Mandatory

           TABLES

             VALUE_TAB       = IT_TT

           EXCEPTIONS

             PARAMETER_ERROR = 1

             NO_VALUES_FOUND = 2

             OTHERS          = 3.

         IF SY-SUBRC <> 0.

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

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

         ENDIF.

       ENDIF.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_MATNR-HIGH.

       SELECT BANFN AFNAM  FROM EBAN INTO TABLE IT_TT. "WHERE BDART EQ 'AR' and  BWART IN ('261','262') ORDER BY AUFNR.

       IF SY-SUBRC = 0.

         CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

           EXPORTING

             RETFIELD        = 'AFNAME'

             DYNPPROG        = 'ZPRAC11'

             DYNPNR          = SY-DYNNR

             DYNPROFIELD     = 'S_SCREEN'

             VALUE_ORG       = 'S'  "Mandatory

           TABLES

             VALUE_TAB       = IT_TT

           EXCEPTIONS

             PARAMETER_ERROR = 1

             NO_VALUES_FOUND = 2

             OTHERS          = 3.

         IF SY-SUBRC <> 0.

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

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

         ENDIF.

       ENDIF.


    BANFN.png (87.6 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Sep 16, 2015 at 07:25 AM

    Hi Akshay,

    I suggest you to go with field exit but only at last option if you are not getting an alternate(because this is absolute Now).

    1)   Create a field exit on data element AFNAM.

    2)   Use the exit space to fetch F4 possible entries.

    2)   Call FM 'F4IF_INIT_TABLE_VALUE_REQUEST'.

    Regards,

    Shadab.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 16, 2015 at 08:04 AM

    hi,

    Have a look on below thread.

    http://scn.sap.com/message/1023951#1023951

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Changing data element of Table - EBAN field AFNAM require access key to implement and that i know how to do that. But is there any other alternative way ??