Alv class

CALL METHOD go_grid->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
CHANGING it_outtab = gi_sfligt
iam new to alv class, plss help
i want to know how will i get the class method go_grid?
do i have to click on pattern?
can anyone tell me the steps...to call the
class method set_table_for_first_display?
its urgent do reply

Hai Chauhan
Check the following Code
REPORT ZALV_SALES_HEADER_DETAIL MESSAGE-ID Z50650(MSG) .
TABLES
TABLES: VBAK . "SALES DOCUMENT HEADER
DATA OBJECTS DECLARATION
DATA: IT_VBAK TYPE STANDARD TABLE OF ZVBAK_STRUC,
IT_VBAP TYPE STANDARD TABLE OF ZVBAP_STRUC,
GS_LAYOUT TYPE LVC_S_LAYO,
GS1_LAYOUT TYPE LVC_S_LAYO,
GRID TYPE REF TO CL_GUI_ALV_GRID,
CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
VBAK_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
VBAP_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
WA_VBAK LIKE LINE OF IT_VBAK,
WA_VBAP LIKE LINE OF IT_VBAP,
SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
TOP_OF_PAGE_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
GRID_VBAP TYPE REF TO CL_GUI_ALV_GRID,
TOP_PAGE TYPE REF TO CL_DD_DOCUMENT,
FLAG(1).
*"EVENT RECIEVER CLASS DEFINITION
CLASS LCL_EVENT_RECIEVER DEFINITION DEFERRED.
DATA: OBJ_EVENT TYPE REF TO LCL_EVENT_RECIEVER.
SELECTION-SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
SELECTION-SCREEN: END OF BLOCK B1.
CLASS DEFINITION AND DECLARATIONS
CLASS LCL_EVENT_RECIEVER DEFINITION.
PUBLIC SECTION.
EVENTS:DOUBLE_CLICK,
TOP_OF_PAGE.
METHODS:HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW .
METHODS: HANDLE_TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID.
ENDCLASS. "LCL_EVENT_RECIEVER DEFINITION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION.
METHOD: HANDLE_DOUBLE_CLICK.
READ TABLE IT_VBAK INDEX E_ROW-INDEX INTO WA_VBAK.
PERFORM FETCH_ITEM_DETAILS USING WA_VBAK.
PERFORM ALV_GRID.
ENDMETHOD. "HANDLE_DOUBLE_CLICK
METHOD: HANDLE_TOP_OF_PAGE.
CALL METHOD TOP_PAGE->ADD_TEXT
EXPORTING
TEXT = 'SALES HEADER & ITEM DETAILS'.
CALL METHOD TOP_PAGE->DISPLAY_DOCUMENT
EXPORTING
PARENT = TOP_OF_PAGE_CONTAINER.
ENDMETHOD. "HANDLER_TOP_OF_PAGE
ENDCLASS. "LCL_EVENT_RECIEVER IMPLEMENTATION
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
IF S_VBELN IS NOT INITIAL.
SELECT COUNT(*)
FROM VBAK
WHERE VBELN IN S_VBELN.
IF SY-DBCNT = 0.
MESSAGE E000 WITH 'NO TABLE ENTRIES FOUND FOR LOW KEY SPECIFIED'.
ENDIF.
ENDIF.
START-OF-SELECTION.
START-OF-SELECTION.
PERFORM FETCH_SALES_HEADER_RECORD.
PERFORM CREATE_CALL. "CREATION OF OBJECTS & CALLING METHODS
END-OF-SELECTION.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Form FETCH_SALES_HEADER_RECORD
text
--> p1 text
<-- p2 text
FORM FETCH_SALES_HEADER_RECORD .
SELECT
VBELN
AUDAT
VBTYP
AUART
AUGRU
NETWR
WAERK
FROM VBAK
INTO CORRESPONDING FIELDS OF TABLE IT_VBAK
WHERE VBELN IN S_VBELN
AND VBTYP = P_VBTYP.
ENDFORM. " FETCH_SALES_HEADER_RECORD
*& Form CREATE_CALL
text
--> p1 text
<-- p2 text
FORM CREATE_CALL .
IF CUSTOM_CONTAINER IS INITIAL.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
PARENT =
CONTAINER_NAME = 'CUSTOM_CONTAINER'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT SPLITTER
EXPORTING
TOP = 5
PARENT = CUSTOM_CONTAINER
ROWS = 3
COLUMNS = 1
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 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.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = TOP_OF_PAGE_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = VBAK_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 3
COLUMN = 1
RECEIVING
CONTAINER = VBAP_CONTAINER.
CREATE OBJECT GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAK_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 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.
GS_LAYOUT-GRID_TITLE = 'SALES HEADER DETAILS.'(100).
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAK_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAK
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CREATE OBJECT OBJ_EVENT .
SET HANDLER OBJ_EVENT->HANDLE_DOUBLE_CLICK FOR GRID.
SET HANDLER OBJ_EVENT->HANDLE_TOP_OF_PAGE FOR GRID.
CREATE OBJECT TOP_PAGE
EXPORTING
STYLE = 'ALV_GRID'
CALL METHOD TOP_PAGE->INITIALIZE_DOCUMENT.
CALL METHOD GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = TOP_PAGE.
CALL SCREEN 100.
ENDFORM. " CREATE_CALL
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form FETCH_ITEM_DETAILS
text
--> p1 text
<-- p2 text
FORM FETCH_ITEM_DETAILS USING WA_VBAK TYPE ZVBAK_STRUC .
SELECT
VBELN
POSNR
MATNR
MATWA
PMATN
CHARG
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN = WA_VBAK-VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'NO RECORDS FOUND FOR SPECIFIED KEY'.
ENDIF.
ENDFORM. " FETCH_ITEM_DETAILS
*& Module STATUS_0200 OUTPUT
text
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
text
MODULE USER_COMMAND_0200 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form alv_grid
text
--> p1 text
<-- p2 text
FORM ALV_GRID .
IF FLAG = ''.
FLAG = 'X'.
CREATE OBJECT GRID_VBAP
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAP_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 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.
ENDIF.
GS1_LAYOUT-GRID_TITLE = 'SALES ITEM DETAILS.'(100).
CALL METHOD GRID_VBAP->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAP_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS1_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAP
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " alv_grid
Thanks & regards
Sreenivasulu P

Similar Messages

  • ALV Class Double click event

    Hi All,
    I have created an alv report using alv class. I have handled the double click event in that i am calling transaction using row currenlty selected. But after doing subtotalling the list and then i double click a line it is passing wrong data.
    Points are awarded,
    Regards,
    Bharat Mistry
    Message was edited by: Bharat Mistry

    Hi Bharat,
    Read the internal table contents in double click event with e_row-index , then you will get the data of that particular row.
    check below code :
    local class to handle semantic checks
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    DATA: g_event_receiver TYPE REF TO lcl_event_receiver.
    LOCAL CLASS Definition
    *§4.Define and implement event handler to handle event DATA_CHANGED.
    CLASS lcl_event_receiver DEFINITION.
      public section.
        METHODS:
          handle_double_click
                 FOR EVENT double_click OF cl_gui_alv_grid
                 IMPORTING e_row e_column.
    ENDCLASS.
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_double_click.
      read table gt_outtab index e_row-index into
    Regards
    Appana
    *Reward Points for helpful answers
    Message was edited by: L Appana

  • Doubt in alv classes program

    plz check the following code using class. i want to display the output. i have declared an instance called pav1. im getting short dump. wht i have to give in 'i_parent = ' int his case.
    DATA:PAV1 TYPE REF TO CL_GUI_ALV_GRID.
    tables:mara.
    data:begin of itab occurs 0,
         matnr like mara-matnr,
         mtart like mara-mtart,
         matkl like mara-matkl,
    end of itab.
    PARAMETERS: s_matnr LIKE mara-matnr.
    INTIALIZATION EVENT
      initialization.
      MOVE '38' TO S_MATNR.
    *move '38' to s_matnr-low.
    *append s_matnr.
    *move '679' to s_matnr-high.
    *append s_matnr.
    *AT SELECTION SCREEN EVENT.
    at selection-screen.
    IF S_MATNR NE '38'.
    MESSAGE i000.
    ENDIF.
    *START OF SELECTION EVENT
    start-of-selection.
    select matnr mtart matkl from mara into corresponding fields of table
    itab where matnr = s_matnr.
    IF SY-SUBRC NE 0.
    WRITE:/ 'SORRY'.
    ENDIF.
    *TOP OF PAGE EVENT
    top-of-page.
    write:/ 'TOP OF PAGE'.
    *END OF SELECTION EVENT
    END-OF-SELECTION.
    WRITE:/'SELECTION ENDED.'.
    create object pav1  exporting i_parent =  mara.
    CALL METHOD PAV1->set_table_for_first_display
      EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
        I_STRUCTURE_NAME              = 'mara'
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
       IS_LAYOUT                     =
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
      CHANGING
        it_outtab                     = itab[].
       IT_FIELDCATALOG               =
       IT_SORT                       =
       IT_FILTER                     =
    EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
    IF sy-subrc ne 0.
    write:/ 'sorry u didnt call the method correctly'.
    ENDIF.

    You have to create a object for custom container for the class cl_gui_custom_container.Then you have to give the i_parent for the ALV class object as <custom container object>
    create object <custom container>
    create object <alv grid>
    importing i_parent = <custom container>.

  • Varient display in ALV Classes

    Hi
    I am using ALV Classes. I need to use varient for selection screen parameter. In this case, I need to pass group of values for this parameter. how to implement this requirement. Cud u pls suggest this.
    Regards,
    Naseer

    well when u enter the input once,
    go for save button,there they will ask to process in background,or like front,choose any one relently,the input will be saved as varient
    and will apper every time u come on selection screen
    rewards if useful.

  • ALV Classes

    I need to implement ALV Classes for one of requirement. In which I have to take few fields from database table, define fieldcatalog for each field  and display them.
    can u pls help on this.  
    Regards,
    Naseer.

    REPORT ZALVcls .
    data: okcode like sy-ucomm,
          t_mara type standard table of mara,
          custom1 type ref to cl_gui_custom_container,
          grid1 type ref to cl_gui_alv_grid.
    start-of-selection.
    set screen '0100'.
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
    case okcode.
    when 'EXIT'.
    set screen '0'.
    endcase.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
    MODULE STATUS_0100 OUTPUT.
    CREATE OBJECT CUSTOM1
      EXPORTING
        CONTAINER_NAME              = 'MYCUSTOM'.
    CREATE OBJECT GRID1
      EXPORTING
        I_PARENT          = custom1.
    perform loaddata.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Form  loaddata
    FORM loaddata.
    select * from mara into table t_mara.
    CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
       I_STRUCTURE_NAME              = 'mara'
      CHANGING
        IT_OUTTAB                     = t_mara
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " loaddata

  • How to slection screen fields in  output of the  report by using alv classe

    hi all,
    i want to get all the fields in the selection screen to be displayed in the output layout.i am developing report by using alv grid classes can any one help me.
    answers are rewarded

    Hello
    u first place some dictionary input/output fields in your screen and
    below that u place ur custom control,
    so what ever input u are giving in those fields  , u seelct data accordingly,
    for example.
    in screen there is one icon 'dictionary/program fields, click that and give some table , suppose u want to extract data from kna1 table using kunnr, select kunnr and press enter, then along withn cursor u get one frame, take that on to screen and place it ,
    now in the program write
    tables: kna1.
    select  *  from kna1 into it_kna1  where kunnr = kna1-kunnr. 
    now u get the data into it_kna1.
    it will work , try this.
    bye.

  • How to manage two editable checkboxes in ALV class

    Hi all,
    I need to make two checkboxes fields appear only in some rows and I found this link:
    ALV one  cell as checkbox based on some conditions
    but it's not completely what I need, because I have to make the second checkbox editable only when the first one has been flagged, so it would be more useful a class alv.
    How can I solve my problem?
    Thanks,
       Francesco

    Try this:
    1-http://www.sapfans.com/forums/viewtopic.php?t=84933
    2-http://www.sapfans.com/forums/viewtopic.php?t=69878
    3-http://www.sapfans.com/forums/viewtopic.php?t=88376
    4-http://www.sapfans.com/forums/viewtopic.php?t=40968
    5-http://www.sapfans.com/forums/viewtopic.php?t=6919
    Regards
    Neha

  • ALV class include?

    I wrote alv program as below.
    i dont know where to put this below CLASS in dynpro
    module. either PBO or PAI.
    when i keep this in ordinary report it works fine.
    but when i use in dynpro screen its not working.
    could you pls suggest.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    DATA:
      go_grid TYPE REF TO cl_gui_alv_grid,
      go_custom_container TYPE REF TO cl_gui_custom_container,
      o_event_receiver TYPE REF TO lcl_event_receiver.
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
         handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
           IMPORTING
           e_object e_interactive,
           handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
           IMPORTING e_ucomm.
    ENDCLASS.
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
    Event handler method for event toolbar.
        CONSTANTS:
    Constants for button type
          c_button_normal           TYPE i VALUE 0,
          c_menu_and_default_button TYPE i VALUE 1,
         c_menu                    TYPE i VALUE 2,
          c_separator               TYPE i VALUE 3,
          c_radio_button            TYPE i VALUE 4,
          c_checkbox                TYPE i VALUE 5,
          c_menu_entry              TYPE i VALUE 6.
        DATA:
            ls_toolbar  TYPE stb_button.
      Append seperator to the normal toolbar
        CLEAR ls_toolbar.
        MOVE c_separator TO ls_toolbar-butn_type..
        APPEND ls_toolbar TO e_object->mt_toolbar.
      Append a new button that to the toolbar. Use E_OBJECT of
      event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.
      This class has one attribute MT_TOOLBAR which is of table type
      TTB_BUTTON. The structure is STB_BUTTON
        CLEAR ls_toolbar.
        MOVE 'REFRESH'  TO ls_toolbar-function.
        MOVE  icon_REFRESH   TO ls_toolbar-icon.
        MOVE 'Change flight' TO ls_toolbar-quickinfo.
        MOVE 'Refresh'       TO ls_toolbar-text.
        MOVE ' '             TO ls_toolbar-disabled.
        APPEND ls_toolbar    TO e_object->mt_toolbar.
      ENDMETHOD.
      METHOD handle_user_command.
      Handle own functions defined in the toolbar
        CASE e_ucomm.
          WHEN 'REFRESH'.
    Read data from table SFLIGHT
           SELECT * FROM sflight INTO TABLE gi_sflight.
          CALL METHOD go_grid->refresh_table_display.
         CALL METHOD cl_gui_cfw=>flush.
    LEAVE TO SCREEN 0.
        ENDCASE.
      ENDMETHOD.
    ENDCLASS.
    *&      Module  STATUS_0300  OUTPUT
          text
    MODULE STATUS_0300 OUTPUT.
    Create objects
         IF go_custom_container IS INITIAL.
           CREATE OBJECT go_custom_container
             EXPORTING container_name = 'ZCUSTOM'.
           CREATE OBJECT go_grid
             EXPORTING
             i_parent = go_custom_container.
           CREATE OBJECT o_event_receiver.
           SET HANDLER o_event_receiver->handle_user_command FOR go_grid.
           SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.
           Perform Loaddata.
         ENDIF.
    ENDMODULE.                 " STATUS_0300  OUTPUT
    FORM Loaddata.
    Read data from table SFLIGHT
           SELECT * FROM sflight INTO TABLE gi_sflight.
    Load data into the grid and display them
           CALL METHOD go_grid->set_table_for_first_display
           EXPORTING i_structure_name = 'SFLIGHT'
           CHANGING  it_outtab        = gi_sflight.
           CALL METHOD go_grid->set_toolbar_interactive.
    ENDFORM.

    am sorry,I have put the real code below.
    I commented all Class and event methods.
    i am passing date from before screen to this grid screen by name IMPODAY.
    when first time i select date and pass to query,query works out and displaying well.
    when i get back to original screen and again select different date
    its giving previous display itself.(not getting new query output.)
    i debugged the program till the select query internal table its working fine
    even in internal table i am holding the values but its not displaying
    in GRID. I am wondering why.
    MODULE REPORTSTATUS_PBO200 OUTPUT.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
       I_STRUCTURE_NAME             = 'ZMW0001'
      CHANGING
        CT_FIELDCAT                  = FIELDCATALOG_TMP
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 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.
    PERFORM FIELDCATALOG_OPP.
       CREATE OBJECT G_CUSTOM_CONTAINER
               EXPORTING CONTAINER_NAME = G_CONTAINER.
        CREATE OBJECT GRID_REPORT
               EXPORTING I_PARENT = G_CUSTOM_CONTAINER.
       PERFORM PREPARE_LAYOUT.
       PERFORM HIDE_TOOLBAR.
        SELECT * FROM ZMW0001
         INTO TABLE SDYN_ITAB WHERE IMPORTDAY = IMPODAY.
         SORT SDYN_ITAB BY STATUS.
        CALL METHOD GRID_REPORT->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
                  it_toolbar_excluding = lt_toolbar_excluding
                  is_layout            = ps_layout
        CHANGING  IT_FIELDCATALOG  = FIELDCATALOG
                  IT_OUTTAB        = SDYN_ITAB
        EXCEPTIONS
         invalid_parameter_combination = 1
         program_error                 = 2
         too_many_lines                = 3
         others                        = 4.
    ENDMODULE.

  • How to trigger New page while using ALV with classes/oops?

    Hi All
    I am trying to print a report which has to show the data in two pages.
    I am using ALV with classes/oops.
    Though I am able to print the report but a new page is not coming. Whole of the data is coming in one single page.
    Please tell me as to how to trigger a NEW PAGE while using ALV with classes/oops.
    Please send some code samples also if available.
    Thanks in advance.
    Jerry

    using sort option you can do it. in case of grid/oo alv class ALV you can view that only in print mode/preview mode.
    in case of list you can view that directly.
    sort-fieldname = 'FIELDNAME'.
    sort-group = '*'  "triggers new page
    sort-up = 'X'.
    append sort to it_sort.

  • OOP ALV report custom control performance problem

    HI
    how to write OOP ALV report without custom control.. Actually with custom control which taking long time... and time out happens for huge selection of data..
    Regards
    Roops.

    timeout is not an alv problem. If you try to display a "huge" amount of data, any display technology will fail. Even sap programs fail, their wise solution is to ask user to restrict data to be displayed. Or reduce database selection time, or display amount. Or propose the user to download data as a spool, or output to a file on server.
    Otherwise, read some advices about how to handle timeout in [Note 25528 - Parameter rdisp/max_wprun_time|http://service.sap.com/sap/support/notes/25528].
    About your question, if you still want to try, look at [example code with alv class cl_salv_table for simple display|http://help.sap.com/saphelp_nw2004s/helpdata/en/f9/1ab54099de3726e10000000a1550b0/frameset.htm]

  • To edit the field in the ALV report

    Hi,
        i want to edit the field of the ALV report what i need to do for that..
    Thanks & Regards
    Ashu Singh

    hi,
    check the code,
    REPORT  zalv_fcat.* Output table T006 structure declarationTYPES : BEGIN OF ty_t006.
            INCLUDE STRUCTURE t006.
    TYPES : END OF ty_t006.*Internal table and wa declaration for T006
    DATA : it_t006 TYPE STANDARD TABLE OF ty_t006,
           wa_t006 TYPE ty_t006.*declarations for ALV
    DATA: ok_code               TYPE sy-ucomm,
    fieldcatalog for T006
          it_fielcat           TYPE lvc_t_fcat,
    fieldcatalog for fieldcatalog itself:
          it_fielcatalogue           TYPE lvc_t_fcat,
          it_layout           TYPE lvc_s_layo.*declaration for toolbar function
    DATA:   it_excl_func        TYPE ui_functions.
    Controls to display it_t006 and corresponding fieldcatalog
    DATA: cont_dock TYPE REF TO cl_gui_docking_container,
          cont_alvgd     TYPE REF TO cl_gui_alv_grid.*controls to display the fieldcatalog as editable alv grid and container
    DATA: cont_cust TYPE REF TO cl_gui_custom_container,
          cont_editalvgd     TYPE REF TO cl_gui_alv_grid.*intialization event
    INITIALIZATION.*start of selection event
    START-OF-SELECTION.
    LOCAL CLASS Definition for data changed in fieldcatalog ALV
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS handle_data_changed
          FOR EVENT data_changed OF cl_gui_alv_grid
          IMPORTING er_data_changed.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    LOCAL CLASS implementation for data changed in fieldcatalog ALV
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_data_changed.
      ENDMETHOD.                    "handle_data_changed
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION*data declaration for event receiver
    DATA: event_receiver TYPE REF TO lcl_event_receiver.*end of selection event
    END-OF-SELECTION.*setting the screen for alv output for table display and
    *changed fieldcatalalogue display
    SET SCREEN 600.
    On this statement double click  it takes you to the screen painter SE51. Enter the attributes
    *Create a Custom container and name it CCONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    *Now a normal screen with number 600 is created which holds the ALV grid.
    PBO of the actual screen , Here we can give a title and customized menus
    *Go to SE41 and create status 'STATUS600' and create THE function code 'SUBMIT'
    *and 'EXIT' with icons and icon texts
    Also create a TitleBar 'TITLE600' and give the relevant title.&----
    *&      Module  STATUS_0600  OUTPUT
    MODULE status_0600 OUTPUT.
      SET PF-STATUS 'STATUS600'.
      SET TITLEBAR 'TITLE600'.
    CREATE ALV GRID CONTROL IF DOES NOT EXISTS INITIALLY
      IF cont_dock IS INITIAL.
        PERFORM create_alv.
      ENDIF.ENDMODULE.                             " STATUS_0600  OUTPUT* PAI module of the screen created. In case we use an interactive ALV or
    *for additional functionalities we can create OK codes and based on the
    *user command we can do the coding as shown below
    *&      Module  USER_COMMAND_0600  INPUT
    MODULE user_command_0600 INPUT.
      CASE ok_code.
        WHEN 'SUBMIT'.
    *TO GET THE CURRENT FIELDCATALOGUE FROM THE FRONTEND
          CALL METHOD cont_alvgd->set_frontend_fieldcatalog
            EXPORTING
              it_fieldcatalog = it_fielcat.
    *refresh the alv
          CALL METHOD cont_alvgd->refresh_table_display.
    *to Send Buffered Automation Queue to Frontend
          CALL METHOD cl_gui_cfw=>flush.*Exit button clicked to leave the program
        WHEN 'EXIT'.
          LEAVE PROGRAM.  ENDCASE.ENDMODULE.                             " USER_COMMAND_0600  INPUT&----
    *&      Form  CREATE_ALV
    &----FORM create_alv.*create a docking container and dock the control at the botton
      CREATE OBJECT cont_dock
          EXPORTING
               dynnr = '600'
               extension = 100
               side = cl_gui_docking_container=>dock_at_bottom.*create the alv grid for display the table
      CREATE OBJECT cont_alvgd
          EXPORTING
               i_parent = cont_dock.*create custome container for alv
      CREATE OBJECT cont_cust
          EXPORTING
               container_name = 'CCONT'.
    *create alv editable grid
      CREATE OBJECT cont_editalvgd
          EXPORTING
               i_parent = cont_cust.* register events for the editable alv
      CREATE OBJECT event_receiver.
      SET HANDLER event_receiver->handle_data_changed FOR cont_editalvgd.  CALL METHOD cont_editalvgd->register_edit_event
        EXPORTING
          i_event_id = cl_gui_alv_grid=>mc_evt_modified.*building the fieldcatalogue for the initial display
      PERFORM build_fieldcat CHANGING it_fielcat it_fielcatalogue.*building the fieldcatalogue after the user has changed it
      PERFORM change_fieldcat CHANGING it_fielcatalogue.*fetch data from the table
      PERFORM fetch_data.*    Get excluding functions for the alv editable tool bar  APPEND cl_gui_alv_grid=>mc_fc_loc_append_row TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_loc_insert_row TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_loc_cut TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_sort TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_sort_asc TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_sort_dsc TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_subtot TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_sum TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_graph TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_info TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_print TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_filter TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_views TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_mb_export TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_mb_sum TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_mb_sum TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_mb_paste TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_find TO it_excl_func.
      APPEND cl_gui_alv_grid=>mc_fc_loc_copy  TO it_excl_func.
    *Alv display for the T006 table at the bottom
      CALL METHOD cont_alvgd->set_table_for_first_display
        CHANGING
          it_outtab       = it_t006[]
          it_fieldcatalog = it_fielcat[].
    optimize column width of grid displaying fieldcatalog
      it_layout-cwidth_opt = 'X'.* Get fieldcatalog of table T006 - alv might have
    modified it after passing.
      CALL METHOD cont_alvgd->get_frontend_fieldcatalog
        IMPORTING
          et_fieldcatalog = it_fielcat[].to Send Buffered Automation Queue to Frontend  CALL METHOD cl_gui_cfw=>flush. Display fieldcatalog of table T006 in editable alv grid
      CALL METHOD cont_editalvgd->set_table_for_first_display
        EXPORTING
          is_layout            = it_layout
          it_toolbar_excluding = it_excl_func
        CHANGING
          it_outtab            = it_fielcat[]
          it_fieldcatalog      = it_fielcatalogue[].
    ENDFORM.                               " CREATE_alv
    *&      Form  fetch_data
    FORM fetch_data.* select data of T006
      SELECT * FROM t006 INTO TABLE it_t006 UP TO 50 ROWS.
    ENDFORM.                               " fetch_data
    *&      Form  BUILD_FIELDCAT
    FORM build_fieldcat CHANGING it_fldcat TYPE lvc_t_fcat
                                       it_fcat TYPE lvc_t_fcat.
    Fieldcatalog for table T006: it_fldcat
    to generate the fields automatically  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'T006'
        CHANGING
          ct_fieldcat            = it_fldcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 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.*----
    Fieldcatalog for table LVC_T_FCAT:it_fcat
    Generate fieldcatalog of fieldcatalog structure.
    This fieldcatalog is used to display fieldcatalog 'it_fldcat'
    on the top of the screen.  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'LVC_S_FCAT'
        CHANGING
          ct_fieldcat            = it_fcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 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.
    ENDFORM.                               " BUILD_FIELDCAT
    *&      Form  CHANGE_FIELDCAT
    *after the user has modified the fieldcatalogue we build another fieldcat
    *for the modified alv display
    FORM change_fieldcat CHANGING it_fcat TYPE lvc_t_fcat.  DATA ls_fcat TYPE lvc_s_fcat.  LOOP AT it_fcat INTO ls_fcat.
        ls_fcat-coltext = ls_fcat-fieldname.
        ls_fcat-edit = 'X'.    IF ls_fcat-fieldname = 'COL_POS' OR ls_fcat-fieldname = 'FIELDNAME'.
          ls_fcat-key = 'X'.
        ENDIF.    MODIFY it_fcat FROM ls_fcat.
      ENDLOOP.
    ENDFORM.                               " CHANGE_FIELDCAT
    ref:saptechnical tutorial.
    Regards,
    Anirban

  • ALV report in BSP

    Hello,
    What are my options for reporting tools in a BSP application? In our BSP project, we don't have the option for BW currently (not supported by compnay) so I am looking into ALV reporting. Is there any way we can integrate the two? It seems that using transaction iviews you can call ALV report on portal but that will be running outside your BSP framework. Can I use ALV report withing BSP? It appears that you can use the cl_salv_table (main ALV class) class in BSP. What are my options?
    Thanks,
    Partho

    Hi,
    I'm in the same situation. I want to display report results in a BSP table using a list viewer component.
    I've found some classes for web dynpro that use ALV to print data results. Is there any way to use the same within a BSP application?
    (Web Dynpro example that use an ALV table:
    'WDR_TEST_DYN_ALV_USAGE'.)
    Thanks and regards,
    Maria

  • Setting the column labels in webdynpro abap alv report

    Hello,
    Right now I have programmed an ALV report. The selection criterion and the display of the report all work.
    However, there is an issue with the labels of columns in the ALV report. The report takes the field names of the structure I am using in the ALV report as the labels of the report. I have been trying to play around with the ALV class model to see if something will change the labels of the fields but to no avail. Would you guys know of some code or way to change the labels of the columns in the ALV report.
    Thank you for your help in advance.
    Sumit.
    Here is some of the code I tried but does no work in the wdInit() method. It does not change the label. Any suggestions???
    METHOD wddoinit .
    * instantiate used component from wizard
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
    IF lo_cmp_usage->has_active_component( ) IS INITIAL.
      lo_cmp_usage->create_component( ).
    ENDIF.
    * call a method in the used component from wizard
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
        DATA lo_value TYPE REF TO cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
    DATA: lr_field TYPE REF TO cl_salv_wd_field.
    lr_field = lo_value->if_salv_wd_field_settings~get_field( 'CUSTOMER_NUMBER' ).
    * change the label of the report.
    DATA: lr_CUSTOMER_NUMBER TYPE REF TO cl_salv_wd_column.
                CALL METHOD lo_value->if_salv_wd_column_settings~get_column
                  EXPORTING
                    id     = 'CUSTOMER_NUMBER'   receiving value  = LR_CUSTOMER_NUMBER.
    * SET THE LABEL OF THE COLUMN
    DATA: HR_CUSTOMER_NUMBER TYPE REF TO CL_SALV_WD_COLUMN_HEADER.
    CALL METHOD lr_customer_number->get_header
      receiving
        value  = HR_CUSTOMER_NUMBER.
    ***** set the text of the column
    CALL METHOD hr_customer_number->set_text
      EXPORTING
        value  = 'Customer1 Number1'.
    ENDMETHOD.

    You have to disable the DDic binding on the column before your override text will show up:
    data: l_ref_cmp_usage type ref to if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
      if l_ref_cmp_usage->has_active_component( ) is initial.
        l_ref_cmp_usage->create_component( ).
      endif.
      data l_salv_wd_table type ref to iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv( ).
      data l_table type ref to cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
      data l_column type ref to cl_salv_wd_column.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
      data l_header type ref to cl_salv_wd_column_header.
      l_header = l_column->get_header( ).
      l_header->set_prop_ddic_binding_field(
        property =  if_salv_wd_c_ddic_binding=>bind_prop_text
        value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
      l_header->set_text( `Posting Date` ).

  • To deactivate filters in ALV grid

    Hi all,
        Please help me to deactivate the filters in ALV grid.
    Thanks in Advance,
      Regards,
      Shaju

    Hi,
    you can exclude buttons from ALV toolbar in your program.
    Check these links -
    Re: ALV Exclude Functions
    Re: How we will exclude some buttons from alv list display
    Re: ALV classes - exclude function codes
    Regards,
    Amit
    Reward all helpful replies.

  • Editable ALV's in WD4A (Like in Straight ABAP OO)

    Last year I had to master ABAP OO editable ALV's to put one in a MIGO dialog process exit.  The editable ALV class methods are pretty cool and do a lot of the work for you.
    So while in NET310 this week, I was looking at all the SAP-provided WD4A ALV components (demo, test, etc) and I didn't see one dealing with editable ALV's.
    Am I correct in assuming that this "editable ALV" functionality is not in WD4A yet?
    Or is it buried in SALV_WD methods that no one has bothered to put in a demo or tutorial?

    Hello David,
    I have these, too.
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/101df93f-4b5c-2910-14aa-9eb0338c2110],
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1] and
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/63a47dd9-0b01-0010-3d8e-de27242bf011].
    Regards,

Maybe you are looking for

  • My lumia 620 is not updating to cyan update

    Please help me. My phone is not updating. My Mobile shows the message that your mobile is upto date while it is still in Lumia black. The Lumia cyan update is officially available in my country(Pakistan). What is the problem with my mobile please not

  • On a MacBook Pro - windows on external drive?

    Hi Everyone, I'm new to Macs. Looking to buy a MacBook Pro 17 inch, and I am wondering if anyone knows if it is possible to load windows on an extermal disk, firewire 800 or E-sata off an express 34 card? If this isn't possible, can OS X be loaded on

  • Wierd email download problem...losing messages

    Anyone else had this problem - you download messages on iPhone - and often get the dreaded "no content" or "did not download message from server" message - and then when you try to download message on primary computer the message never shows up? (And

  • Need Help in with Querying Stored Procedures from UCCX Database

    Hi All We are trying to build a custom reporting solution using a BI tool and for which we have provided the ODBC connectivity to the UCCX database to our SQL server. We have installed the ODBC drivers on our SQL server and made a connection to UCCX

  • Forum Find for 2009-April-6

    Check out how BestBuy.com customers are rating our latest "Forum Find" in Data Backup and Storage Solutions! Western Digital - My Passport Essential 320GB External USB 2.0 Portable Hard Drive - Midnight Black Model: WDME3200TN | SKU: 8744709 USB 2.0