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: 

F4 display upon value request - values to be selected

Former Member
0 Kudos

Hello experts,

I have an issue here. When the function module F4IF_INT_TABLE_VALUE_REQUEST is used in my program for displaying the PSTYV field values on the selection screen upon value request. Now, when the popup opens there are 53 number of item categories, i.e., from VBRP table. If any one of them is selected and double clicked, they should be selected as per the conventional idea, but nothing is being selected after double clicking. How to achieve this ?  The following is my code.

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

SELECT DISTINCT PSTYV
  FROM VBRP
  INTO TABLE GT_PSTYV.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
    retfield               = 'PSTYV'
   VALUE_ORG              = 'S'
  tables
    value_tab              = GT_PSTYV
   RETURN_TAB             = GT_RETURN
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.
ENDI
F.

Thanks and regards,

Ambareesh J.

1 ACCEPTED SOLUTION

former_member188827
Active Contributor
0 Kudos

Try passing parameters dynpprog dynppr and dynprofield as below:

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       retfield        = 'PSTYV'

       value_org       = 'S'

      dynpprog        = sy-cprog

       dynpnr          = sy-dynnr

       dynprofield     = 'SO_PSTYV-LOW'

     TABLES

       value_tab       = gt_pstyv

       return_tab      = gt_return

     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.



Regards

6 REPLIES 6

former_member188827
Active Contributor
0 Kudos

Try passing parameters dynpprog dynppr and dynprofield as below:

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

     EXPORTING

       retfield        = 'PSTYV'

       value_org       = 'S'

      dynpprog        = sy-cprog

       dynpnr          = sy-dynnr

       dynprofield     = 'SO_PSTYV-LOW'

     TABLES

       value_tab       = gt_pstyv

       return_tab      = gt_return

     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.



Regards

0 Kudos

Thank you Mehwish,

I was actually trying with sy-repid in dynpprog instead of sy-cprog. Very helpful. I appreciate your help.

Thanks and regards,

Ambareesh J.

Mohamed_Mukhtar
Active Contributor
0 Kudos

Hello Ambaressh,

Please add the below piece of code after "endif".


READ TABLE gt_return INTO wa_return INDEX 1.
   CHECK sy-subrc = 0.
   READ TABLE gt_pstyv WITH KEY pstyv = wa_return-fieldval.
   CHECK sy-subrc = 0.
    SO_PSTYV-LOW = wa_return-fieldval.

Thanks

mayur_priyan
Active Participant
0 Kudos

Check the following code.

TABLES: VBAK.

DATA: BEGIN OF T_VBELN OCCURS 0,

      VBELN TYPE VBAK-VBELN,

      END OF T_VBELN.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.

  SELECT-OPTIONS: S_SCREEN FOR VBAK-VBELN.

SELECTION-SCREEN END OF BLOCK B1.

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

SELECT VBELN FROM VBAK INTO TABLE T_VBELN.

IF SY-SUBRC = 0.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

      retfield                       = 'VBELN'

     DYNPPROG               = 'ZTRIAL'

     DYNPNR                    = SY-DYNNR

     DYNPROFIELD           = 'S_SCREEN'

     VALUE_ORG              = 'S'  "Mandatory

    tables

      value_tab                   = T_VBELN

   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.

former_member202818
Active Contributor
0 Kudos

You haven't mentioned to which field the selected data to be get assigned.

For the system to identify the particular field in screen, you must provide the details below.

       dynpprog                   = SY-CPROG

        dynpnr                     = SY-DYNNR

        dynprofield                = 'G_FIELD'      "Screen filed, to which F4 attached

Former Member
0 Kudos

I appreciate all your help. Thank you so much.

Regards,

Ambareesh J.