5 Replies Latest reply: Mar 16, 2010 3:39 PM by Ravikiran Chittum RSS

EXAMPLE FOR FM 'F4IF_INT_TABLE_VALUE_REQUEST'

Gabriel Petrini
Currently Being Moderated

Hi,

 

Does you have any example of the fm 'F4IF_INT_TABLE_VALUE_REQUEST' using the parameters tables FIELD_TAB and DYNPFLD_MAPPING?????

 

 

answers will be regarded!

 

Tks in advance!

 

Gabriel

  • Re: EXAMPLE FOR FM 'F4IF_INT_TABLE_VALUE_REQUEST'
    Sourav Bhaduri
    Currently Being Moderated

    This sample program demonstrate how to create "Help Value Request". It will appear when user pressing F4 (help) on an input field to request list of available value.

     

    To do this we are using function module F4IF_INT_TABLE_VALUE_REQUEST. It provide help value request with following feature:

    1. single / multiple choice.

    2. update screen without PBO, so it can be used to update more than one field on one request.

     

    Here is the code:

     

    
    
    REPORT ztest123 .
    
    TABLES: usr02.
    
    parameters: p_bname LIKE usr02-bname,
    p_class LIKE usr02-class.
    
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bname.
    PERFORM f_valuerequest_vbeln.
    *&---------------------------------------------------------------------*
    *& Form f_valuerequest_vbeln
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * --> p1 text
    * <-- p2 text
    *----------------------------------------------------------------------*
    FORM f_valuerequest_vbeln.
    
    DATA: BEGIN OF t_data OCCURS 1,
    data(20),
    END OF t_data.
    
    DATA: lwa_dfies TYPE dfies.
    
    data h_field_wa LIKe dfies.
    data h_field_tab like dfies occurs 0 with header line.
    data h_dselc like dselc occurs 0 with header line.
    
    SELECT * FROM usr02.
    t_data = usr02-bname. APPEND t_data.
    t_data = usr02-class. APPEND t_data.
    ENDSELECT.
    
    PERFORM f_fieldinfo_get USING 'USR02'
    'BNAME'
    CHANGING h_field_wa.
    APPEND h_field_wa TO h_field_tab.
    PERFORM f_fieldinfo_get USING 'USR02'
    'CLASS'
    CHANGING h_field_wa.
    APPEND h_field_wa TO h_field_tab.
    
    h_dselc-fldname = 'BNAME'.
    h_dselc-dyfldname = 'P_BNAME'.
    APPEND h_dselc.
    h_dselc-fldname = 'CLASS'.
    h_dselc-dyfldname = 'P_CLASS'.
    APPEND h_dselc.
    
    DATA: ld_repid LIKE sy-repid.
    ld_repid = sy-repid.
    
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'P_BNAME'
    dynpprog = ld_repid
    dynpnr = '1000'
    dynprofield = 'P_BNAME'
    * multiple_choice = ''
    * value_org = 'S'
    TABLES
    value_tab = t_data
    field_tab = h_field_tab
    * return_tab = return_tab
    DYNPFLD_MAPPING = h_dselc
    EXCEPTIONS
    OTHERS = 0.
    
    ENDFORM. " f_valuerequest_vbeln
    *&---------------------------------------------------------------------*
    *& Form f_fieldinfo_get
    *&---------------------------------------------------------------------*
    * text
    *----------------------------------------------------------------------*
    * -->P_0079 text
    * -->P_0080 text
    * <--P_H_FIELD_WA text
    *----------------------------------------------------------------------*
    FORM f_fieldinfo_get USING fu_tabname
    fu_fieldname
    CHANGING fwa_field_tab.
    
    
    CALL FUNCTION 'DDIF_FIELDINFO_GET'
    EXPORTING
    TABNAME = fu_tabname
    FIELDNAME = fu_fieldname
    LFIELDNAME = fu_fieldname
    IMPORTING
    DFIES_WA = fwa_field_tab
    EXCEPTIONS
    NOT_FOUND = 1
    INTERNAL_ERROR = 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.
    
    
    ENDFORM. " f_fieldinfo_get
    

     

  • Re: EXAMPLE FOR FM 'F4IF_INT_TABLE_VALUE_REQUEST'
    asmitha dghsdgf
    Currently Being Moderated

    Hi,

     

    Hi,

     

    Please refer the code below:

     

    DATA: return TYPE TABLE OF ddshretval WITH HEADER LINE.

     

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

    SELECT WERKS NAME1 INTO CORRESPONDING FIELDS OF TABLE KUNNSO_ITAB FROM T001W.

    DELETE ADJACENT DUPLICATES FROM KUNNSO_ITAB.

     

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    RETFIELD = 'WERKS'

    DYNPPROG = SY-REPID

    DYNPNR = SY-DYNNR

    DYNPROFIELD = 'S_WERKS'

    VALUE_ORG = 'S'

    multiple_choice = 'X'

    TABLES

    VALUE_TAB = KUNNSO_ITAB

    return_tab = return.

     

    IF SY-SUBRC 0.

    SORT return BY fieldval DESCENDING.

    LOOP AT return.

    S_WERKS-low = return-fieldval.

    S_WERKS-option = 'EQ'.

    S_WERKS-sign = 'I'.

    S_WERKS-high = space.

    APPEND S_WERKS.

    ENDLOOP.

     

    SORT S_WERKS BY low.

    ENDIF.

     

    Regards,

    Asmitha.

  • Re: EXAMPLE FOR FM 'F4IF_INT_TABLE_VALUE_REQUEST'
    Vishal Bhave
    Currently Being Moderated

    Hi,

     

    Below is the example:

     

     

       

    CLEAR wa_dynpread.
      wa_dynpread-fieldname = 'ZCAN_HDR-PLANT'.
      APPEND wa_dynpread TO it_dynpread.
    
      CALL FUNCTION 'DYNP_VALUES_READ'
      EXPORTING
        dyname                               = sy-repid
        dynumb                               = sy-dynnr
    *   TRANSLATE_TO_UPPER                   = ' '
    *   request                              = 'A'
    *   PERFORM_CONVERSION_EXITS             = ' '
    *   PERFORM_INPUT_CONVERSION             = ' '
    *   DETERMINE_LOOP_INDEX                 = ' '
    *   START_SEARCH_IN_CURRENT_SCREEN       = ' '
    *   START_SEARCH_IN_MAIN_SCREEN          = ' '
    *   START_SEARCH_IN_STACKED_SCREEN       = ' '
    *   START_SEARCH_ON_SCR_STACKPOS         = ' '
    *   SEARCH_OWN_SUBSCREENS_FIRST          = ' '
    *   SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
      TABLES
        dynpfields                           = it_dynpread
    EXCEPTIONS
     invalid_abapworkarea                 = 1
     invalid_dynprofield                  = 2
     invalid_dynproname                   = 3
     invalid_dynpronummer                 = 4
     invalid_request                      = 5
     no_fielddescription                  = 6
     invalid_parameter                    = 7
     undefind_error                       = 8
     double_conversion                    = 9
     stepl_not_found                      = 10
     OTHERS                               = 11
              .
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    
      CLEAR wa_dynpread.
    
      READ TABLE it_dynpread INTO wa_dynpread WITH KEY fieldname = 'ZCAN_HDR-PLANT'.
    
      IF sy-subrc = 0.
    
        SELECT hawb_bl_no plant exbond_no doc_type cha_agent
        FROM zcan_cha INTO TABLE it_hawb
        WHERE plant = wa_dynpread-fieldvalue.
    
      ENDIF.
    
      REFRESH it_dynpread.
    
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
    *   DDIC_STRUCTURE         = ' '
          retfield               = 'HAWB_BL_NO'
    *   PVALKEY                = ' '
         dynpprog               = sy-cprog
         dynpnr                 = sy-dynnr
         dynprofield            = 'ZCAN_HDR-HAWB_BL_NO'
    *   STEPL                  = 0
    *   WINDOW_TITLE           =
    *   VALUE                  = ' '
         value_org              = 'S'
    *   MULTIPLE_CHOICE        = ' '
    *   DISPLAY                = ' '
    *   CALLBACK_PROGRAM       = ' '
    *   CALLBACK_FORM          = ' '
    *   MARK_TAB               =
    * IMPORTING
    *   USER_RESET             =
        TABLES
          value_tab              = it_hawb
    *   FIELD_TAB              =
    *   RETURN_TAB             =
    *   DYNPFLD_MAPPING        =
    * 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.

     

  • Re: EXAMPLE FOR FM 'F4IF_INT_TABLE_VALUE_REQUEST'
    mehmet ali aslanbay
    Currently Being Moderated

    Hi All,

     

    here is the code for Searc Help

     

    
      CLEAR : lt_group,lt_group[],
      field_tab,field_tab[].
    
      IF rebd_rental_object_ci-zzcategory IS NOT INITIAL.
    
        SELECT * FROM zre_rentgroupt INTO CORRESPONDING FIELDS OF TABLE
        lt_group  WHERE spras = sy-langu
          AND zre_categ_link = rebd_rental_object_ci-zzcategory.
    
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
         EXPORTING
    *   DDIC_STRUCTURE         = ' '
           retfield               = 'ZRE_GROUP'   "field of internal table
            value_org              = 'S'
            dynpprog = sy-repid
            dynpnr = sy-dynnr
         TABLES
           value_tab              = lt_group
    *   FIELD_TAB              =
          return_tab             = it_return
                 .
    
        IF it_return IS NOT INITIAL  .
          WRITE it_return-fieldval TO rebd_rental_object_ci-zzgroup.
        ENDIF.
    
        CLEAR :it_return,it_return[].
    
      ENDIF.
    
    *************************
    DATA: BEGIN OF lt_group OCCURS 0 ,
    zre_group TYPE      zre_group,
    zre_groupt   TYPE zre_groupt,
    END OF lt_group.
    
     

     

  • Re: EXAMPLE FOR FM 'F4IF_INT_TABLE_VALUE_REQUEST'
    Ravikiran Chittum
    Currently Being Moderated

    Hi,

     

    Refer to below links -

     

    [Chain F4 help|http://www.divulgesap.com/blog.php?p=Njk=]

     

    [F4 help selecting multiple lines|http://www.divulgesap.com/blog.php?p=NzQ=]

     

     

    Hope these links are useful.

     

    Thanks.

     

    Ravi

  • Re: EXAMPLE FOR FM 'F4IF_INT_TABLE_VALUE_REQUEST'
    swagi chirakkal
    Currently Being Moderated

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR difflev.

      DATA: BEGIN OF it_difflevel OCCURS 0,

               difflevel LIKE zquestions-lev,

            END OF it_difflevel.

     

    DATA: t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

     

    • Read dificulty level from table zquestions-lev

      SELECT DISTINCT lev FROM zquestions INTO TABLE it_difflevel.

      CLEAR it_difflevel.

     

    • SORT it_difflevel BY difflevel.

     

      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

        EXPORTING

    •   DDIC_STRUCTURE         = ' '

          retfield               = 'LEV' "Key field from it_difflevel

    •   PVALKEY                = ' '

       dynpprog               = sy-cprog  "Program

       dynpnr                 = sy-dynnr "Dynpro number

       dynprofield            = 'DIFFLEV ' "Select-options field

    •   STEPL                  = 0

    •   WINDOW_TITLE           =

    •   VALUE                  = ' '

       value_org              = 'S' "Value return: C: cell by cell,

                                    "S: structured

    •   MULTIPLE_CHOICE        = ' '

       display                = 'F' "Override readiness for input

    •   CALLBACK_PROGRAM       = ' '

    •   CALLBACK_FORM          = ' '

    •   MARK_TAB               =

    • IMPORTING

    •   USER_RESET             =

        TABLES

          value_tab           = it_difflevel "table with selection values

    •   field_tab              = field_tab

       return_tab             = t_return "Return value

    •   DYNPFLD_MAPPING       =

    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.