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: 

F4 functionality

Former Member
0 Kudos

Hi experts,

Iam working on dialog program.

I have created ITAB with kunnr,name1 fields.In the output screen field i would like to display ITAB values.

This is my program.Iam not getting values...



  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
 *     RETFIELD    = 
      DYNPPROG    = SY-CPROG
      DYNPNR      = SY-DYNNR
      DYNPROFIELD = 'ZTAB-KUNNR'
      VALUE_ORG   = 'S'
    TABLES
      VALUE_TAB   = ITAB.

thanks

kaki

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Try like this and reward points if it helps.

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT.

FIELD s_begru MODULE abc ON INPUT.

Process on value-request.

field s_begru module f4_help.

&----


*& Report ZZZ_JAYTEST1 *

*& *

&----


*& *

*& *

&----


REPORT ZZZ_JAYTEST1 .

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.

data s_begru like kna1-begru.

call screen 9000.

&----


*& Module f4_help INPUT

&----


  • text

----


module f4_help input.

refresh t_values.

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.

s_begru = t_return-fieldval.

endif.

endmodule. " f4_help INPUT

&----


*& Module abc INPUT

&----


  • text

----


module abc input.

read table t_values with key value = s_begru.

if sy-subrc ne 0.

clear s_begru.

endif.

endmodule. " abc INPUT

5 REPLIES 5

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Try like this and reward points if it helps.

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT.

FIELD s_begru MODULE abc ON INPUT.

Process on value-request.

field s_begru module f4_help.

&----


*& Report ZZZ_JAYTEST1 *

*& *

&----


*& *

*& *

&----


REPORT ZZZ_JAYTEST1 .

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.

data s_begru like kna1-begru.

call screen 9000.

&----


*& Module f4_help INPUT

&----


  • text

----


module f4_help input.

refresh t_values.

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.

s_begru = t_return-fieldval.

endif.

endmodule. " f4_help INPUT

&----


*& Module abc INPUT

&----


  • text

----


module abc input.

read table t_values with key value = s_begru.

if sy-subrc ne 0.

clear s_begru.

endif.

endmodule. " abc INPUT

Former Member
0 Kudos

hi

good

you can use the event POV(Process On Value) to get the F4 help for any particular field.

in report write this statement->

MODULE value_carrier INPUT.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = 'DEMOF4HELP'

fieldname = 'CARRIER1'

dynpprog = progname

dynpnr = dynnum

dynprofield = 'CARRIER'.

ENDMODULE.

MODULE value_connection INPUT.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = progname

dynumb = dynnum

translate_to_upper = 'X'

TABLES

dynpfields = dynpro_values.

READ TABLE dynpro_values INDEX 1 INTO field_value.

SELECT carrid connid

FROM spfli

INTO CORRESPONDING FIELDS OF TABLE values_tab

WHERE carrid = field_value-fieldvalue.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CONNID'

dynpprog = progname

dynpnr = dynnum

dynprofield = 'CONNECTION'

value_org = 'S'

TABLES

value_tab = values_tab.

ENDMODULE.

in se51 flow logic write like this

PROCESS BEFORE OUTPUT.

MODULE init.

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.

PROCESS ON VALUE-REQUEST.

FIELD carrier MODULE value_carrier.

FIELD connection MODULE value_connection.

-


it ll work definitelty.

thanks

mrutyun^

Former Member
0 Kudos

Hi Kaki,

specify which field to be retrived of your internal table in 'retfield' parameter.

-Anu.

Former Member
0 Kudos

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'KUNNR'

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'ZTAB-KUNNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB.

open the return field structure for that field where u want to see the f4 functionality.

regards,

vijay

Former Member
0 Kudos

Hi Kaki,

i try it in this way and it works OK.

REPORT ZGRO_TEST1.

*

TABLES: VBAK.

*

PARAMETERS: P_VBELN LIKE VBAK-VBELN.

*

  • Felder für F4

DATA: BEGIN OF VALUE_TAB OCCURS 0,

VALUE(20),

END OF VALUE_TAB.

*

DATA: BEGIN OF FIELD_TAB OCCURS 0.

INCLUDE STRUCTURE DFIES.

DATA END OF FIELD_TAB.

*

DATA: BEGIN OF RETURN_TAB OCCURS 0.

INCLUDE STRUCTURE DDSHRETVAL.

DATA END OF RETURN_TAB.

*

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VBELN.

*

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'VBELN'

WINDOW_TITLE = 'Order-Selection'

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.

WRITE: / SY-SUBRC.

ELSE.

P_VBELN = RETURN_TAB-FIELDVAL.

ENDIF.

*

INITIALIZATION.

*

  • Vorbereitung für F4

FIELD_TAB-TABNAME = 'VBAK'.

FIELD_TAB-FIELDNAME = 'VBELN'.

APPEND FIELD_TAB.

*

FIELD_TAB-TABNAME = 'VBAK'.

FIELD_TAB-FIELDNAME = 'ERNAM'.

APPEND FIELD_TAB.

*

SELECT * FROM VBAK WHERE ERNAM = SY-UNAME.

MOVE VBAK-VBELN TO VALUE_TAB-VALUE. APPEND VALUE_TAB.

MOVE VBAK-ERNAM TO VALUE_TAB-VALUE. APPEND VALUE_TAB.

ENDSELECT.

*

START-OF-SELECTION.

*

WRITE: / P_VBELN.

*

END-OF-SELECTION.

*

It's a short example for VBAK-VBELN which you have to update to your own..

Regards, Dieter

Problem solved??

Regards, Dieter

Message was edited by: Dieter Gröhn