Skip to Content
avatar image
Former Member

F4 help based on criteria.

Hi all,

i am using a F4 help for Bplan that is benefit plan but im not grtting the field displayed on the selection screen.

the code used is :

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_benft.

SELECT bplan barea ltext

INTO CORRESPONDING FIELDS OF TABLE it_benefit

FROM t5uca

WHERE barea = 'US'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'BPLAN'

value_org = 'S'

TABLES

value_tab = it_benefit.

this is not working. can anyone suggest something on this??

thanks,

Poonam.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 13, 2008 at 07:56 AM

    HI,

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    retfield = 'BPLAN'

    dynpprog = sy-cprog

    dynpnr = sy-dynnr

    dynprofield = u2018P_BENFTu2019

    value_org = 'S'

    TABLES

    value_tab = it_benifit.

    • return_tab = i_return[] .

    Thanks,

    Swati

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 13, 2008 at 07:53 AM

    Poonam,

    What happened to return_tab?..try this following

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_benft.
    
    SELECT bplan barea ltext
    INTO CORRESPONDING FIELDS OF TABLE it_benefit
    FROM t5uca
    WHERE barea = 'US'.
    
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'BPLAN'
    value_org = 'S'
    TABLES
    value_tab = it_benefit.
    return_tab = it_rettab
    
    p_bplan-low = it_rettab-fieldval.
    

    Cheers,

    Kothand

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 13, 2008 at 08:09 AM

    hiiiiii

    i think in exporting u have to pass these parameters...

    retfield = 'VBELN'

    DYNPPROG = SY-REPID

    DYNPNR = SY-DYNNR

    DYNPROFIELD = 'P'

    VALUE = SPACE

    VALUE_ORG = 'S'

    DISPLAY = 'F'

    hope it help you.

    regards

    vikalp

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 13, 2008 at 08:10 AM

    Hi,

    Use this code....

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
      DATA it_dynfield TYPE STANDARD TABLE OF dynpread WITH HEADER LINE.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
          request              = 'A'
          translate_to_upper   = 'X'
        TABLES
          dynpfields           = it_dynfield
        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.
     
      READ TABLE it_dynfield WITH KEY fieldname = 'po_no'.
      IF it_dynfield-fieldvalue IS NOT INITIAL.
        po_no = it_dynfield-fieldvalue.
      ENDIF.
     
      SELECT werks FROM ekpo
             WHERE ebeln = po_no
             INTO TABLE  it_help1.
     
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'WERKS'
          dynpprog        = sy-cprog
          dynpnr          = '1000'
          dynprofield     = 'P_WERKS'
          value_org       = 'S'
        TABLES
          value_tab       = it_help1
        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.
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 13, 2008 at 08:59 AM

    Hi,

    it_return type standard table of RETURN_TAB.

    Thanks,

    Swati

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 13, 2008 at 09:26 AM

    Hi,

    Please check this sample code..

    REPORT  yh1152_f1_f4_help.
    
    TABLES
      spfli.
    
    PARAMETERS:
      p_carrid(2) TYPE c OBLIGATORY,
      p_connid LIKE SPFLI-CONNID.
    
    
    DATA:
      BEGIN OF fs_spfli,
        carrid LIKE spfli-carrid,
        connid LIKE spfli-connid,
      END OF fs_spfli.
    
    *INTERNAL TABLES
    DATA:
      t_spfli LIKE                         " FLIGHT INTERNAL TABLE
     STANDARD TABLE
           OF fs_spfli,
    
      t_f1help LIKE                        " F1 HELP INTERNAL TABLE
    STANDARD TABLE
          OF helpval
        WITH HEADER LINE,
    
    * t_F4field LIKE                        " FOR F4 HELP
    *STANDARD TABLE
    *      OF dfies
    *    WITH HEADER LINE,
    
    *RETURN VALUE F4 HELP INTERNAL TABLE
    t_f4help LIKE                          " F4 HELP CARRID INTERNAL TABLE
    STANDARD TABLE
          OF ddshretval
        WITH HEADER LINE,
    
    t_f4carr LIKE                          " F4 HELP CARRID INTERNAL TABLE
    STANDARD TABLE
          OF ddshretval
        WITH HEADER LINE.
    
    
    DATA:
      w_repid TYPE sy-repid,               " Program Name
      w_dynnr TYPE sy-dynnr,               " Screen Number
      w_count LIKE sy-tabix.               " Table Counter
    
    *Initializing
    INITIALIZATION.
      w_repid = sy-repid.
      w_dynnr = sy-dynnr.
    
    *AT SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
       CLEAR P_CONNID.
    
    *F1 help for P_CARRID
    *AT SELECTION-SCREEN ON HELP-REQUEST FOR p_carrid.
    
    AT SELECTION-SCREEN ON HELP-REQUEST FOR p_carrid.
    
      CLEAR t_f1help[].
      t_f1help-fieldname = 'p_carrid'.
      t_f1help-length = 50.
      t_f1help-value = 'This is Airline Carrier ID Ex: ''AA'' ....By NARIN'
    .
      APPEND t_f1help.
    
      CALL FUNCTION 'HELP_GET_VALUES'
        EXPORTING
          popup_title = 'CARRIER ID'
        TABLES
          fields      = t_f1help
        EXCEPTIONS
          no_entries  = 1
          OTHERS      = 2.
    
      IF sy-subrc EQ 1.
        MESSAGE 'No Text Found' TYPE 'I'.
    
      ELSEIF sy-subrc EQ 2.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    
      ENDIF.                               " IF SY-SUBRC EQ 1
    
    *F1 help for P_CONNID
    AT SELECTION-SCREEN ON HELP-REQUEST FOR p_connid.
    
      CLEAR t_f1help[].
      t_f1help-fieldname = 'p_connid'.
      t_f1help-length = 50.
      t_f1help-value = 'This is Airline Connection ID Ex: 0017 ...By NARIN'.
      APPEND t_f1help.
    
      CALL FUNCTION 'HELP_GET_VALUES'
        EXPORTING
          popup_title = 'CONNECTION ID'
        TABLES
          fields      = t_f1help
        EXCEPTIONS
          no_entries  = 1
          OTHERS      = 2.
    
      IF sy-subrc EQ 1.
        MESSAGE 'No Text Found' TYPE 'I'.
    
      ELSEIF sy-subrc EQ 2.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    
    *F4 help for P_CARRID
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carrid.
      CLEAR p_carrid.
      CLEAR P_CONNID.
    
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
        EXPORTING
          tabname           = 'SPFLI'
          fieldname         = 'CARRID'
        TABLES
          return_tab        = t_f4carr
        EXCEPTIONS
          field_not_found   = 1
          no_help_for_field = 2
          inconsistent_help = 3
          no_values_found   = 4
          OTHERS            = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    
      p_carrid = t_f4carr-fieldval.
    
    
    *F4 help for P_CONNID
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_connid.
    
      CLEAR P_CONNID.
      REFRESH t_spfli.
      SELECT DISTINCT
             connid
             carrid
          INTO CORRESPONDING FIELDS OF TABLE t_spfli
          FROM spfli
         WHERE carrid = p_carrid.
    
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'p_connid'
          dynpprog        = w_repid
          dynpnr          = w_dynnr
          value_org       = 'S'
        TABLES
          value_tab       = t_spfli
          return_tab      = t_f4help
        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.
        p_connid = t_f4help-fieldval.
      ENDIF.                               " IF SY-SUBRC NE 0

    Hope this would help you.

    Good luck

    Narin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 13, 2008 at 09:36 AM

    i think no need of return tab

    check this code it working

    parameters p(10) TYPE C.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P.

    **tables vbak.

    data: begin of itab occurs 0,

    s type vbak-vbeln,

    end of itab.

    select vbeln

    from vbak

    into TABLE itab

    WHERE VBELN BETWEEN '0000004000' AND '0000005000'.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    • DDIC_STRUCTURE = ' '

    retfield = 'VBELN'

    • PVALKEY = ' '

    DYNPPROG = SY-REPID

    DYNPNR = SY-DYNNR

    DYNPROFIELD = 'P'

    • STEPL = 0

    • WINDOW_TITLE =

    VALUE = SPACE

    VALUE_ORG = 'S'

    • MULTIPLE_CHOICE = ' '

    DISPLAY = 'F'

    • CALLBACK_PROGRAM = ' '

    • CALLBACK_FORM = ' '

    • MARK_TAB =

    • IMPORTING

    • USER_RESET =

    tables

    value_tab = ITAB[].

    • 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.

    hope it help you

    Add comment
    10|10000 characters needed characters exceeded