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 help on ALV grid display????

Former Member
0 Kudos

Hi ,

Can some body tell how to provide an F4 help on the ALV grid display OUTPUT.

7 REPLIES 7

Sm1tje
Active Contributor
0 Kudos

Check report BCALV_F4.

and some other as well:

BCALV_GRID_F4_HELP_APPLICATION

BCALV_GRID_F4_HELPM01

BCALV_TEST_GRID_F4_HELP

Edited by: Micky Oestreich on Apr 15, 2008 11:22 AM

Former Member
0 Kudos

we r already using a function module 'REUSE_ALV_GRID_DISPLAY' i want to know is their any option which can help me providing f4 help on the output field

Former Member
0 Kudos

hi there

refer this program.....hope it will be useful

REPORT BCALV_GRID_EDIT_DELTA.

----


  • CLASS grid_appl DEFINITION

----


  • ........ *

----


CLASS GRID_APPL DEFINITION.

PUBLIC SECTION.

DATA: MY_GRID TYPE REF TO CL_GUI_ALV_GRID.

METHODS: CONSTRUCTOR,

NEW_TABLE,

WRITE_FROM_TABLE,

WRITE_TO_TABLE,

CHANGE_STYLE.

ENDCLASS. "grid_appl

----


  • CLASS lcl_event_receiver DEFINITION

----


  • ........ *

----


CLASS LCL_EVENT_RECEIVER DEFINITION.

PUBLIC SECTION.

CLASS-METHODS: ON_USER_COMMAND

FOR EVENT BEFORE_USER_COMMAND OF CL_GUI_ALV_GRID

IMPORTING E_UCOMM

SENDER,

ON_TOOLBAR FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID

IMPORTING E_OBJECT

E_INTERACTIVE

SENDER,

ON_DELAYED_CHANGED_SEL FOR EVENT DELAYED_CALLBACK OF

CL_GUI_ALV_GRID.

ENDCLASS. "lcl_event_receiver DEFINITION

  • data for report and dynpro

DATA: INFO(80),

OK_CODE LIKE SY-UCOMM.

  • data for grid

DATA: GS_LAYOUT TYPE LVC_S_LAYO,

GT_FIELDCAT TYPE LVC_T_FCAT,

GS_FIELDCAT TYPE LVC_S_FCAT,

GT_OUTTAB TYPE TABLE OF SFLIGHT,

GS_OUTTAB LIKE LINE OF GT_OUTTAB,

LS_TOOLBAR TYPE STB_BUTTON.

  • custom control and grid_application object

DATA: MY_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,

MY_APPLICATION TYPE REF TO GRID_APPL.

  • data for changing the toolbar

DATA: LT_EXCLUDE TYPE UI_FUNCTIONS,

LS_EXCLUDE TYPE UI_FUNC.

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

  • Selection Screen

*----


PARAMETERS: P_MAXROW TYPE I DEFAULT 60.

SELECTION-SCREEN BEGIN OF BLOCK V WITH FRAME TITLE TEXT-012.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: NO_VAL RADIOBUTTON GROUP TAB1.

SELECTION-SCREEN COMMENT 3(25) TEXT-017.

PARAMETERS NO_MES RADIOBUTTON GROUP TAB1.

SELECTION-SCREEN COMMENT 31(25) TEXT-018.

PARAMETERS ERR_MES RADIOBUTTON GROUP TAB1.

SELECTION-SCREEN COMMENT 59(25) TEXT-019.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK V.

START-OF-SELECTION.

END-OF-SELECTION.

CALL SCREEN 200.

INCLUDE <ICON>.

INCLUDE BCALV_GRID_EDIT_DELTA_APPL.

INCLUDE BCALV_GRID_EDIT_DELTA_EVENT.

----


  • MODULE exit2 INPUT *

----


  • ........ *

----


MODULE EXIT2 INPUT.

CASE OK_CODE.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

WHEN 'CANCEL'.

LEAVE PROGRAM.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'OK'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. "exit2 INPUT

&----


*& Module set_status2 OUTPUT

&----


  • text

----


MODULE SET_STATUS2 OUTPUT.

SET PF-STATUS 'MAIN200'.

SET TITLEBAR 'MAIN200'.

ENDMODULE. " set_status2 OUTPUT

&----


*& Module create_objects OUTPUT

&----


  • text

----


MODULE CREATE_OBJECTS OUTPUT.

IF MY_CONTAINER IS INITIAL.

CREATE OBJECT MY_CONTAINER EXPORTING CONTAINER_NAME = 'CONTAINER'.

CREATE OBJECT MY_APPLICATION.

SET HANDLER LCL_EVENT_RECEIVER=>ON_USER_COMMAND FOR ALL INSTANCES.

SET HANDLER LCL_EVENT_RECEIVER=>ON_TOOLBAR FOR ALL INSTANCES.

SET HANDLER LCL_EVENT_RECEIVER=>ON_DELAYED_CHANGED_SEL FOR ALL

INSTANCES.

ENDIF.

ENDMODULE. " create_objects OUTPUT

&----


*& Module fill_data

&----


  • text

----


MODULE FILL_DATA OUTPUT.

SELECT * FROM SFLIGHT INTO TABLE GT_OUTTAB UP TO P_MAXROW ROWS.

CALL METHOD MY_APPLICATION->NEW_TABLE.

ENDMODULE. " fill_data INPUT

pls reward if useful

regards,

rekha

peter_ruiz2
Active Contributor
0 Kudos

hi,

use this code


    data: lwa_f4tab TYPE lvc_s_f4.

    lwa_f4tab-fieldname  = 'GLACC'.
    lwa_f4tab-register   = 'X'.
    lwa_f4tab-getbefore  = 'X'.
    lwa_f4tab-chngeafter = 'X'.
    APPEND lwa_f4tab TO lit_f4tab.
    CLEAR lwa_f4tab.

    lwa_f4tab-fieldname  = 'LTEXT'.
    lwa_f4tab-register   = 'X'.
    lwa_f4tab-getbefore  = 'X'.
    lwa_f4tab-chngeafter = 'X'.
    APPEND lwa_f4tab TO lit_f4tab.
    CLEAR lwa_f4tab.

    CALL METHOD go_gridx->register_f4_for_fields
      EXPORTING
        it_f4  = lit_f4tab[].

regards,

Peter

Former Member
0 Kudos

Hi,

Refer to the following program:

BCALV_EDIT_08 This report implements an ALV Grid Control with an application specific F4 help. The following aspects

are dealt with:

(1) how to replace the standard f4 help

(2) how to pass the selected value to the ALV Grid Control

(3) how to build an f4 help, whose value range depend on a value of another cell.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos

hii read nd try ths.

For F4 help, you must register the fields whose F4 request will trigger the “onf4” event. For this you must prepare a table of type “LVC_T_F4” and register this table using the method “register_f4_for_fields”.

While preparing table you must include a line for each field which will trigger F4 event. For each field in the structure;

Pass the fieldname to ‘FIELDNAME’

Set ‘REGISTER’ to make the field registered,

Set ‘GETBEFORE’ to provide field content transport before F4 in editable mode

Set ‘CHNGEAFTER’ to make the data changed after F4 in editable mode.

Preparing table for the fields to be registered to trigger F4 event

DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE .

.. ..

lt_f4-fieldname = 'PRICE'.

lt_f4-register = 'X' .

lt_f4-getbefore = 'X' .

APPEND lt_f4 .

CALL METHOD gr_alvgrid->register_f4_for_fields

EXPORTING

it_f4 = lt_f4[] .

A sample “onf4” method implementation

METHOD handle_on_f1 .

PERFORM f4_help USING e_fieldname es_row_no .

er_event_data->m_event_handled = 'X' .

ENDMETHOD .

Again, we set the attribute “er_event_data->m_event_handled” to prevent further processing of standard F4 help.

plz reward if helpful.

Former Member
0 Kudos

Hi

see these two programs u can get solution.

BCALV_TEST_GRID_EDIT

BCALV_TEST_GRID_F4_HELP