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: 

f1 & f4

Former Member
0 Kudos
189

hi all

can anyone help me in codin for pov & poh using function modules

1 ACCEPTED SOLUTION

Former Member
0 Kudos
105

Hi varalakshmi,

F4

-


1. sample code (just copy paste)

2.

REPORT ABC.

*----


DATA : BEGIN OF ITAB OCCURS 0,

UNAME LIKE USR01-BNAME,

END OF ITAB.

data : RETURN_TAB LIKE DDSHRETVAL occurs 0 .

data : RETURN_wa LIKE DDSHRETVAL .

*----


PARAMETERS : A(12) TYPE C.

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR A.

ITAB-UNAME = 'U01'. APPEND ITAB.

ITAB-UNAME = 'U02'. APPEND ITAB.

ITAB-UNAME = 'U03'. APPEND ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ITAB-UNAME'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'A'

  • 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 = FTAB

RETURN_TAB = return_tab

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

break-point.

regards,

amit m.

6 REPLIES 6

Former Member
0 Kudos
106

Hi varalakshmi,

F4

-


1. sample code (just copy paste)

2.

REPORT ABC.

*----


DATA : BEGIN OF ITAB OCCURS 0,

UNAME LIKE USR01-BNAME,

END OF ITAB.

data : RETURN_TAB LIKE DDSHRETVAL occurs 0 .

data : RETURN_wa LIKE DDSHRETVAL .

*----


PARAMETERS : A(12) TYPE C.

*----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR A.

ITAB-UNAME = 'U01'. APPEND ITAB.

ITAB-UNAME = 'U02'. APPEND ITAB.

ITAB-UNAME = 'U03'. APPEND ITAB.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ITAB-UNAME'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'A'

  • 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 = FTAB

RETURN_TAB = return_tab

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

break-point.

regards,

amit m.

Former Member

Former Member
0 Kudos
105

Hello,

In Flow Logic.

Process on value request.

field fieldname module f4_help.

Process on help request.

field fieldname module f1_help.

In report.

Module f4_help.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = p_ref_table

fieldname = p_ref_field

SEARCHHELP = p_search_help

SHLPPARAM = p_search_help_parameter

DYNPPROG = l_actual_program

DYNPNR = l_actual_dynpro

DYNPROFIELD = p_dynpro_field

STEPL = l_tc_actual_line

DISPLAY = space

exceptions

field_not_found = 01

no_help_for_field = 02

inconsistent_help = 03

no_values_found = 04

OTHERS = 99.

endmodule.

U can use any of the Fm for POH

SCPR_HELP

STC1_F4IF_FIELD_VALUE_REQUEST

SDHI F4 interface module for external appl.

F4IF_DISPLAY_VALUES

F4IF_FIELD_VALUE_REQUEST F4 help for fields that are only known at runtime

F4IF_INT_TABLE_VALUE_REQUEST F4 help also returning the value to be displayed in internal table

F4IF_SELECT_VALUES

F4IF_START_VALUE_REQUEST

Z48M_SDHI

Z48M_F4IF_FIELD_VALUE_REQUEST

Module f1_help.

CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'

EXPORTING

DOKLANGU = SY-LANGU

  • DOKTITLE = ' '

  • CALLED_BY_PROGRAM =

  • CALLED_BY_DYNP =

CALLED_FOR_TAB = AKT_FELDER-TABNAME

CALLED_FOR_FIELD = AKT_FELDER-FIELDNAME

  • CALLED_FOR_TAB_FLD_BTCH_INPUT =

  • CALLED_BY_CUAPROG =

  • CALLED_BY_CUASTAT =

  • MERGE_DZ_IF_AVAILABLE =

  • TABLES

  • LINKS =

EXCEPTIONS

OBJECT_NOT_FOUND = 1

SAPSCRIPT_ERROR = 2

OTHERS = 3.

IF NOT SY-SUBRC IS INITIAL.

MESSAGE S720(SH).

  • S720: Keine Dokumentation verfügbar

ENDIF.

endmodule.

If useful reward points.

Regards,

Vasanth

Former Member
0 Kudos
105

hi,

For POV, you go through that program

TYPES: BEGIN OF VALUES,

CARRID TYPE SPFLI-CARRID,

CONNID TYPE SPFLI-CONNID,

END OF VALUES.

DATA: CARRIER(3) TYPE C,

CONNECTION(4) TYPE C.

DATA: PROGNAME LIKE SY-REPID,

DYNNUM LIKE SY-DYNNR,

DYNPRO_VALUES TYPE TABLE OF DYNPREAD,

FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,

VALUES_TAB TYPE TABLE OF VALUES.

CALL SCREEN 100.

MODULE INIT OUTPUT.

PROGNAME = SY-REPID.

DYNNUM = SY-DYNNR.

CLEAR: FIELD_VALUE, DYNPRO_VALUES.

FIELD_VALUE-FIELDNAME = 'CARRIER'.

APPEND FIELD_VALUE TO DYNPRO_VALUES.

ENDMODULE.

MODULE CANCEL INPUT.

LEAVE PROGRAM.

ENDMODULE.

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.

For POH, go through this program.....

DATA: TEXT(30),

VAR(4),

INT TYPE I,

LINKS TYPE TABLE OF TLINE,

FIELD3, FIELD4.

TABLES DEMOF1HELP.

TEXT = TEXT-001.

CALL SCREEN 100.

MODULE CANCEL INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE F1_HELP_FIELD2 INPUT.

INT = INT + 1.

CASE INT.

WHEN 1.

VAR = '0100'.

WHEN 2.

VAR = '0200'.

INT = 0.

ENDCASE.

ENDMODULE.

MODULE F1_HELP_FIELD3 INPUT.

CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'

EXPORTING

DOKLANGU = SY-LANGU

DOKTITLE = TEXT-002

CALLED_FOR_TAB = 'DEMOF1HELP'

CALLED_FOR_FIELD = 'FIELD1'.

ENDMODULE.

MODULE F1_HELP_FIELD4 INPUT.

CALL FUNCTION 'HELP_OBJECT_SHOW'

EXPORTING

DOKCLASS = 'TX'

DOKLANGU = SY-LANGU

DOKNAME = 'DEMO_FOR_F1_HELP'

DOKTITLE = TEXT-003

TABLES

LINKS = LINKS.

ENDMODULE.

former_member188685
Active Contributor
0 Kudos
105

Hi,

Check these Demo's For F1 help..

DEMO_DYNPRO_F1_HELP

DEMO_SELECTION_SCREEN_F1

Check these Demo's For F4 Help

DEMO_DYNPRO_F4_HELP_DICTIONARY

DEMO_DYNPRO_F4_HELP_DYNPRO

DEMO_DYNPRO_F4_HELP_MODULE

DEMO_SELECTION_SCREEN_F4

Regards

vijay