F4IF_INT_TABLE_VALUE_REQUEST

Hi All,
I have 2 parameters on my selection screen for which  i have given on value request help using fm F4IF_INT_TABLE_VALUE_REQUEST.
the 2 para are firstname and lastname.when the user press f4 help he can see both first name and last name.
my requirement is when he click on first name the last name paramters shl aslo get filled or when he chose for last name f4 help the first name shld get filled.
how can we achive this.
pls help

Hi pawan,
here a short example how i do it:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FECOD.
  REFRESH: T_QPK1CDTAB.
  CALL FUNCTION 'QPK1_GP_CODE_SELECTION'
       EXPORTING
            I_KATALOGART           = 'C'
            I_CODEGRUPPE           = P_FEGRP
            I_CODE                 = '*'
            I_SPRACHE              = SY-LANGU
            I_PICKUP_MODE          = 'X'
       TABLES
            T_QPK1CDTAB            = T_QPK1CDTAB
       EXCEPTIONS
            NO_MATCH_IN_RANGE      = 1
            NO_USER_SELECTION      = 2
            NO_AUTHORIZATION       = 3
            NO_SELECTION_SPECIFIED = 4
            OBJECT_LOCKED          = 5
            LOCK_ERROR             = 6
            OBJECT_MISSING         = 7
            OTHERS                 = 8.
  READ TABLE T_QPK1CDTAB INDEX 1.
<b>  P_FEGRP = T_QPK1CDTAB-CODEGRUPPE.
  P_FECOD = T_QPK1CDTAB-CODE.
  CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'.</b>*
I set both parameters in the F4. I have 2 F4-Forms for  P_FEGRP and  P_FECOD.
hope it helps.
Regards, Dieter

Similar Messages

  • F4IF_INT_TABLE_VALUE_REQUEST - how can I return all values from the line?

    Hi,
    I'm using FM F4IF_INT_TABLE_VALUE_REQUEST to show a pop-up with my internal table values.  The internal table has 3 fields, ATINN, ATZHL and a description field ATWTB.  ATINN and ATZHL are needed to complete the unique table key, however this FM will only return the value of one field in any line I select.
    How can I see all the values in the line I select in the return table?
    My code is as follows:
      DATA: tbl_cawnt LIKE cawnt OCCURS 0,
            wa_cawnt LIKE cawnt,
            BEGIN OF tbl_list OCCURS 0,
              atinn LIKE cawnt-atinn,
              atzhl LIKE cawnt-atzhl,
              atwtb LIKE cawnt-atwtb,
            END OF tbl_list,
            wa_list LIKE tbl_list,
            tbl_return LIKE ddshretval OCCURS 0,
            wa_return LIKE ddshretval,
            tbl_fields LIKE dfies OCCURS 0,
            tbl_dynp LIKE dselc OCCURS 0.
      REFRESH: tbl_list, tbl_cawnt.
      SELECT atinn atzhl atwtb
        FROM cawnt
        INTO CORRESPONDING FIELDS OF TABLE tbl_cawnt
        WHERE spras EQ sy-langu.
      LOOP AT tbl_cawnt INTO wa_cawnt.
        CLEAR wa_list.
        MOVE: wa_cawnt-atwtb TO wa_list-atwtb,
              wa_cawnt-atinn TO wa_list-atinn,
              wa_cawnt-atzhl TO wa_list-atzhl.
        APPEND wa_list TO tbl_list.
      ENDLOOP.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'ATWTB'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          value_org       = 'S'
        TABLES
          value_tab       = tbl_list
          return_tab      = tbl_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.
    Thanks!

    Hi,
      Use the structure DYNPFLD_MAPPING
    With this internal table you can easily define that you want to return
    other columns of the hit list in addition to field RETFIELD to the
    screen.
    In this IT you can MAP the screen fields to the serch help screen fields this has three fields
    FLDNAME this is the field anme from the search help
    FLDINH This has to be blank which would be field with the field value that you want to map
    DYFLDNAME THis is the screen field name.
    So here you can get the values for the other fields that you want which are on the search help just populate the name of the fields in FLDNAME.
    Regards,
    Himanshu

  • F4IF_INT_TABLE_VALUE_REQUEST with Maximum Number of Hits.

    Hi, all,
    Currently i'm doing a customized F4 help for a selection-option filed on a report by using the function module 'F4IF_INT_TABLE_VALUE_REQUEST'. When i execute my report and go to the selection-option filed just now i created and press F4, i can see a list of data in my search help. However when i go to the tab 'Restrictions', i can't see the 'Maximum No. of Hits' option.
    So anyone have any idea about this? or how to make the 'Maximum No. of Hits' box come out in my F4 help?
    Thanks in advance.

    My full code :-
    TABLES : BSIK , DDSHF4CTRL .
    DATA: BEGIN OF T_ZUONR OCCURS 0,
           ZUONR TYPE BSIK-ZUONR,
          END OF T_ZUONR.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME  TITLE TEXT-001.
    SELECT-OPTIONS   : ASGN_CK FOR BSIK-ZUONR.
    SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR ASGN_CK-LOW.
      SELECT ZUONR FROM BSIK INTO TABLE T_ZUONR.
      SORT T_ZUONR BY ZUONR.
      DELETE ADJACENT DUPLICATES FROM T_ZUONR.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD         = 'DYNR'
          DYNPPROG         = SY-REPID
          DYNPNR           = SY-DYNNR
          VALUE_ORG        = 'S'
          CALLBACK_PROGRAM = SY-REPID
          CALLBACK_FORM    = 'F4CALLBACK'
        TABLES
          VALUE_TAB        = T_ZUONR.
         RETURN_TAB       = T_ZUONR.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR ASGN_CK-HIGH.
      SELECT ZUONR FROM BSIK INTO TABLE T_ZUONR.
      SORT T_ZUONR BY ZUONR.
      DELETE ADJACENT DUPLICATES FROM T_ZUONR.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD         = 'DYNR'
          DYNPPROG         = SY-REPID
          DYNPNR           = SY-DYNNR
          VALUE_ORG        = 'S'
          CALLBACK_PROGRAM = SY-REPID
          CALLBACK_FORM    = 'F4CALLBACK'
        TABLES
          VALUE_TAB        = T_ZUONR.
         RETURN_TAB       = T_ZUONR.
      PERFORM F4CALLBACK.
    *&      Form  F4CALLBACK
          text
    -->  p1        text
    <--  p2        text
    FORM F4CALLBACK.
    *TABLES   RECORD_TAB  STRUCTURE SEAHLPRES
    *CHANGING SHLP        TYPE SHLP_DESCR
            CALLCONTROL LIKE DDSHF4CTRL.
      DATA :  SHLP        TYPE SHLP_DESCR,
              CALLCONTROL LIKE DDSHF4CTRL.
      SHLP-INTDESCR-DIALOGTYPE = 'C'.             " Dialog type ( Dialog with value restriction )
      CALLCONTROL-NO_MAXDISP   = '500'.           " For getting Maximum no of hits tab
    ENDFORM.                    " F4CALLBACK
    *But it is not working, Please help. There is some problem with the Perform F4CALLBACK Module. Please help.

  • F4IF_INT_TABLE_VALUE_REQUEST help

    hi,
    I have a table of 2 values ( WBS and project definition code ) , I used this function F4IF_INT_TABLE_VALUE_REQUEST for F4 on the project definition field. After that I want to return both Project definition and WBS that I've selected . I used value_org = 'S" but I can get only 1 record in the return_table ? Could you please help me?
    Thanks in advance

    Hi,
    Check this Code..
    F4 help is povided on the P_PLNNR field and if any data is selected then P_PLNNR and P_PLNAL is updated in the screen. Both values are shown in the F4 help(P_PLNNR and P_PLNAL ).
    PARAMETES : p_werks type ...
    PARAMETES : p_plnnr type ....
    PARAMETES : p_plnal type....
    AT SELECTION-SCREEN ON P_PLNNR.
      data:
        lg_condition    type string.
      data:
         lwa_ddshretval type ddshretval,
         lwa_dselc      type dselc,
         lwa_dynpread   type dynpread.
      data:
         li_f4_insp     type standard table of t_f4_insp,
         li_ddshretval  type standard table of ddshretval,
         li_dselc       type standard table of dselc,
         li_dynpread    type standard table of dynpread.
      lwa_dynpread-fieldname = 'P_WERKS'.
      append lwa_dynpread to li_dynpread.
      clear lwa_dynpread.
    * Read Screen Field Values.
      call function 'DYNP_VALUES_READ'
        exporting
          dyname     = sy-repid
          dynumb     = sy-dynnr
        tables
          dynpfields = li_dynpread.
    * Read the first record as only one record will be present
      read table li_dynpread into lwa_dynpread index 1.
      p_werks = lwa_dynpread-fieldvalue.
      if p_werks is initial.
        move 'PLNTY EQ ''Q''' to lg_condition.
      else.
        move 'WERKS EQ P_WERKS AND PLNTY EQ ''Q''' to lg_condition.
      endif.
    * Fetch Data
      select werks
             plnnr
             plnal
             plnty
             ktext
        into table li_f4_insp
        from plko
        where (lg_condition).
      lwa_dselc-fldname = 'F0002'.
      lwa_dselc-dyfldname = 'PLNNR'.
      append lwa_dselc to li_dselc.
      clear lwa_dselc.
      lwa_dselc-fldname = 'F0003'.
      lwa_dselc-dyfldname = 'PLNAL'.
      append lwa_dselc to li_dselc.
      clear lwa_dselc.
    * FM For F4 Help
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
          retfield        = 'PLNNR'
          dynpprog        = sy-cprog
          dynpnr          = sy-dynnr
          dynprofield     = 'PLNNR'
          value_org       = 'S'
        tables
          value_tab       = li_f4_insp
          return_tab      = li_ddshretval
          dynpfld_mapping = li_dselc
        exceptions
          parameter_error = 1
          no_values_found = 2
          others          = 3.
      if sy-subrc eq 0.
        refresh li_dynpread.
        read table li_ddshretval into lwa_ddshretval index 1.
        if sy-subrc eq 0.
          move lwa_ddshretval-fieldval to p_plnnr.
          lwa_dynpread-fieldname = 'P_PLNNR'.
          lwa_dynpread-fieldvalue = lwa_ddshretval-fieldval.
          append lwa_dynpread to li_dynpread.
          clear lwa_dynpread.
        endif.                             " IF sy-subrc EQ 0.
        read table li_ddshretval into lwa_ddshretval index 2.
        if sy-subrc eq 0.
          move lwa_ddshretval-fieldval to p_plnal.
          lwa_dynpread-fieldname = 'P_PLNAL'.
          lwa_dynpread-fieldvalue = lwa_ddshretval-fieldval.
          append lwa_dynpread to li_dynpread.
          clear lwa_dynpread.
        endif.                             " IF sy-subrc EQ 0.
      endif.                               " IF sy-subrc EQ 0.
    * Set Screen Field Values.
      call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = sy-repid
          dynumb               = sy-dynnr
        tables
          dynpfields           = li_dynpread
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
      check sy-subrc eq 0.

  • F4IF_INT_TABLE_VALUE_REQUEST - No of hits

    Hi,
    I am passing an internal table of more than 500 values to the function module F4IF_INT_TABLE_VALUE_REQUEST, but it's automatically restricting this to 500 entries. Kindly let me know, how I can customize this restriction to the value I need.
    Thanks and Regards,
    Ashok

    Hi,
    The actual problem is that only: I don't see that no of hits option when I click the downward arrow. Pls find the code that I have used to call this function module.
      select aufnr into table lt_aufnr
                   from aufk
                   where auart = 2000
                   and astkz = 'X'.
      if sy-subrc = 0.
      call function 'DYNP_GET_STEPL'
       IMPORTING
         POVSTEPL              = lv_stepl
       EXCEPTIONS
         STEPL_NOT_FOUND       = 1
         OTHERS                = 2
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    *call function 'HELP_VALUES_GET_WITH_TABLE'
    EXPORTING
      FIELDNAME                           = 'AUFNR'
      TABNAME                             = 'AUFK'
    IMPORTING
      SELECT_VALUE                        = ZSDYN_ZCHECK2-AUFNR
    tables
       fields                              = lt_fields[]
       valuetab                            = lt_aufnr[]
    EXCEPTIONS
      FIELD_NOT_IN_DDIC                   = 1
      MORE_THEN_ONE_SELECTFIELD           = 2
      NO_SELECTFIELD                      = 3
      OTHERS                              = 4
    *if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *endif.
        call function 'F4IF_INT_TABLE_VALUE_REQUEST'
             exporting
                  retfield        = 'AUFNR'
                  pvalkey         = ' '
                  dynpprog        = lv_repid
                  dynpnr          = lv_dynnr
                  dynprofield     = 'ZSDYN_ZCHECK2-AUFNR'
                  stepl           = lv_stepl
             tables
                  value_tab       = lt_aufnr[]
                  field_tab       = lt_fields[]
             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.

  • F4IF_INT_TABLE_VALUE_REQUEST Problem

    Hi Folks,
    I have problem with FM F4IF_INT_TABLE_VALUE_REQUEST
    Here is the scenario.
    i have interbnal table tbwerks[] that contains plant and description(two fields).
    DATA: BEGIN OF tbwerks OCCURS 10,
           werks LIKE t001w-werks,
           name1 like t001w-name1,
          END OF tbwerks .
    then i am populating values to internal table.
    now i want to display all the plants in listbox.
    for that i am using the following FM
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'TBWERKS-WERKS'
                value_org       = 'S'
           TABLES
                value_tab       = tbwerks[]
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc <> 0.
      ENDIF.
    But, here i am getting all descriptions insted of plants.
    can't we use internal table with two fields here..?
    what could be the problem..
    sara

    Hei Sara,
    I've the similar requirement as yours. In my case, the two columns are Administrator and Administrator name ( instead of plant and plant description ) and I've solved the problem this way :
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_sachx.
      PERFORM build_dropdown.
    FORM build_dropdown.
      TYPES:BEGIN OF ty_admin,
             sachx LIKE t526-sachx,
             sachn LIKE t526-sachn,
            END OF ty_admin.
      DATA:it_admin  TYPE  TABLE OF ty_admin,
           it_return TYPE STANDARD TABLE OF ddshretval.
      DATA:wa_admin  LIKE LINE OF it_admin,
           wa_return LIKE LINE OF it_return.
      DATA:l_retfield TYPE  dfies-fieldname.
    Get HR administrators
    SELECT sachx sachn FROM t526 INTO CORRESPONDING FIELDS OF TABLE it_admin
                       WHERE sachx LIKE 'H%'.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = l_retfield
          value_org       = 'S'
        TABLES
          value_tab       = it_admin
          return_tab      = it_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.
      READ TABLE it_return INTO wa_return INDEX 1.
      READ TABLE it_admin INTO wa_admin WITH KEY
                      sachn = wa_return-fieldval.
      WRITE wa_admin-sachx TO p_sachx.
    Refresh it_admin, otherwise valuse in the drop-down will keep on
    adding up each time
      REFRESH:it_admin.
    ENDFORM.                    " build_dropdown
    It's working fine...
    Regards,
    Rudresh

  • F4IF_INT_TABLE_VALUE_REQUEST and search in fields

    Hi Friends,
    I want to make a search operation with F4IF_INT_TABLE_VALUE_REQUEST. My code is;
      DATA:
      BEGIN OF HELP_LIST OCCURS 0,
             ID LIKE ZLIST-ID,
             NAME LIKE ZLIST-NAME,
            SNAME LIKE ZLIST-SNAME,
      END OF HELP_LIST,
      FIELD_TAB LIKE DFIES OCCURS 0 WITH HEADER LINE.
      CLEAR FIELD_TAB.
      FIELD_TAB-TABNAME = 'HELP_LIST'.
      FIELD_TAB-FIELDNAME = 'ID'.
      FIELD_TAB-POSITION = 0.
      FIELD_TAB-OFFSET = 0.
      FIELD_TAB-REPTEXT =  'ID'.
      FIELD_TAB-INTLEN = 9.
      FIELD_TAB-OUTPUTLEN = 9.
      APPEND FIELD_TAB.
      CLEAR FIELD_TAB.
      FIELD_TAB-TABNAME = 'HELP_LIST'.
      FIELD_TAB-FIELDNAME = 'NAME'.
      FIELD_TAB-POSITION = 1.
      FIELD_TAB-OFFSET = 9.
      FIELD_TAB-REPTEXT =  'Name'.
      FIELD_TAB-INTLEN = 50.
      FIELD_TAB-OUTPUTLEN = 50.
      APPEND FIELD_TAB.
    CLEAR FIELD_TAB.
      FIELD_TAB-TABNAME = 'HELP_LIST'.
      FIELD_TAB-FIELDNAME = 'SNAME'.
      FIELD_TAB-POSITION = 1.
      FIELD_TAB-OFFSET = 9.
      FIELD_TAB-REPTEXT =  'Surname'.
      FIELD_TAB-INTLEN = 50.
      FIELD_TAB-OUTPUTLEN = 50.
      APPEND FIELD_TAB.
      SELECT ID NAME SNAME
      FROM ZLIST
      INTO TABLE HELP_LIST.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                RETFIELD        = 'ID'
                VALUE_ORG       = 'S'
                DYNPPROG        = 'ZPROJECT'
                DYNPNR          = '0202'
                DYNPROFIELD     = 'TMP_ID'
                WINDOW_TITLE    = 'Search'
           TABLES
                VALUE_TAB       = HELP_LIST
                FIELD_TAB       = FIELD_TAB
           EXCEPTIONS
                PARAMETER_ERROR = 1
                NO_VALUES_FOUND = 2
                OTHERS          = 3.
    Respect to above code, I can list my values. And when I want to try 'H*' for Name field, I am getting error as : "Not possible to restrict with search pattern here"
    But, If I don't pass FIELD_TAB table, I don't get error. I need to pass this table for another reason. But also I need to search for name and surname fields.
    How can I do?
    Thanks.

    Hi Uwe,
        Thank you for your response. Yes, that is an option I was thinking of as an alternative.
        I want to display to the user the User_Addrs selection-window, with the names. Once they choose the multiple-selection list of names, I want them to be able to save the user address and the associated first/last names in the variant.
        The selection screen can be cut down to possibly one less selection-field: by combining the first/last name...but the update to screen-fields would likely still be a problem.
      Still working on this one, 
       Dan Perecky

  • F4IF_INT_TABLE_VALUE_REQUEST -Restrictions dialog box

    Hi,
    I am using the function module F4IF_INT_TABLE_VALUE_REQUEST in screens, to implement a search help in my program , but instead of directly displaying the hit list , i want the restrictions screen to be displayed first with some default values, and the list should be displayed only based on the valuies entered in thius restrictions screen. How can i do this using this function module.
    To be more precise,
    i need the restrictions dialog box to be displayed and this will have 6 fields. i have to pass values to 2 fields from my program, the first field need not be filled and teh remaining fields should be left for the user to enter.
    how do i achieve this?
    Please help.

    Check the sample code. Using the Event PROCEE ON VALUE-REQUEST we can get the F4 Help.
    PROGRAM  ztest_duplica.
    DATA: kunnr1(10),
               kunnr2(10).
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    *&      Module  get_help  INPUT
    *       text
    MODULE get_help INPUT.
      DATA:i_retab TYPE TABLE OF  ddshretval,
           wa_ret TYPE ddshretval.
      TYPES: BEGIN OF x_itab,
      kunnr TYPE kunnr,    "it should be type to some standard data element
      END OF x_itab.
      FIELD-SYMBOLS: <fs> TYPE ANY.
      CLEAR : kunnr1, kunnr2.
      DATA: dynfield  TYPE help_info-dynprofld,
            wa_itab TYPE x_itab,
            i_tab LIKE TABLE OF wa_itab WITH HEADER LINE.
      CLEAR  dynfield.
      IF sy-dynnr = '0100'.
        dynfield = 'KUNNR1'.
      ELSE.
        dynfield = 'KUNNR2'.
      ENDIF.
      SELECT kunnr FROM kna1
          INTO TABLE i_tab
          UP TO 20 ROWS.
      "retfield we will pass the column name we are going to get from f4
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield    = 'KUNNR'   "<---Return field column name
          dynpprog    = sy-repid
          dynpnr      = sy-dynnr
          dynprofield = dynfield
          value_org   = 'S'
        TABLES
          value_tab   = i_tab
          return_tab  = i_retab.
      IF sy-subrc EQ 0.
        READ TABLE i_retab INTO wa_ret INDEX 1.
        ASSIGN (dynfield) TO <fs> .
        <fs> = wa_ret-fieldval .
        UNASSIGN <fs>.
      ENDIF.
    ENDMODULE.                 " get_help  INPUT
    Flow logic for 100 screen
    screen consists of Input field pointing to KUNNR1
    PROCESS BEFORE OUTPUT.
    * MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    process on value-request.
    field kunnr1 module get_help.
    Create a Tcode and Intitial screen 100. and check it .
    Regards
    Vijay Babu Dudla

  • F4IF_INT_TABLE_VALUE_REQUEST not returning value with 2 decimals point

    hi all,
    i use function F4IF_INT_TABLE_VALUE_REQUEST to do search help, the master data in table ZINVEST has field ZNO, with field type CURR , 2 decimals point.
    the return table shows 2 decimals point but in display screen it only shows 1 decimal point, pls advice
    here's the coding:
    DATA : BEGIN OF itab OCCURS 0,
              e_value(20),
             END OF itab.
      DATA: BEGIN OF field_tab OCCURS 0.
              INCLUDE STRUCTURE dfies.
      DATA END OF field_tab.
      DATA : return_tab LIKE ddshretval OCCURS 0 .
          CLEAR field_tab.
          field_tab-fieldname = 'E_VALUE'.
          field_tab-intlen = 17.
          field_tab-outputlen = 17.
          field_tab-decimals = 2.
          field_tab-inttype = 'C'.
          field_tab-scrtext_m = 'Investment No'.
          APPEND field_tab.
          SELECT * FROM ZINVEST.
            CLEAR: itab.
            itab-e_value = ZINVEST-ZNO.
            APPEND itab.
          ENDSELECT.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'E_VALUE'
          dynprofield     = 'A'
          dynpprog        = sy-cprog
          dynpnr          = sy-dynnr
        TABLES
          value_tab       = itab
          field_tab       = field_tab
          return_tab      = return_tab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.

    Hi ester,
    You shud try this way. Try to use this code.
    DATA:  BEGIN OF it_help OCCURS 0,
           zuonr TYPE zvinvoice,
           kunnr TYPE kunnr,
           name  TYPE zvcustname,
           END OF it_help.
    SELECT-OPTIONS: p_zuonr FOR bsid-zuonr.
    SELECT DISTINCT
             zuonr
             kunnr
      INTO CORRESPONDING FIELDS OF TABLE it_help
      FROM bsid
      WHERE zuonr <> space.
      SORT it_help BY zuonr kunnr.
      DELETE ADJACENT DUPLICATES FROM it_help
      COMPARING zuonr kunnr.
      IF it_help[] IS NOT INITIAL.
        SELECT kunnr
               name1
               name2
        INTO TABLE it_kna1
        FROM kna1
        FOR ALL ENTRIES IN it_help
        WHERE kunnr = it_help-kunnr.
        SORT it_kna1 BY kunnr.
        CLEAR v_tabix.
        SORT it_help BY kunnr.
        LOOP AT it_help.
          v_tabix = sy-tabix.
          READ TABLE it_kna1 WITH KEY kunnr = it_help-kunnr
                                      BINARY SEARCH.
          IF sy-subrc EQ 0.
            CONCATENATE it_kna1-name1 it_kna1-name2 INTO it_help-name  
            SEPARATED BY space.
            MODIFY it_help FROM it_help INDEX v_tabix
                                        TRANSPORTING name.
          ENDIF.
        ENDLOOP.
    FORM event_selscr_valreq_for_pzuonr .
    ***Function module to display the search help for the assignment filed****
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield         = 'ZUONR'
          dynpprog         = sy-cprog
          dynpnr           = sy-dynnr
          dynprofield      = 'P_ZUONR'
          window_title     = text-029
          value_org        = 'S'
          callback_program = sy-repid
        TABLES
          value_tab        = it_help
        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.
    Reward if help ful.
    Regards
    Azad.

  • F4IF_INT_TABLE_VALUE_REQUEST and first selection of mult

    Hi All,
       I am using F4IF_INT_TABLE_VALUE_REQUEST and it works well, except for the first time.This is a regular report type program.
        o If one item/line is selected the first time, nothing is returned to the screen fields.
        o If more than one item is selected, the first one is lost. The second and other lines make it back to the screen field.
           o The actual values are not displayed until I right-click and select the 'multiple selection' option.
        o The next multiple selects always returns correctly- Whatever is chosen makes it to the bottom of the screen field.
        Using StepL or not does not seem to make a difference.
      Call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = RtField
          dynpprog        = l_prog             
          dynpnr          = l_screen           
          dynprofield     = specifichlpfld
          Value_org       = 'C'       
          WINDOW_TITLE    = WinTitle
          MULTIPLE_CHOICE = 'X'
        TABLES
          field_Tab       = OutField_Tab
          value_tab       = OutUsrAddrs    
          RETURN_TAB      = RETURN_TAB.
       Thanks for any help,
                       Dan P.

    Hi All,
        This is the code that shows the problem. It can be cut/pasted into a program for demostration.
    *& Report  YDMP_TRY2F4IN_INT_TABLE_VAL_RE                              *
    *& Author: Daniel Perecky                                              *
    *& Test prg for function module call F4IF_INT_TABLE_VALUE_REQUEST.     *
    *& Works, kind of.                                                     *
    *& o If one item/line is selected the first time, nothing is           *
    *&   returned to the screen fields.                                    *
    *& o If more than one item is selected, the first one is lost. The     *
    *&   second and other lines make it back to the screen field.          *
    *&      o The actual values are not displayed until I right-click      *
    *&        and select the 'multiple selection' option.                  *
    *& o The next multiple selects always returns correctly- Whatever is   *
    *&   chosen makes it to the bottom of the screen field.                *
    REPORT  YDMP_TRY3F4IN_INT_TABLE_VAL_RE          .
    Tables: User_Addrs.
    Selection-Screen Begin of Block EMAILN.
    Selection-Screen Skip.
    Selection-screen Begin of Line.
    Selection-Screen Comment 1(25) Text-013.
    Selection-screen End of Line.
    Selection-screen Begin of Line.
    Selection-Screen Comment 1(12) Text-015.
    Selection-Screen Position 10.
    Select-Options: GnrlF for USER_ADDRS-Name_First.
    Selection-Screen Position 63.
    Select-Options: GnrlL for USER_ADDRS-NAME_Last.
    Selection-screen End of Line.
    Selection-screen Begin of Line.
    Selection-Screen Position 68.
    Select-Options: GnrlSpMl for User_Addrs-BName.
    Selection-screen End of Line.
    Selection-Screen Skip.
    Selection-Screen End of Block EMAILN.
    Include type pool SSCR
    TYPE-POOLS SSCR.
    Define the object to be passed to the RESTRICTION parameter
    DATA RESTRICT TYPE SSCR_RESTRICT.
    DATA OPT_LIST TYPE SSCR_OPT_LIST.
    DATA ASSRTD   TYPE SSCR_***.
          CLASS CX_RPTERR_EXCEPTION  DEFINITIO
    CLASS CX_RPTERR_EXCEPTION DEFINITION
                            INHERITING FROM CX_STATIC_CHECK.
    ENDCLASS.                    "CX_RPTERR_EXCEPTION  DEFINITIO
    Initialization.
    Used for function module: 'SELECT_OPTIONS_RESTRICT'
      Clear Opt_List.
      Move 'JUST_EQ' to Opt_List-Name.
      Move 'X' to Opt_List-Options-Eq.
      APPEND OPT_LIST TO RESTRICT-OPT_LIST_TAB.
      Clear Opt_List.
      Move 'NOINTERVLS' to Opt_List-Name.
      Move 'X' to: Opt_List-Options-CP,
                   Opt_List-Options-EQ,
                   Opt_List-Options-GE,
                   Opt_List-Options-GT,
                   Opt_List-Options-LE,
                   Opt_List-Options-LT,
                   Opt_List-Options-NE,
                   Opt_List-Options-NP.
      APPEND OPT_LIST TO RESTRICT-OPT_LIST_TAB.
      Clear Opt_List.
      Clear Assrtd.
      Move: 'B' to Assrtd-Kind,
            'EMAILN' to Assrtd-Name,
            'I'      to Assrtd-SG_Main,
           'N'      to Assrtd-SG_Addy,
            'JUST_EQ' to Assrtd-Op_Main,
          'NOINTERVLS' TO Assrtd-OP_ADDY.
      APPEND Assrtd TO RESTRICT-***_TAB.
    Call function module
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
           EXPORTING
                 RESTRICTION                = RESTRICT
              DB                          = ' '
           EXCEPTIONS
                 TOO_LATE                   = 1
                 REPEATED                   = 2
                 NOT_DURING_SUBMIT          = 3
                DB_CALL_AFTER_REPORT_CALL  = 4
                SELOPT_WITHOUT_OPTIONS     = 5
                 SELOPT_WITHOUT_SIGNS       = 6
                 INVALID_SIGN               = 7
                REPORT_CALL_AFTER_DB_ERROR = 8
                  EMPTY_OPTION_LIST          = 9
                 INVALID_KIND               = 10
                 REPEATED_KIND_A            = 11
                 OTHERS                     = 12.
    Exception handling
      IF SY-SUBRC NE 0.
      ENDIF.
    Use same form for all three fields. Update all fields every time.
    At Selection-Screen on Value-Request for GnrlF-Low.
      Perform GetFillUserInfo Tables GnrlF GnrlL GnrlSpMl.
    At Selection-Screen on Value-Request for GnrlL-Low.
      Perform GetFillUserInfo Tables GnrlF GnrlL GnrlSpMl.
    At Selection-Screen on Value-Request for GnrlSpMl-Low.
      Perform GetFillUserInfo Tables GnrlF GnrlL GnrlSpMl.
    Start-of-Selection.
      Try.
    Some regular report code goes here.
        Catch CX_ROOT.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          Exit.
      EndTry.
    End-of-Selection.
    *=============================================================================================
    *| Form  GetFillUserInfo                                                                       |
    *| Get all user information from SAP tables and fill out Selection-Screen tables.              |
    *| Fill in all fields for user.                                                                |
    *=============================================================================================
    Form GetFillUserInfo Tables NameF Type Standard Table          NameL Type Standard Table
                                             SAPIds Type Standard Table.
      Data: NameFLoc Type Range of User_Addrs-Name_First with header line,
            NameLLoc Type Range of User_Addrs-Name_Last with header line,
           OutlookLoc Type Range of ZXX_Hrid-ZZ_EMail_Address with header line,
            SAPIdLoc Type Range of User_Addrs-BName with header line.
      data: step_line like sy-stepl.
      Types: Begin of UsrAddrsT.
      Types: BNAME Like User_Addrs-BName,
             NAME_LAST Like User_Addrs-Name_Last,
             NAME_FIRST Like User_Addrs-Name_First,
             NAME_TEXT Like User_Addrs-Name_Text,
             DEPARTMENT Like User_Addrs-Department.
      Types: End of UsrAddrsT.
      Data: UsrAddrsInt type standard table of UsrAddrsT with header line.
      Types: Begin of UsrAddrsT2.
      Types: Value(80) Type C.
      Types: End of UsrAddrsT2.
      Data: UsrAddrs type standard table of UsrAddrsT2 with header line.
      Data: Field_Tab type standard table of DFIES with header line.
      DATA: Return_Tab Type Standard table of ddshretval with HEADER LINE.
      Data: RtField Like DFIES-FIELDNAME,
            WinTitle(40) Type C.
    Generic F4 tables
      Data: OutField_Tab Type Standard table of DFIES with header line,
            OutUsrAddrs Type Standard table of UsrAddrsT2 with header line.
      Data: l_prog like syst-cprog,
            l_screen like syst-dynnr,
            specifichlpfld like Help_Info-Dynprofld.
      Data: TblSz Type I.
      l_prog = syst-cprog.
      l_screen = syst-dynnr.
        Select D2BName D2Name_First D2NAME_LAST D2Name_Text D2~Department
            From ( Usr21 as D1
              Inner Join User_Addrs as D2
              On  D1BName = D2BName )
              Appending Corresponding fields of table UsrAddrsInt
           Where D2~BName <> Space.
        Sort UsrAddrsInt by Name_Last Name_First BName.
        Delete UsrAddrsInt Where BName cs 'n/a' or ( BName = 'Z_USER' and Name_Text cs 'USER SAMPLE' ) or BName = 'SAMPLE'.
    Fill value table- one column data per row.
        Loop at UsrAddrsInt.
          If UsrAddrsInt-BName <> Space.
            Write UsrAddrsInt-BName to Usraddrs-Value.
          Else.
            Write space to UsrAddrs-Value.
          Endif.
          Append UsrAddrs.
          If UsrAddrsInt-NAME_TEXT <> Space.
            Write UsrAddrsInt-NAME_TEXT to Usraddrs-Value.
          Else.
            Write space to UsrAddrs-Value.
          Endif.
          Append UsrAddrs.
          If UsrAddrsInt-DEPARTMENT <> Space.
            Write UsrAddrsInt-DEPARTMENT to Usraddrs-Value.
          Else.
            Write space to UsrAddrs-Value.
          Endif.
          Append UsrAddrs.
        EndLoop.
        Select Distinct d1tabname D1fieldname D1Domname d1Datatype D1~position
               D1rollname D1inttype D1intlen D1leng D1Decimals D1outputLen
            From DD03M as D1
            appending corresponding fields of table Field_tab
          where
             DDLanguage = Syst-Langu  and
             d1~tabname = 'USER_ADDRS' and
             D1~fieldname in ('BNAME', 'NAME_TEXT', 'DEPARTMENT').
        Sort Field_Tab by position.
        Loop at Field_Tab.
          Select Single DDText
               Into Field_Tab-FieldText
            From DD03M
          Where Tabname = Field_Tab-Tabname and
             FieldName = Field_Tab-fieldName and
             DDLanguage = Syst-Langu.
            If Syst-Subrc = 0.
              Modify Field_Tab.
            Endif.
        EndLoop.
        RtField = 'BNAME'.
        WinTitle = 'Find Person(s) for SAP E-Mail'.
        specifichlpfld = 'USR21-BNAME'.
        Clear: OutField_Tab, OutUsrAddrs.  Refresh: OutField_Tab, OutUsrAddrs.
        OutField_Tab[] = Field_Tab[].
        OutUsrAddrs[] = UsrAddrs[].
      Call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = RtField
         stepL           = Step_Line
          dynpprog        = l_prog              " sy-cprog
          dynpnr          = l_screen            " sy-dynnr
          dynprofield     = specifichlpfld
          Value_org       = 'C'        "'S'
          WINDOW_TITLE    = WinTitle
          MULTIPLE_CHOICE = 'X'
        TABLES
          field_Tab       = OutField_Tab
          value_tab       = OutUsrAddrs      "SelFNames
          RETURN_TAB      = RETURN_TAB.
      If SY-SUBRC <> 0.
        If Syst-Batch = ' '.  " Online
          Sy-MsgTy = 'I'.
        Else.
          Sy-MsgTy = 'E'.
        Endif.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        If Syst-Batch = ' '.  " Online
          Raise Exception Type CX_RPTERR_EXCEPTION.
        Endif.
      Endif.
      CALL FUNCTION 'DYNP_GET_STEPL'
        IMPORTING
          POVSTEPL        = Step_Line
        EXCEPTIONS
          STEPL_NOT_FOUND = 1
          OTHERS          = 2.
      If SY-SUBRC <> 0.
        If Syst-Batch = ' '.  " Online
          Sy-MsgTy = 'I'.
        Else.
          Sy-MsgTy = 'E'.
        Endif.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        If Syst-Batch = ' '.  " Online
          Raise Exception Type CX_RPTERR_EXCEPTION.
        Endif.
      Endif.
          Loop at Return_Tab.
            Clear UsrAddrsInt.
            Read table UsrAddrsInt with key BName = Return_Tab-FIELDVAL.
            If Syst-Subrc = 0.
              NameFLoc-Low = UsrAddrsInt-Name_First.       " should be ok if blank- append anyway.
              NameLLoc-Low = UsrAddrsInt-Name_Last.
              sapIdLoc-Low = UsrAddrsInt-BName.
              Append: NameFLoc, NameLLoc, SapIdLoc.
              Clear: NameFLoc, NameLLoc, SapIdLoc.
            Endif.
          EndLoop.
      Loop at NameFLoc.
        NameFLoc-High = space.   NameFLoc-Sign = 'I'.   NameFLoc-Option = 'EQ'.    Modify NameFLoc.
      EndLoop.
      Loop at NameLLoc.
        NameLLoc-High = space.   NameLLoc-Sign = 'I'.   NameLLoc-Option = 'EQ'.    Modify NameLLoc.
      EndLoop.
      Loop at SapIdLoc.
        SapIdLoc-High = space.   SapIdLoc-Sign = 'I'.   SapIdLoc-Option = 'EQ'.    Modify SapIdLoc.
      EndLoop.
      Loop at NameFLoc.
        Move-Corresponding NameFLoc to NameF.
        Append NameF.
        Add 1 to TblSz.
      EndLoop.
      Refresh NameFLoc. Clear: NameF, NameFLoc.
      Loop at NameLLoc.
        Move-Corresponding NameLLoc to NameL.
        Append NameL.
      EndLoop.
      Refresh NameLLoc. Clear: NameL, NameLLoc.
      Loop at SapIdLoc.
      Move-Corresponding SapIdLoc to SAPIds.
        Append SapIds.
      EndLoop.
      Refresh SapIdLoc.   Clear: SapIds, SapIdLoc.
    EndForm.                    " GetFillUserInfo

  • F4IF_INT_TABLE_VALUE_REQUEST select entrie row

    Hello All,
    I have a VALUE_TAB internal table (<b>it_mngrp_mncod</b>) with 3 fileds. After selecting a row in F4 pop up, I need to get all the three column values. In return_tab I am getting only the last field, which is the value of CODE in it_mngrp_mncod. Is there any way to select the entire row in F4 pop up?
    Here is the piece of my code:
    *& Report  ZCK_TEST
    REPORT  zck_test.
    TABLES: viqmel, viqmfe.
    CALL SCREEN 101.
    *&      Module  code_pf4_i15  INPUT
    MODULE code_pf4_i15 INPUT.
      DATA: BEGIN OF it_mngrp_mncod OCCURS 0,
                 kurztext TYPE qtxt_code,
                 codegruppe TYPE qcodegrp,
                 code TYPE qcode,
                 END OF it_mngrp_mncod.
      DATA: it_returntab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
      DATA: it_fieldtab LIKE dfies OCCURS 0 WITH HEADER LINE.
      DATA p_field TYPE fieldname.
      GET CURSOR FIELD p_field .
      PERFORM code_pf4_f40 USING p_field.
    ENDMODULE.                 " code_pf4_i15  INPUT
    *&      Form  code_pf4_f40
    FORM code_pf4_f40 USING p_field.
      PERFORM get_f4_values CHANGING  p_field.
    ENDFORM.                    " code_pf4_f40
    *&      Form  GET_F4_VALUES
    FORM get_f4_values  CHANGING    p_field.
      DATA: field1 TYPE fieldname,
             field2 TYPE fieldname.
      DATA: p_katalogart TYPE qkatart.
      SPLIT p_field AT '-' INTO field1 field2.
      IF field2 = 'OTGRP' OR  field2 = 'OTEIL'.
        p_katalogart = 'B'.
      ELSEIF field2 = 'FEGRP' OR  field2 = 'FECOD'.
        p_katalogart = 'C'.
      ELSEIF field2 = 'URGRP' OR  field2 = 'URCOD'.
        p_katalogart = '5'.
      ELSEIF field2 = 'MNGRP' OR field2 = 'MNCOD'.
        p_katalogart = 'A'.
      ELSEIF field2 = 'TASK_CODEGRP' OR field2 = 'TASK_CODE' OR field2 =
    'TXT_TASKCD'.
        p_katalogart = '2'.
      ENDIF.
      SELECT codegruppe code INTO CORRESPONDING FIELDS OF TABLE
    it_mngrp_mncod FROM qpcd WHERE katalogart = p_katalogart.
      LOOP AT it_mngrp_mncod.
        SELECT SINGLE kurztext
                FROM qpct
                INTO it_mngrp_mncod-kurztext
               WHERE katalogart = p_katalogart
                 AND codegruppe = it_mngrp_mncod-codegruppe
                 AND code = it_mngrp_mncod-code.
        MODIFY it_mngrp_mncod FROM it_mngrp_mncod TRANSPORTING kurztext.
      ENDLOOP.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
      DDIC_STRUCTURE         = ' '
          retfield               = p_field
      PVALKEY                = ' '
      DYNPPROG               = ' '
      DYNPNR                 = ' '
      DYNPROFIELD            = ' '
      STEPL                  = 0
      WINDOW_TITLE           =
      VALUE                  = ' '
       value_org              = 'S'
      MULTIPLE_CHOICE        = ' '
      DISPLAY                = ' '
      CALLBACK_PROGRAM       = ' '
      CALLBACK_FORM          = ' '
      MARK_TAB               =
    IMPORTING
      USER_RESET             =
        TABLES
          value_tab              = it_mngrp_mncod
         field_tab              =  it_fieldtab
         return_tab             = it_returntab
      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.
      READ TABLE it_returntab INDEX 1.
      MOVE it_returntab-fieldval TO p_field.
    ENDFORM.                    " GET_F4_VALUES
    *&      Module  user_command_101  INPUT
          text
    MODULE user_command_101 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " user_command_101  INPUT
    *&      Module  status_101  OUTPUT
          text
    MODULE status_101 OUTPUT.
      SET PF-STATUS '0101'.
    ENDMODULE.                 " status_101  OUTPUT

    Hi,
    Paste following code as-is just before ENDIF. Then it should work fine.
      data: w_dynpro_field type dynpread.
      data: t_dynpro_field type standard table of dynpread.
      refresh: t_dynpro_field.
      move: sy-repid to d020s-prog,
            sy-dynnr to d020s-dnum.
      move: 'VIQMFE-OTEIL'   to w_dynpro_field-fieldname,
            viqmfe-oteil     to w_dynpro_field-fieldvalue.
      call function 'DYNP_VALUES_UPDATE'
        exporting
          dyname               = d020s-prog
          dynumb               = d020s-dnum
        tables
          dynpfields           = t_dynpro_field
        exceptions
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          undefind_error       = 7
          others               = 8.
    Hope this helps...
    Thanks,
    Murali

  • F4IF_INT_TABLE_VALUE_REQUEST value_tab cleared

    Hi all,
    i'm using the bapi in object.
    I use it in a table control.
    It runs well when i start it for the first time.
    If i open the match code for the second field the value_tab is displayed with initial values:
    1st time:    SRVPOS         KTEXT1
                      1                     descr1
                      2                     descr2... ecc
    2nd time  KTEXT1         KTEXT1
                   0000000            descr1
                   0000000            descr2... ecc
    The header too is not correct.
    Anybody can help me?
    Thanks.
    MY CODE----
    DATA: field_tab LIKE dfies OCCURS 0 WITH HEADER LINE.
      DATA: return_tab TYPE ddshretval OCCURS 0 WITH HEADER LINE.
    *  DATA: BEGIN OF value_tab OCCURS 0,
    *         srvpos like esll-srvpos,
    *         ktext1 like esll-ktext1,
    *   END OF value_tab.
      DATA: value_tab LIKE esll OCCURS 0 WITH HEADER LINE.
      CLEAR: value_tab, return_tab.
      REFRESH value_tab[].
      REFRESH field_tab[].
      REFRESH return_tab[].
        field_tab-fieldname = 'SRVPOS'.
        field_tab-tabname = 'ESLL'.
        field_tab-offset = '18'.
        field_tab-position = '1'.
        field_tab-keyflag = 'X'.
        field_tab-intlen = 15.
        field_tab-leng = 15.
        field_tab-outputlen = 15.
        field_tab-scrtext_m = 'Prestazione'.
        APPEND field_tab.
        CLEAR field_tab.
        field_tab-fieldname = 'KTEXT1'.
        field_tab-tabname = 'ESLL'.
        field_tab-position = '2'.
        field_tab-offset = '40'.
        field_tab-intlen = 15.
        field_tab-leng = 15.
        field_tab-outputlen = 15.
        field_tab-scrtext_m = 'Descrizione'.
        APPEND field_tab.
        CLEAR field_tab.
      DATA: check_fieldval LIKE return_tab-fieldval.
        LOOP AT tadd.
          MOVE-CORRESPONDING tadd TO value_tab.
          APPEND value_tab.
          CLEAR value_tab.
        ENDLOOP.
        CLEAR tadd.
      SORT value_tab.
      DELETE ADJACENT DUPLICATES FROM value_tab.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'SRVPOS'
          value_org       = 'S'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
        TABLES
          value_tab       = value_tab
          field_tab       = field_tab
          return_tab      = return_tab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc = 0.
        wins-srvpos = return_tab-fieldval.
      ENDIF.
    Edited by: SAPDUMMY on Feb 9, 2011 12:38 PM

    Hi,
         Declare another value tab for the second field ...
    DATA: value_tab1 LIKE esll OCCURS 0 WITH HEADER LINE.
    DATA: value_tab2 LIKE esll OCCURS 0 WITH HEADER LINE.
    Also both the times the return field is SRVPOS ... for the second change the return field ....
    Regards,
    Srini.

  • F4IF_INT_TABLE_VALUE_REQUEST doesn't work

    I want to popup a F4 window for bank name accroding to vendor no.
    *declare internal table for bank
    data: begin of bk occurs 0,
              no like lfbk-bankn,
              curr like lfbk-bkref,
              name like bnka-banka,
              acct like lfbk-koinh,
            end of bk.
    data t_bk like bk occurs 0 with header line.
    process on value-request.
       field IO_BANKNM module BANKNAME_list.
    *&      Module  BANKNAME_list  INPUT
          text
    module bankname_list input.
    call function 'CONVERSION_EXIT_ALPHA_INPUT'
      exporting
           input   = io_vendorno
      importing
          output   = vendorno_long
      exceptions
           others  = 1.
      select abankn abkref bbanka akoinh
          into bk
          from lfbk as a inner join bnka as b
          on abankl = bbankl
          where a~lifnr = vendorno_long.
          append bk to t_bk.
      endselect.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
        DDIC_STRUCTURE         = ' '
          retfield                            = 'name'
        PVALKEY                      = ' '
          DYNPPROG                   = prog_name
        DYNPNR                        = ' '
          DYNPROFIELD               = 'IO_BANKNM'
        STEPL                           = 0
          WINDOW_TITLE             = 'bank name'
        VALUE                          = ' '
          VALUE_ORG                 = 'C'
        MULTIPLE_CHOICE       = ' '
        DISPLAY                      = ' '
        CALLBACK_PROGRAM  = ' '
        CALLBACK_FORM          = ' '
        tables
          value_tab                          = t_bk
        FIELD_TAB                      =
        RETURN_TAB                  =
        DYNPFLD_MAPPING        =
      EXCEPTIONS
        PARAMETER_ERROR       = 1
        NO_VALUES_FOUND        = 2
        OTHERS                           = 3
    endmodule.                 " BANKNAME_list  INPUT
    I use debug and find there are 3 records in internal table t_bk.
    But there is no F4 window pop up when call 'F4IF_INT_TABLE_VALUE_REQUEST'  and I was told ' No value is found'.
    Can anyone kind to help? Does I use this function wrong?

    Hello  Yimeng Cui         
    Call the FM in the event,
    AT SELECTION-SCREEN FOR VALUE REQUEST FOR <field>.
    e.g.:
    PARAMETERS:
      p_conn TYPE dfies-fieldname.
    DATA:
      BEGIN OF tab OCCURS 0,
        carrid LIKE spfli-carrid,
        connid LIKE spfli-connid,
      END OF tab.
    DATA:
      w_tabix TYPE i,
      w_repid LIKE sy-repid,
      w_dnum LIKE sy-dynnr,
      t_return LIKE TABLE OF ddshretval WITH HEADER LINE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_conn.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
    *    DDIC_STRUCTURE         = ' '
          retfield               = 'P_CONN'
    *    PVALKEY                = ' '
         dynpprog               = w_repid
         dynpnr                 = w_dnum
    *    DYNPROFIELD            = ' '
    *    STEPL                  = 0
    *    WINDOW_TITLE           =
    *    VALUE                  = ' '
         value_org              = 'S'
    *    MULTIPLE_CHOICE        = ' '
    *     DISPLAY                = 'X'
    *    CALLBACK_PROGRAM       = ' '
    *    CALLBACK_FORM          = ' '
    *    MARK_TAB               =
    *  IMPORTING
    *    USER_RESET             =
        TABLES
          value_tab              = tab
    *    FIELD_TAB              = F_RETURN
         return_tab             = t_return
    *    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.
      ELSE.
        READ TABLE t_return INDEX 1 TRANSPORTING fieldval.
        p_conn = t_return-fieldval.
        CLEAR tab.
        SELECT carrid
          FROM spfli
        INTO TABLE tab1
       WHERE connid EQ t_return-fieldval.
    ENDIF.
    Regards
    Indu.

  • F4IF_INT_TABLE_VALUE_REQUEST Functionality

    Hello all,
    How can I return more then one value using the FM F4IF_INT_TABLE_VALUE_REQUEST.
    Example:
    Parameters:
    pernr TYPE pa0001-pernr,
    sname TYPE pa0001-sname.
    When I click "F4" inside the field (parameter) pernr, the following list is showed...
    Number - Name
    ===========
    1234 - Roberto
    5678 - Falk
    When I select the first line, I need to receive both values (Number and Name), no just the Name.

    Hello Roberto
    Yes, you can return multiple values using this function module. All you need to do is to define a <b>CALLBACK </b>routine for modifying the search help.
    Have a look at the following sample report <b>ZUS_SDN_F4IF_INT_TAB_VAL_REQ</b>. If you define two columns on the search help that are return you retrieve two entries in the values itab for each selected F4 entry (in case of muliple select possible).
    *& Report  ZUS_SDN_F4IF_INT_TAB_VAL_REQ
    REPORT  zus_sdn_f4if_int_tab_val_req.
    TYPE-POOLS: shlp.
    DATA:
      gd_repid     TYPE syrepid,
      gt_knb1      TYPE STANDARD TABLE OF knb1,
      gt_values    TYPE STANDARD TABLE OF ddshretval.
    START-OF-SELECTION.
      gd_repid = syst-repid.
      SELECT * FROM knb1 INTO TABLE gt_knb1 UP TO 100 ROWS.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          ddic_structure         = 'KNB1'
          retfield               = 'KUNNR'  " overwritten in callback !!!
    *     PVALKEY                = ' '
    *     DYNPPROG               = ' '
    *     DYNPNR                 = ' '
    *     DYNPROFIELD            = ' '
    *     STEPL                  = 0
    *     WINDOW_TITLE           =
    *     VALUE                  = ' '
          value_org              = 'S'  " structure
    *     MULTIPLE_CHOICE        = ' '
    *     DISPLAY                = ' '
          callback_program       = gd_repid
          callback_form          = 'CALLBACK_F4'
    *     MARK_TAB               =
    *   IMPORTING
    *     USER_RESET             =
        TABLES
          value_tab              = gt_knb1
    *     FIELD_TAB              =
          return_tab             = gt_values
    *     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.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_structure_name = 'DDSHRETVAL'
        TABLES
          t_outtab         = gt_values
        EXCEPTIONS
          program_error    = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    END-OF-SELECTION.
    *&      Form  CALLBACK_F4
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM callback_f4
                TABLES record_tab STRUCTURE seahlpres
                CHANGING shlp TYPE shlp_descr
                         callcontrol LIKE ddshf4ctrl.
    * define local data
      DATA:
        ls_intf     LIKE LINE OF shlp-interface,
        ls_prop     LIKE LINE OF shlp-fieldprop.
      " Hide unwanted fields
      CLEAR: ls_prop-shlpselpos,
             ls_prop-shlplispos.
      MODIFY shlp-fieldprop FROM ls_prop
        TRANSPORTING shlpselpos shlplispos
      WHERE ( fieldname NE 'BUKRS'  AND
              fieldname NE 'KUNNR'  AND
              fieldname NE 'PERNR' ).
      " Overwrite selectable fields on search help
      REFRESH: shlp-interface.
      ls_intf-shlpfield = 'BUKRS'.
      ls_intf-valfield  = 'X'.
      APPEND ls_intf TO shlp-interface.
      ls_intf-shlpfield = 'KUNNR'.
      APPEND ls_intf TO shlp-interface.
    ENDFORM.                    " CALLBACK_F4
    Regards
      Uwe

  • F4IF_INT_TABLE_VALUE_REQUEST output language change

    Hi experts,
    I am buidling an internal table data in english language but when I click F4 on the specified field at run time , I am getting output pop-up data in different language seems like korean.
    Even the return code from 'F4IF_INT_TABLE_VALUE_REQUEST' is zero i.e success.
    What could be the possible error or is it related to any Unicode check?
    Thank you
    Depesh Kumar

    Hi deepesh,
    Just check the table from which your fetching data into internal table is having any language key fields, if there the pass sy-langu and fetch the required data only.
    There is noting like language in the function module, it all depends upon the data what you are fetching.
    Just give the screen field and the table name so that we can look and comment
    regards
    Kumar M

Maybe you are looking for

  • Need help with a For loop that uses a Break statement

    I need to create a for loop which counts down from 100-50 and divides the number being counted down by a counter. Can anyone help me? public class Break public static void main ( String args []) (;      int total = 0      int counter = 0      for { (

  • [Mail] change RSS header font and color

    Hi. I use Mail.app to read RSS and have some troubles with it. Let me show how does it looks like: As you can see, RSS header at Mail.app use very large fonts for RSS title and entry, some about half of the header is the date. Hmmm. This is wrong. An

  • I cant update to iso 8

    it says i dont have enough storage but it let me update my ipad not my phone so i decided to create a new apple id but i cant change my id in i cloud with out having all my pictures deleted .. i need help i dont want to delete all my pics again ..

  • Error Mesg 2100 while trying to use sqlldr

    Hi there, sorry if my post is not in the right board - I am new here and couldn`t find a more suitable place for it ;-) I set up 10g XE and all worked fine..so I started to load data via the web based frontend on a client. This was also good. But whe

  • Don't understand the vfhttpd user and group

    When creating your first web server using vFabric Web Server there is a user and group created, both named "vfhttpd".  Would anyone be able to explain this? Why are they needed? What do they do? What are they used for? Do I need to be this user at an