Application Development and Automation 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: 
Read only

F4 help

Former Member
0 Likes
724

Hi all,

I've created an F4 help for a field called a"ctivity code".

Field length is 4 and is of 'char' type. The values are getting displayed in the f4 help, but the problem is , I'm not able to select any of the values. Please suggest a solution.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
702

Hello Pranil,

Maybe you did not give the READ statement

Try this..


PARAMETERS:
 p_carr TYPE s_carr_id,
 p_conn TYPE dfies-fieldname.
DATA:
  w_repid LIKE sy-repid,
  w_dnum LIKE sy-dynnr,
  t_return LIKE TABLE OF ddshretval WITH HEADER LINE.
DATA:
  BEGIN OF tab OCCURS 0,
    carrid LIKE spfli-carrid,
    connid LIKE spfli-connid,
  END OF tab.

AT SELECTION-SCREEN.
  IF p_carr IS NOT INITIAL.
    SELECT carrid connid
      FROM spfli
      INTO TABLE tab
     WHERE carrid EQ p_carr.
  ELSE.
    SELECT carrid connid
      FROM spfli
      INTO TABLE tab.
  ENDIF.

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.

ENDIF.

Regards

Indu

6 REPLIES 6
Read only

Former Member
0 Likes
702

hi check this program...it is working fine..

http://sapprograms.blogspot.com/2008/04/f4-help-for-z-table.html

Read only

Former Member
0 Likes
703

Hello Pranil,

Maybe you did not give the READ statement

Try this..


PARAMETERS:
 p_carr TYPE s_carr_id,
 p_conn TYPE dfies-fieldname.
DATA:
  w_repid LIKE sy-repid,
  w_dnum LIKE sy-dynnr,
  t_return LIKE TABLE OF ddshretval WITH HEADER LINE.
DATA:
  BEGIN OF tab OCCURS 0,
    carrid LIKE spfli-carrid,
    connid LIKE spfli-connid,
  END OF tab.

AT SELECTION-SCREEN.
  IF p_carr IS NOT INITIAL.
    SELECT carrid connid
      FROM spfli
      INTO TABLE tab
     WHERE carrid EQ p_carr.
  ELSE.
    SELECT carrid connid
      FROM spfli
      INTO TABLE tab.
  ENDIF.

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.

ENDIF.

Regards

Indu

Read only

Former Member
0 Likes
702

Hii!

After calling function module for F4 help, you have to assign

'fieldval' of structure ddshretval to your screen field(parameter).

Here after calling function module . i have used

p_carrid = table1-fieldval.

Check this sample code


REPORT  z_test11 .


PARAMETERS:
  p_carrid(2).



DATA: table1 LIKE
             ddshretval
    OCCURS 0 WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carrid.


CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
  EXPORTING
    tabname                   = 'scarr'
    fieldname                 = 'carrid'
*   SEARCHHELP                = ' '
*   SHLPPARAM                 = ' '
*   DYNPPROG                  = ' '
*   DYNPNR                    = ' '
*   DYNPROFIELD               = 'p_carrid'
*   STEPL                     = 0
*   VALUE                     = ' '
*   MULTIPLE_CHOICE           = ' '
*   DISPLAY                   =  ' '
*   SUPPRESS_RECORDLIST       = ' '
*   CALLBACK_PROGRAM          = ' '
*   CALLBACK_FORM             = ' '
*   SELECTION_SCREEN          = ' '
 TABLES
   RETURN_TAB                 = table1
 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 = table1-fieldval.

start-of-selection.
write: p_carrid.

Regards

Abhijeet

Read only

former_member217544
Active Contributor
0 Likes
702

Hi,

If it is ALV then check whether the field is in editable mode or not.

Regards,

Swarna Munukoti

Edited by: Swarna Munukoti on Aug 6, 2008 1:11 PM

Read only

Former Member
0 Likes
702

Hi,

Use the Function module

'F4IF_INT_TABLE_VALUE_REQUEST' for F4 help.

Regards,

Sujit

Read only

Former Member
0 Likes
702

Hi Pranil,

Try this...

DATA : t_dynmap LIKE dselc OCCURS 0 WITH HEADER LINE,

t_fldtab LIKE dfies OCCURS 0 WITH HEADER LINE.

DATA : return TYPE TABLE OF ddshretval WITH HEADER LINE.

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

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'FIELD'

dynpprog = 'ZTEST'

dynpnr = '1000'

dynprofield = 'S_PZ-LOW'

value_org = 'S'

window_title = 'TEST VALUES'

TABLES

field_tab = t_fldtab

value_tab = it_pz

return_tab = return

dynpfld_mapping = t_dynmap.

  • Read return table and place that on low value of S_PZ

READ TABLE return INDEX 1.

s_pz-low = return-fieldval.

where it_pz is an internal table in which I hv the values.

Regards

Mamtha