Skip to Content
avatar image
Former Member

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • Best Answer
    Jul 29, 2008 at 03:38 AM
    data lt_dfies TYPE  dfies OCCURS 0.
    
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
    retfield = 'NAME'  >=== should be caps
    PVALKEY = ' ' 
    DYNPPROG = prog_name
    DYNPNR =  sy-dynnr     <=====
    DYNPROFIELD = 'IO_BANKNM'
    STEPL = 0 
    WINDOW_TITLE = 'bank name'
    VALUE = ' ' 
    VALUE_ORG = 'S'   <==== is should be S
    tables
    value_tab = t_bk
    field_tab   = lt_dfies
    EXCEPTIONS 
    PARAMETER_ERROR = 1 
    NO_VALUES_FOUND = 2 
    OTHERS = 3
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 03:20 AM

    I changed the VALUE_ORG from 'C' to 'S', and it popup the right window.

    But when double click one line, there is no value selected for the screen parameter 'IO_BANKNM'.

    Can anyone help?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 03:26 AM

    Hi Yimeng,

    Suggest you to do Search on 'F4IF_INT_TABLE_VALUE_REQUEST' in this forum.

    There are lots of sample code available for this FM.

    You can use that for reference.

    Hope this helps.

    Manish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 03:36 AM

    Pass these parameters to your FM....

    DDIC_STRUCTURE = 'BNKA'

    retfield = 'BANKA'

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 03:47 AM

    Hello Yimeng

    If you want to return any search help field you have to tell the fm its name:

      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
    *     DDIC_STRUCTURE         = ' '
         retfield               = 'IO_BANKNM'
    *     PVALKEY                = ' '
    *     DYNPPROG               = ' '
    *     DYNPNR                 = ' '
    *     DYNPROFIELD            = ' '
    *     STEPL                  = 0
    *     WINDOW_TITLE           =
    *     VALUE                  = ' '
    *     VALUE_ORG              = 'S'
    *     MULTIPLE_CHOICE        = ' '
         display                = i_display
    *     CALLBACK_PROGRAM       = ' '
    *     CALLBACK_FORM          = ' '
       tables
         value_tab              = lt_values
    *     field_tab              = lt_fields
         return_tab             = lt_return
    *     DYNPFLD_MAPPING        =
       exceptions
         parameter_error        = 1
         no_values_found        = 2
         others                 = 3.
    

    If you want to put the returned value into a dynpro field you need to provide all required data (see fm documentation):

    ...
    Return the selection in the screen
    
        If the screen information DYNPPROG, DYNPNR, DYNPROFIELD and possibly
        STEPL are also defined, the selected value is automatically returned in
        the screen field.
    
    ...
    

    Regards

    Uwe

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 05:12 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 05:16 AM

    pass the value of ret_field in upper case

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 05:20 AM

    Hi Yimeng,

    plz refer to the code below:

    F4IF_INT_TABLE_VALUE_REQUEST

    F4 help that returns the values selected in an internal table. Very handy when programming your very own F4 help for a field.

    data:
        begin of t_values occurs 2,
          value like kna1-begru,
        end of t_values,
    
        t_return like ddshretval occurs 0 with header line.
    
      t_values = 'PAR*'.
      append t_values.
    
      t_values = 'UGG'.
      append t_values.
    
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
           exporting
                retfield        = 'BEGRU'
                value_org       = 'S'
           tables
                value_tab       = t_values
                return_tab      = t_return
           exceptions
                parameter_error = 1
                no_values_found = 2
                others          = 3.
    
      if sy-subrc = 0.
        read table t_return index 1.
    
        o_begru-low = t_return-fieldval.
    
        if o_begru-low = 'PAR*'.
          o_begru-option = 'CP'.
        else.
          o_begru-option = 'EQ'.
        endif.
    
        o_begru-sign = 'I'.
    
        append o_begru to s_begru.
      else.
        o_begru = i_begru.
      endif.

    Also you can refer to the link below:

    http://sap.niraj.tripod.com/id27.html

    With luck,

    Pritam.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 05:28 AM

    Thanks for all guys, although I can only give the scores to only one of your.

    Add comment
    10|10000 characters needed characters exceeded