Application Development 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: 

F4IF_INT_TABLE_VALUE_REQUEST

Former Member
0 Kudos
186

Dear All,

Thanks in Advance,

The requirement is if the User Selects one fields in F4 Help the corresponding data should come and sit in the rest of the Fields.

I think this we can achive using F4IF_INT_TABLE_VALUE_REQUEST Function Module.

Will any body send the code or help in this issue.

Regards:

Sridhar

1 ACCEPTED SOLUTION

Former Member
0 Kudos
135

Hi,

When declaring variable refer to Foreign key table instead of Parent Table.

EX: SPFLI is Header table to use carrid and Connid

Use its child table Sflight.and you will get F4 help of one field depending on other.

Parameters:

P_Carrid type sflight-carrid,

p_connid type sflight-connid.

Enter value in carrid..when you press F4 on Connid you will get Values based on Carrid.

OR

Use At selection-screen for value-request for bukrs.

PARAMETERS: Bukrs TYPE spfli-carrid,

name1 TYPE spfli-carrid.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR name1.

CALL SCREEN 100 STARTING AT 10 5

ENDING AT 50 10.

MODULE value_list OUTPUT.

SUPPRESS DIALOG.

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

SET PF-STATUS space.

NEW-PAGE NO-TITLE.

select single bukrs from <Databasetable> into <ITAB>-BUkrs

where name1 = name1.

Write : / Itab-bukrs.

hide bukrs.

Endselect.

ENDMODULE.

AT LINE-SELECTION.

CHECK NOT name1 IS INITIAL.

LEAVE TO SCREEN 0.

Regards,

GP

10 REPLIES 10

Former Member
0 Kudos
135

hi....

THIS IS A TESTED CODE

******************************************

TABLES:

sflight.

PARAMETERS:

p_conn TYPE sflight-connid,

p_carr TYPE sflight-carrid.

DATA:

w_field TYPE dfies-fieldname.

TYPES:

BEGIN OF type_s_carr,

carrid TYPE sflight-carrid,

END OF type_s_carr.

DATA:

t_table TYPE

STANDARD TABLE

OF type_s_carr

WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carr.

SELECT carrid

FROM sflight

INTO TABLE t_table

UP TO 1 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'CARRID'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

  • VALUE_ORG = 'C'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = t_table

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

REGARDS

Former Member
0 Kudos
135

Hi,

This is an example...

Just try it...

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.

endif.

Regards

Kiran

Former Member
0 Kudos
135

&----


*& *

*& F4 Help for p_name1 *

&----


at selection-screen on value-request for p_name1.

REFRESH t_itab.

REFRESH field_tab.

field_tab-fieldname = 'ERNAM'. -


> here u can write select quary and get the data to ur internal table

field_tab-tabname = 'VBAK'.

APPEND field_tab.

t_itab-name = 'Andrews'.

append t_itab.

t_itab-name = 'Jennie'.

append t_itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = field_tab-fieldname

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

WINDOW_TITLE = 'Select name'

  • VALUE = ' '

  • VALUE_ORG = 'C'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = t_itab----


>internaltable name

FIELD_TAB = field_tab

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

else.

p_name1 = return_tab-fieldval.

ENDIF.

Former Member
0 Kudos
136

Hi,

When declaring variable refer to Foreign key table instead of Parent Table.

EX: SPFLI is Header table to use carrid and Connid

Use its child table Sflight.and you will get F4 help of one field depending on other.

Parameters:

P_Carrid type sflight-carrid,

p_connid type sflight-connid.

Enter value in carrid..when you press F4 on Connid you will get Values based on Carrid.

OR

Use At selection-screen for value-request for bukrs.

PARAMETERS: Bukrs TYPE spfli-carrid,

name1 TYPE spfli-carrid.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR name1.

CALL SCREEN 100 STARTING AT 10 5

ENDING AT 50 10.

MODULE value_list OUTPUT.

SUPPRESS DIALOG.

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

SET PF-STATUS space.

NEW-PAGE NO-TITLE.

select single bukrs from <Databasetable> into <ITAB>-BUkrs

where name1 = name1.

Write : / Itab-bukrs.

hide bukrs.

Endselect.

ENDMODULE.

AT LINE-SELECTION.

CHECK NOT name1 IS INITIAL.

LEAVE TO SCREEN 0.

Regards,

GP

faisal_altaf2
Active Contributor
0 Kudos
135

Hi,

Please Test my Sample Code in the Thread Bellow hope will solve out your problem,

[F4 Help Select Option|;

Kind Regards,

Faisal

Edited by: Faisal Altaf on Feb 17, 2009 11:59 AM

Former Member
0 Kudos
135

Hi Sridhar,

Try with below code.

Declaration of Internal tables

DATA: LI_RETURN TYPE DDSHRETVAL OCCURS 0 WITH HEADER LINE,

LI_HFLDTAB LIKE DFIES OCCURS 0 WITH HEADER LINE.

Declarations of local variables

DATA: LV_RETFIELD TYPE DFIES-FIELDNAME,

LV_TABNAME TYPE DFIES-TABNAME.

LOOP AT LI_HFLDTAB.

MOVE HFLDTAB-TABNAME TO LI_HFLDTAB-TABNAME.

MOVE HFLDTAB-FIELDNAME TO LI_HFLDTAB-FIELDNAME.

APPEND LI_HFLDTAB.

REFRESH LI_HFLDTAB.

ENDLOOP.

LV_RETFIELD = 'FELDN'.

LV_TABNAME = 'F110HELP'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

DDIC_STRUCTURE = lv_tabname

RETFIELD = lv_retfield

DISPLAY = space

TABLES

VALUE_TAB = HVALTAB

FIELD_TAB = LI_HFLDTAB

RETURN_TAB = LI_RETURN

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

IF SY-SUBRC = 0.

IF li_return[] is not Initial.

Read table li_return index 1.

FELDNAME = li_return-fieldval.

ENDIF.

ENDIF.

Thanks

Syf

I355602
Advisor
Advisor
0 Kudos
135

Hi,

Follow code:-


REPORT  z_f1f4.

CALL SCREEN 1010.
*&---------------------------------------------------------------------*
*&      Module  GET_F4_HELP  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE get_f4_help INPUT.

  TYPES : BEGIN OF it,
            area TYPE yapn-area,
          END OF it.

  DATA : itab TYPE STANDARD TABLE OF it WITH HEADER LINE,
         tb_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE,
         spey TYPE yapn-spey.

  CLEAR:   tb_dynpfields.
  REFRESH: tb_dynpfields.

  MOVE 'YAPN-SPEY' TO tb_dynpfields-fieldname.
  APPEND tb_dynpfields.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname                               = 'Z_F1F4'
      dynumb                               = '1010'
*   TRANSLATE_TO_UPPER                   = ' '
*   REQUEST                              = ' '
*   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                           = tb_dynpfields
* 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.

  READ TABLE tb_dynpfields INDEX 1.
  IF sy-subrc EQ 0.
    spey = tb_dynpfields-fieldvalue.
  ELSE.
    spey = ' '.
  ENDIF.

  IF spey EQ ' '.
    itab-area = 'Fresher'.
    APPEND itab.
  ESLE.
    SELECT area FROM yapn
      INTO TABLE itab
    WHERE
      spey = spey.
  ENDIF.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*   DDIC_STRUCTURE         = ' '
      retfield               = 'AREA'
*   PVALKEY                = ' '
     dynpprog               = 'Z_F1F4'
     dynpnr                 = '1010'
     dynprofield            = 'AREA'
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
   value_org              = 'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   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.


ENDMODULE.                 " GET_F4_HELP  INPUT

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Former Member
0 Kudos
135

Hi Sridhar,

I have written a code for the same requirement please try that out, but after pressing F4 and selecting the value, you have to press enter to get the value of other fields...

but if you dont want that you can as well create a search help that will 100% serve you the purpose...

TABLES: SCARR.

parameters P_CARRID TYPE SCARR-CARRID .
PARAMETERS S_CARRN TYPE SCARR-CARRNAME.

DATA: i_return TYPE ddshretval OCCURS 0 WITH HEADER LINE,
      c TYPE c VALUE 'S'.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CARRID.

  TYPES: BEGIN OF fs,
    CARRID LIKE SCARR-CARRID,
  END OF fs.

  DATA: itab TYPE STANDARD TABLE OF fs WITH HEADER LINE.

  SELECT CARRID
    INTO TABLE itab
    FROM SCARR.


  SORT itab BY CARRID.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'P_CARRID'
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'P_CARRID'
      value_org   = c
    TABLES
      value_tab   = itab
      return_tab  = i_return.


  LOOP AT I_RETURN.
  ENDLOOP.

  P_CARRID = I_RETURN-FIELDVAL.
    DATA : W_CARRNAME LIKE SCARR-CARRNAME.

  SELECT SINGLE CARRNAME FROM SCARR INTO W_CARRNAME
  WHERE CARRID = P_CARRID.

  S_CARRN = W_CARRNAME.

Regards,

Siddarth

Former Member
0 Kudos
135

Hi Sridhar,

I have written a sample code for F4 help. Kindly have a look.

  • Declaration of Internal tables

DATA: LI_RETURN TYPE DDSHRETVAL OCCURS 0 WITH HEADER LINE,

LI_HFLDTAB LIKE DFIES OCCURS 0 WITH HEADER LINE.

  • Declarations of local variables

DATA: LV_RETFIELD TYPE DFIES-FIELDNAME,

LV_TABNAME TYPE DFIES-TABNAME.

LOOP AT LI_HFLDTAB.

MOVE HFLDTAB-TABNAME TO LI_HFLDTAB-TABNAME.

MOVE HFLDTAB-FIELDNAME TO LI_HFLDTAB-FIELDNAME.

APPEND LI_HFLDTAB.

REFRESH LI_HFLDTAB.

ENDLOOP.

LV_RETFIELD = 'FELDN'.

LV_TABNAME = 'F110HELP'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

DDIC_STRUCTURE = lv_tabname

RETFIELD = lv_retfield

DISPLAY = space

TABLES

VALUE_TAB = HVALTAB

FIELD_TAB = LI_HFLDTAB

RETURN_TAB = LI_RETURN

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

IF SY-SUBRC = 0.

IF li_return[] is not Initial.

Read table li_return index 1.

FELDNAME = li_return-fieldval.

ENDIF.

ENDIF.

I hope this would solve the query.

Regards,

Abdur

Former Member
0 Kudos
135

Hi,

Check the below code

tables kna1.

data:

begin of t_values occurs 2,

value like kna1-begru,

end of t_values,

t_return like ddshretval occurs 0 with header line.

select-options s_begru for kna1-begru.

at selection-screen on value-request for s_begru-low.

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.

endif.

Regards,

Anki Reddy