F4 help in ALV grid using existing search help

Hi All,
It would be appreciable , if some help on problem. Thanks in advance.
How to provide user defined F4 help in ALV grid using existing search help?
ALV grid has developed using OOPS concept.
Thanks,
Sudhakar.

Hi,
if you already developed using OO concept, it should be possible to:
create a handler for event ONF4
The interface will tell you actual field name and value where F4 is pressed. This will enable you to call your own routine (see FM F4-IF....).
Please check how the standard handles F4  - if you have standard and customer-F4 mixed you shouldtake care that the standard handling is triggered.
Regards,
Clemens

Similar Messages

  • ALV grid - using f4 search help - want separate value from hit list

    I have the following scenario that I am trying to resolve.
    I have created my own search help with a search help exit for a bespoke maintenance table which lists categories against HR positions which are to receive workflow for these categories.  I am designing a front-end for this table using an ALV grid whereby the person holding that position (i.e. name) is shown instead of position number.  The search help allows you to select by First name and last name and brings up a hit list which includes employee number, first name last name, formatted name field, position number, position description and org unit it belongs in.
    The issue occurs where the list brings back more than one hit.
    e.g.:
    1 Fred     Bloggs Fred Bloggs 50000001  pos1  org 1
    2 Frederic Bloggs Fred Bloggs 50000002  pos2  org 3
    If you select an entry, the formatted name field goes in the ALV grid field. I call the search help via F4IF_FIELDVALUE_REQUEST using the onf4 event .
    What I want to do is retrieve the position number of the entry selected and put this into another table without having to add this to my ALV grid and make available for input. I want to use name only for the input in my ALV grid (i.e. if I select the second example, the return table in F4IF_FIELDVALUE_REQUEST shows the name Fred Bloggs but does not show the position number which I need to add to another table to update my maintenance table).
    Can anyone suggest any way around this?
    Many thanks
    Larissa

    You are right, you can add this fields as an import parameter to the list.
    In Custom search help you must have marked fields as Export or Import parameters.
    If field is marked as Export parameters, it will be displayed in the selection pop up.
    If Import paramter check box is selected then this will be imported to the screen.
    Check this SAP documentation for both these options -
    Flag for IMPORT parameter of the search help                      
         Flag if the parameter is an import parameter.                                                                               
    Context information from the processed input template (screen) can be
         copied to the help process with an import parameter. Where an import 
         parameter gets its values from is defined when the search help is    
         attached to the corresponding field of the input template.           
    Flag for EXPORT parameter of the search help                                                                               
    Flag if the parameter is an export parameter.                                                                               
    Values can be returned from the hit list to the input template (screen)
         with an export parameter. The fields of the input template in which the
         contents of the export parameter are returned are defined by the search
         help attachment.
    Message was edited by: Ashish Gundawar

  • Search Help In ALV Grid

    What is shortest way to attach particular Search Help in ALV grid using OOPS ?

    Thanks Gurpreet,
    Through search helps attached to data element it is possible but is there any other way to attach searchhelp differet from from the search help attached to the data element ? The new search-elp is not customized search help as given in the above threads ?
    Eg. - If I want to attach MAT2 to a field named MATNR in the table instead of the MAT1 which is standard.
    Thanks in advance

  • How to make a field of ALV Grid to use a Search Help?

    Hi;
    I have a ALV grid with a field catalog. Say the field is 'USR000'.
    F4availabl = 'X' . for the field in the field catalog.
    I have prepared search help named ZEV_PROTYPE that uses tha table ZEV_PROTYPES.(two fields in the table :ProType and Text).
    Is it possible to make the field in ALV grid to use this search help if F4 is pressed on the field. ?
    Which structure of the ALV must be used for that ? Is it Field Catalog ?
    Would you please help me ?
    erk.

    Hi,
    If you have a Z data element and the search help is attached to it, you can just give the reference table and field in the field catalog for the editable ALV field, and the search help should appear.
    Regards,
    Sagar

  • F4 help in ALV grid by using function module?

    Hi,
    I need to get f4 search help in ALV grid for a certain fields by using function module method.
    Please guide me.
    Thank You.

    Hi
    F4IF_INT_TABLE_VALUE_REQUEST  use this fm to get f4 search help for a certain fields .
    Regards
    Divya

  • Display ALV GRID Using Dynamic Internal Table

    Hi all,
    I try to display ALV Grid using Dynamic Internal Table, but when i activate my program, i get an error message "DYN_TABLE" is not type-compatible with formal parameter "IT_OUTTAB". ( DYN_TABLE is my Dynamic Itab).
    Anybody can help me how to passing Dynamic Itab into ALV Grid ?? Of ALV Grid only accept static Itab ??
    Thanks,

    Hi Vijay,
    It's doesn't work, and make new error "Formal parameter "IT_OUTTAB[]" does not exist. However, the parameter "IT_OUTTAB" has a similar name."
    Because the method is:
    CALL METHOD <ref. var. to CL_GUI_ALV_GRID>->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE = <any type (ANY)>
    I_STRUCTURE_NAME = <string of type DD02L-TABNAME>
    IS_VARIANT = <structure of type DISVARIANT>
    I_SAVE = <var. of type CHAR01>
    I_DEFAULT = <var. of type CHAR01>
    IS_LAYOUT = <structure of type LVC_S_LAYO>
    IS_PRINT = <structure of type LVC_S_PRNT>
    IT_SPECIAL_GROUPS = <internal table of type LVC_T_SGRP>
    IT_TOOLBAR_EXCLUDING = <internal table of type UI_FUNCTIONS>
    IT_HYPERLINK = <internal table of type LVC_T_HYPE>
    IT_ALV_GRAPHICS = <internal table of type DTC_T_TC>
    CHANGING
    IT_OUTTAB = <internal table>
    IT_FIELDCATALOG = <internal table of type LVC_T_FCAT>
    IT_SORT = <internal table of type LVC_T_SORT>
    IT_FILTER = <internal table of type LVC_T_FILT>
    Thanks,

  • ALV grid using oops concepts

    HI all,
              Is it necessary to use container for ALV grid using classes.If not then please help me with a sample code.

    REPORT  z_alv_using_oops_conepts MESSAGE-ID z_OOPS.
    TABLES: ekko, ekpo.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    DATA: ok_code             TYPE sy-ucomm,
          gx_fcat1            TYPE lvc_s_fcat,
          gt_fcat1            TYPE STANDARD TABLE OF lvc_s_fcat,
          gx_fcat2            TYPE lvc_s_fcat,
          gt_fcat2            TYPE STANDARD TABLE OF lvc_s_fcat,
          gx_layout1          TYPE lvc_s_layo,
          gx_layout2          TYPE lvc_s_layo,
          gx_variant          TYPE disvariant,
          g_custom_container1 TYPE REF TO cl_gui_custom_container,
          g_custom_container2 TYPE REF TO cl_gui_custom_container,
          grid1               TYPE REF TO cl_gui_alv_grid,
          grid2               TYPE REF TO cl_gui_alv_grid,
          g_container1        TYPE scrfname VALUE 'MAIN_REPORT_LIST',
          g_container2        TYPE scrfname VALUE 'SECOND_REPORT_LIST',
          gv_event_rec1       TYPE REF TO lcl_event_receiver,
          gv_event_rec2       TYPE REF TO lcl_event_receiver,
          gv_repid            TYPE sy-repid,
          gt_final1           TYPE STANDARD TABLE OF ekko,
          gt_final2           TYPE STANDARD TABLE OF ekpo,
          gt_final3           TYPE STANDARD TABLE OF ekpo,
          gx_final            TYPE ekko,
          gx_final1           TYPE ekpo.
    INITIALIZATION.
      SELECTION-SCREEN                                              *
    SELECTION-SCREEN BEGIN OF BLOCK blk3 WITH FRAME .
    SELECT-OPTIONS:
          s_ebeln             FOR ekko-ebeln obligatory,
          s_ebelp             FOR ekpo-ebelp,
          s_bukrs             FOR ekko-bukrs,
          s_bsart             FOR ekko-bsart.
    SELECTION-SCREEN END OF BLOCK blk3.
    LOCAL CLASSES: Definition
    *===============================================================
    class lcl_event_receiver: local class to
                            define and handle own functions.
    Definition:
    ~~~~~~~~~~~
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        hotspot_click1
            FOR EVENT hotspot_click OF cl_gui_alv_grid
                IMPORTING e_row_id
                          e_column_id,
        hotspot_click2
           FOR EVENT hotspot_click OF cl_gui_alv_grid
                IMPORTING e_row_id
                          e_column_id.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD hotspot_click1.
        DATA: lv_tabix TYPE sy-tabix,
              lx_final TYPE ekko.
        READ TABLE gt_final1 INTO gx_final INDEX e_row_id.
        IF sy-subrc = 0.
          gt_final3 = gt_final2.
          DELETE gt_final3 WHERE ebeln NE gx_final-ebeln.
          IF NOT g_custom_container2 IS INITIAL.
            CALL METHOD grid2->refresh_table_display.
            CALL METHOD grid1->refresh_table_display.
          ENDIF.
        ELSE.
          MESSAGE s000 WITH text-003.
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDMETHOD.                    "hotspot_click1
      METHOD hotspot_click2.
        READ TABLE gt_final3 INTO gx_final1 INDEX e_row_id.
        IF sy-subrc = 0.
          SET PARAMETER ID 'BES' FIELD gx_final-ebeln.
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDMETHOD.                    "button_click1
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
      START-OF-SELECTION                                                 *
    START-OF-SELECTION.
      SELECT * FROM ekko INTO TABLE gt_final1 WHERE ebeln IN s_ebeln
                                              AND   bukrs IN s_bukrs
                                              AND   bsart IN s_bsart.
      IF sy-subrc = 0.
       SELECT * FROM ekpo INTO TABLE gt_final2 FOR ALL ENTRIES IN gt_final1
                                              WHERE ebeln = gt_final1-ebeln
                                               AND ebelp IN s_ebelp.
        IF sy-subrc = 0.
          gt_final3 = gt_final2.
        ENDIF.
      ENDIF.
      PERFORM sub_get_fieldcat CHANGING gt_fcat1.
      PERFORM sub_get_fieldcat CHANGING gt_fcat2.
      END-OF-SELECTION                                                   *
    END-OF-SELECTION.
      PERFORM display_process.
      CALL SCREEN 9000.
    MODULE pbo OUTPUT
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      gx_layout1-grid_title = 'Purchase Order Header'.
      gx_layout1-zebra      = 'X'.
      gx_layout1-info_fname = 'COLOR_LINE'.
      gx_layout1-sel_mode   = 'X'.
      gx_layout2-grid_title = 'Purchase Order Items'.
      gx_layout2-zebra      = 'X'.
      gx_layout1-stylefname = 'CB'.
    gs_layout1-excp_led   = gc_check.
    gs_layout1-excp_group = gc_check.
      gv_repid = sy-repid.
      gx_variant-report = gv_repid.
      READ TABLE gt_final1 INTO gx_final INDEX 1.
      IF sy-subrc = 0.
        DELETE gt_final3 WHERE ebeln NE gx_final-ebeln.
      ENDIF.
      IF g_custom_container1 IS INITIAL.
        CREATE OBJECT g_custom_container1
          EXPORTING
            container_name = g_container1.
        CREATE OBJECT grid1
          EXPORTING
            i_parent = g_custom_container1.
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
            is_layout       = gx_layout1
            is_variant      = gx_variant
            i_save          = 'U'
            i_default       = 'X'
            i_structure_name = 'EKKO'
          CHANGING
            it_outtab       = gt_final1
            it_fieldcatalog = gt_fcat1.
        CALL METHOD cl_gui_control=>set_focus
          EXPORTING
            control = grid1.
      ENDIF.
      IF g_custom_container2 IS INITIAL.
        CREATE OBJECT g_custom_container2
          EXPORTING
            container_name = g_container2.
        CREATE OBJECT grid2
          EXPORTING
            i_parent = g_custom_container2.
        CALL METHOD grid2->set_table_for_first_display
          EXPORTING
            is_layout       = gx_layout2
            is_variant      = gx_variant
            i_save          = 'U'
            i_default       = 'X'
            i_structure_name = 'EKPO'
          CHANGING
            it_outtab       = gt_final3
            it_fieldcatalog = gt_fcat2.
        CALL METHOD cl_gui_control=>set_focus
          EXPORTING
            control = grid2.
      ENDIF.
      CREATE OBJECT gv_event_rec1.
      SET HANDLER gv_event_rec1->hotspot_click1 FOR grid1.
    CREATE OBJECT gv_event_rec2.
      SET HANDLER gv_event_rec1->hotspot_click2 FOR grid2.
      IF gt_final2 IS INITIAL.
        MESSAGE i000 WITH 'No Items exist for the Purchase Order'.
      ENDIF.
    ENDMODULE.                    "PBO OUTPUT
          MODULE PAI INPUT                                              *
    MODULE pai INPUT.
    To react on oi_custom_events:
      CALL METHOD cl_gui_cfw=>dispatch.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
          LEAVE PROGRAM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'CANCEL'.
          LEAVE TO SCREEN 0.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                    "PAI INPUT
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      CALL METHOD grid1->free.
      CALL METHOD grid2->free.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc NE 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = gv_repid
            txt2  = sy-subrc
            txt1  = 'Error in Flush'(009).
      ENDIF.
    ENDFORM.                    "EXIT_PROGRAM
    *&      Form  display_process
          text
    -->  p1        text
    <--  p2        text
    FORM display_process .
      DATA: a LIKE sy-ucomm.
      DO 100 TIMES.
        DO 300 TIMES.
          GET TIME.
        ENDDO.
        a(3) = sy-index.a+3 = '%'.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            percentage = sy-index
            text       = a.
      ENDDO.
    ENDFORM.                    " display_process
    *&      Form  sub_get_fieldcat
          text
         <--P_GT_FCAT1  text
    FORM sub_get_fieldcat  CHANGING lt_fcat  TYPE lvc_t_fcat.
      gx_fcat1-fieldname = 'EBELN'.
      gx_fcat1-tabname   = 'gt_final1'.
      gx_fcat1-hotspot   = 'X'.
      APPEND gx_fcat1 TO lt_fcat.
    ENDFORM.                    " sub_get_fieldcat

  • Displaying items in a single line in ALV grid using  ALV_TOP_OF_PAGE.

    Hello Guys,
    I am having a problem in displaying items in a single line in the ALV Grid using event ALV_TOP_OF_PAGE.
    My requirement is to group items on a single line i.e. in the example below, Vendor code and posting date are on the same line. The next line the prints Vendor Name and Document no.
    Vendor Code: 123123                               Posting Date : 01.01.2011
    Vendor Name: ABCD                                 Document No: 152246598.
    Here is my code in subroutine 'ALV_TOP_OF_PAGE', 
      wa_list_comments-typ = 'S'. 
      wa_list_comments-key = ''.
      wa_list_comments-info = 'Vendor Code'.
      APPEND wa_list_comments TO it_list_comments.
      wa_list_comments-typ = 'S'. 
      wa_list_comments-key = ''.
      wa_list_comments-info = 'Posting Date'.
      APPEND wa_list_comments TO it_list_comments.
    The above code prints in the following format i.e one below the other,
    Vendor Code: 123123                              
    Posting Date : 01.01.2011.
    I also tried using HTML_TOP_OF_PAGE, but it didn't work.
    Can anybody please help me out with this.
    Regards,
    Danish.

    Hi Danish,
    Your problem is with the alignment and you need some fix positions .
    The solution i feel is u can use as below :
    In CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    use 
    i_callback_html_top_of_page       = 'HTML_TOP_OF_PAGE'.
    Now on calling routine call use cl_dd_document class :
    FORM html_top_of_page USING document TYPE REF TO cl_dd_document .
    data : doctable TYPE REF TO cl_dd_table_element,
              col1_t1 TYPE REF TO cl_dd_area,
              col2_t1 TYPE REF TO cl_dd_area,
              col1_t2 TYPE REF TO cl_dd_area,
              col2_t2 TYPE REF TO cl_dd_area.
    add quick table with five columns
        CALL METHOD lw_document->add_table
          EXPORTING
            no_of_columns               = 2
            border                      = '0'
         cell_background_transparent = ' '
            width                       = '100%'
          IMPORTING
            table                       = doctable.
    Filling columns in row
        CALL METHOD doctable->add_column
          EXPORTING
            width  = '40%'
          IMPORTING
            column = col1_t1.
    Filling columns in row
        CALL METHOD doctable->add_column
          EXPORTING
            width  = '60%'
          IMPORTING
            column = col2_t1.* Filling columns in row
    Call method doctable->new_row.
        CALL METHOD doctable->add_column
          EXPORTING
            width  = '40%'
          IMPORTING
            column = col1_t2.
    Filling columns in row
        CALL METHOD doctable->add_column
          EXPORTING
            width  = '60%'
          IMPORTING
            column = col2_t2.
    *Now adding the texts
    lw_text1 = 'your first text'
    CALL METHOD col1_t1->add_text
          EXPORTING
            text = lw_text.
    *Similarly add text for other columns
    *Adujust % in width to adjust the column as required
    Endform.
    Hope this will solve your problem .

  • How to get f4 help in alv grid in container-urgent

    hi,
    how to get f4 help in alv grid in container using abap objects
    ganesh

    Hi Ganesh,
    Did you have a look at sample report BCALV_TEST_GRID_F4_HELP ?
    Here is part of the header documentation:
    *& Report  BCALV_GRID_F4_HELP                                          *
    Purpose:
    ~~~~~~~~
    This report illustrates the use of f4-Help in an alv grid control.
    Background:
    ~~~~~~~~~~~
    There a two possibilities to implement an f4-Help in the alv grid
    control: one can either use standard f4-help or write one by Hand.
    For the former there is nothing to do at all. This report shows how
    to implement user-defined f4-help.
    I am sure you will find within this report the solution you are looking for.
    Reward points if this Helps.
    Manish

  • Error whil adding Header to the ALV grid using OO

    Hi Guys,
                 I want to display the Header for the ALV grid using Splitter .
    when i am doing like that .I am getting  a screen on the top of that screen I am getting a EMPTY screen .I don't know why likat.
    What i need is just to display a Grid with header?Can anybody Please help me reagarding this problem.
    the Code is Below.
    *& Report  Z_TEST_PGM
    REPORT  Z_TEST_PGM NO STANDARD PAGE HEADING
                                      LINE-SIZE 120 MESSAGE-ID zotc.
    Tables : CKMLMV003 , CKMLMV001.
    TYPE-POOLS: slis.
    Types : Begin of t_CKMLMV003_out,
                 WERKS type CKMLMV003-WERKS,
                 MATNR type CKMLMV003-MATNR,
                 MISCH_VERH type CKMLMV003-MISCH_VERH,
                 KALNR_BAL type CKMLMV003-KALNR_BAL,
                 GJAHR type CKMLMV003-GJAHR,
                 PERIO type CKMLMV003-PERIO,
                 MGTYP type CKMLMV003-MGTYP,
            End of t_CKMLMV003_out,
            Begin of t_CKMLMV001_out,
                 MATNR type CKMLMV001-MATNR,
                 KALNR type CKMLMV001-KALNR,
                 LIFNR_ND type CKMLMV001-LIFNR_ND,
                 EKORG_ND type CKMLMV001-EKORG_ND,
            End of t_CKMLMV001_out,
            Begin of t_CKMLMV003_Temp,
                 MATNR type CKMLMV003-MATNR,
                 GJAHR type CKMLMV003-GJAHR,
                 PERIO type CKMLMV003-PERIO,
            End of t_CKMLMV003_Temp,
            Begin of t_Final_out,
                 MATNR type CKMLMV003-MATNR,
                 GJAHR type CKMLMV003-GJAHR,
                 PERIO type CKMLMV003-PERIO,
                 WERKS type CKMLMV003-WERKS,
                 LIFNR_ND1 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH1 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND2 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH2 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND3 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH3 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND4 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH4 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND5 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH5 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND6 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH6 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND7 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH7 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND8 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH8 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND9 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH9 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND10 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH10 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND11 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH11 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND12 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH12 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND13 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH13 type CKMLMV003-MISCH_VERH,
             End of t_Final_out,
           Begin of t_Final_out1,
                 MATNR type CKMLMV003-MATNR,
                 GJAHR type CKMLMV003-GJAHR,
                 PERIO type CKMLMV003-PERIO,
                 LIFNR_ND1 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH1 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND2 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH2 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND3 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH3 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND4 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH4 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND5 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH5 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND6 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH6 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND7 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH7 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND8 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH8 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND9 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH9 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND10 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH10 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND11 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH11 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND12 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH12 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND13 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH13 type CKMLMV003-MISCH_VERH,
             End of t_Final_out1.
                          Global Structures                              *
    Data : i_CKMLMV003_str   type   t_CKMLMV003_out,
           i_CKMLMV001_str   type   t_CKMLMV001_out,
           i_Final_str   type  t_Final_out,
           i_Final_str1   type  t_Final_out,
           i_CKMLMV003_Temp type   t_CKMLMV003_Temp.
                              Global Internal Tables                        *
    Data : i_CKMLMV003_out   type standard table of  t_CKMLMV003_out,
           i_CKMLMV001_out  type standard table of  t_CKMLMV001_out,
           i_Final_out   type standard table of  t_Final_out,
           i_Final_out1   type standard table of  t_Final_out.
    ALV Report Internal tables    *
    DATA : t_fieldcatalog TYPE slis_t_fieldcat_alv,
           s_fieldcatalog TYPE slis_fieldcat_alv,
           t_basic_fieldcatalog TYPE slis_t_fieldcat_alv,
           s_basic_fieldcatalog TYPE slis_fieldcat_alv,
           t_sort  TYPE slis_t_sortinfo_alv,
           v_repid TYPE sy-repid.
    *ALV Header declarations
    Data: t_header type slis_t_listheader,
          i_header_str type slis_listheader,
          i_line_event_str TYPE slis_alv_event,
          i_events TYPE slis_t_event,
          wa_layout  type slis_layout_alv.
    Data : grid1 type ref to cl_gui_alv_grid,
           g_custom_container1 type ref to cl_gui_custom_container,
           grid2 type ref to cl_gui_alv_grid,
           g_custom_container2 type ref to cl_gui_custom_container,
           i_FCAT TYPE  LVC_T_FCAT,
           i_FCAT_str type lvc_s_fcat,
    Structure  for layout
          i_layout_s   TYPE  lvc_s_layo,
           gt_final1 type table of  t_Final_out.
    DATA: CCCONTAINER1 TYPE SCRFNAME VALUE 'CCCONTAINER1',
          CCCONTAINER2 TYPE SCRFNAME VALUE 'CCCONTAINER2',
          G_PARENT_TOP TYPE REF TO CL_GUI_CONTAINER ,
          G_SPLITTER   TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
          G_DYNDOC_ID  TYPE REF TO CL_DD_DOCUMENT,
          G_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER.
                          Global Variables                              *
    Data :cnt(4) type n value '0',
          g_plant type CKMLMV003-WERKS ,
          g_QuanTStr type CKMLMV003-MGTYP ,
          g_PurchOrg type CKMLMV001-EKORG_ND,
          flag type n value '0',
          g_cnt6 type n value '0',
          g_cnt7 type n value '0',
          g_cnt8 type n value '0',
          g_cnt9 type n value '0',
          g_cnt10 type n value '0',
          g_cnt11 type n value '0',
          g_cnt12 type n value '0',
          g_cnt13 type n value '0'.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) TEXT-006 for field s_matnr.
    Select-Options : S_MATNR for CKMLMV003-MATNR .
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) TEXT-007 for field S_WERKS.
    SELECT-OPTIONS:S_WERKS for CKMLMV003-WERKS Default '2003'.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) TEXT-008 for field S_GJAHR.
    SELECT-OPTIONS:S_GJAHR for CKMLMv003-GJAHR default Sy-DATUM(4) .
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) TEXT-009 for field S_PERIO.
    SELECT-OPTIONS:S_PERIO for CKMLMV003-PERIO .
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(25) TEXT-010 for field P_MGTYP.
    Parameters : P_MGTYP type CKMLMV003-MGTYP .
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1 .
    At Selection-Screen on s_matnr .
      Perform Validate_MatNumber.
    At Selection-Screen on s_werks .
      Perform Validate_CostingPlant.
    At Selection-Screen on s_GJAHR .
      Perform Validate_FiscalYear.
    At Selection-Screen on s_PERIO .
      Perform Validate_Period.
    At Selection-Screen on p_MGTYP .
      Perform Validate_QuantityStrType.
    *&      Form  Validate_MatNumber
          text
    Form Validate_MatNumber.
      DATA l_MATNR TYPE CKMLMV003-MATNR.
      IF NOT S_MATNR[] IS INITIAL .
        CLEAR L_MATNR.
        SELECT  single MATNR FROM CKMLMV003
          INTO l_MATNR
          WHERE MATNR = s_MATNR-LOW or MATNR = s_MATNR-HIGH.
       ENDSELECT.
        IF sy-subrc NE 0.
          MESSAGE e999 WITH
                  'Enter a Valid Material Number'(001).
        ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_MatNumber
    *&      Form  Validate_CostingPlant
          text
    Form Validate_CostingPlant.
      DATA l_werks TYPE CKMLMV003-WERKS.
      IF NOT S_WERKS[] IS INITIAL .
        CLEAR L_WERKS.
        SELECT single  WERKS FROM T001W
          INTO l_WERKS
          WHERE WERKS =  s_WERKS-low or  WERKS =  s_WERKS-high.
       ENDSELECT.
        IF sy-subrc NE 0.
          MESSAGE e999 WITH
                  'Enter a Valid Costing Plant'(002).
        ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_CostingPlant
    *&      Form  Validate_FiscalYear
          text
    Form Validate_FiscalYear.
      DATA l_GJAHR TYPE CKMLMV003-GJAHR.
      IF NOT S_GJAHR-low IS INITIAL or S_GJAHR-high IS INITIAL.
        CLEAR L_GJAHR.
       SELECT SINGLE GJAHR FROM CKMLMV003
         INTO l_GJAHR
         WHERE GJAHR LE sy-DATUM(4) .
       IF NOT S_GJAHR-low LE sy-DATUM(4) or S_GJAHR-high LE sy-DATUM(4).
         MESSAGE e999 WITH
                 'Enter a Valid Fiscal year'(003).
       ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_FiscalYear
    *&      Form  Validate_Period
          text
    Form Validate_Period.
      DATA l_PERIO TYPE CKMLMV003-PERIO.
      IF NOT S_PERIO[] IS INITIAL .
        CLEAR L_PERIO.
        SELECT single PERIO FROM CKMLMV003
          INTO l_PERIO
          WHERE PERIO GE 1 and PERIO LE 12 .
       ENDSELECT.
        IF sy-subrc NE 0.
          MESSAGE e999 WITH
                  'Enter a Valid Period'(004).
        ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_Period
    *&      Form  Validate_QuantityStrType
          text
    Form Validate_QuantityStrType.
      DATA l_MGTYP TYPE CKMLMV003-MGTYP.
      IF NOT p_MGTYP IS INITIAL.
        CLEAR L_MGTYP.
        SELECT SINGLE MGTYP FROM CKMLMV003
          INTO l_MGTYP
          WHERE MGTYP = p_MGTYP .
        IF sy-subrc NE 0.
          MESSAGE e999 WITH
                  'Enter a Valid Quantity Structure Type'(005).
        ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_QuantityStrType
    INITIALIZATION of Fields
    Class LCL_EVENT_HANDLER DEFINITION.
      Public section.
        Methods:
        TOP_OF_PAGE for Event TOP_OF_PAGE OF CL_GUI_ALV_GRID
                                IMPORTING E_DYNDOC_ID.
    ENDCLASS.                    "LCL_EVENT_HANDLER DEFINITION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    METHOD TOP_OF_PAGE.
    Top-of-page event <br />
    PERFORM EVENT_TOP_OF_PAGE USING G_DYNDOC_ID.
    ENDMETHOD.                            "top_of_page
    ENDCLASS.       "LCL_EVENT_HANDLER IMPLEMENTATION
    Data : G_HANDLER TYPE REF TO LCL_EVENT_HANDLER.
    Initialization.
      v_repid = sy-repid.
    Start-of-Selection.
      Perform get_CKMLMV003.
      Perform get_CKMLMV001.
      Perform Get_Finaldata.
    Perform Layout_FieldCatalog.
      call screen '101'.
    Perform  ALVGrid_Final_Display.
    *&      Form  Layout_FieldCatalog
          text
    Form Layout_FieldCatalog.
      s_fieldcatalog-col_pos = 1.
      s_fieldcatalog-fieldname = 'MATNR'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-024.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 2.
      s_fieldcatalog-fieldname = 'GJAHR'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-012.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 3.
      s_fieldcatalog-fieldname = 'PERIO'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-013.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 4.
      s_fieldcatalog-fieldname = 'WERKS'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-025.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 5.
      s_fieldcatalog-fieldname = 'LIFNR_ND1'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-014.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 6.
      s_fieldcatalog-fieldname = 'MISCH_VERH1'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-015.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 7.
      s_fieldcatalog-fieldname = 'LIFNR_ND2'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-016.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 8.
      s_fieldcatalog-fieldname = 'MISCH_VERH2'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-017.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 9.
      s_fieldcatalog-fieldname = 'LIFNR_ND3'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-018.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 10.
      s_fieldcatalog-fieldname = 'MISCH_VERH3'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-019.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 11.
      s_fieldcatalog-fieldname = 'LIFNR_ND4'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-020.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 12.
      s_fieldcatalog-fieldname = 'MISCH_VERH4'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-021.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 13.
      s_fieldcatalog-fieldname = 'LIFNR_ND5'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-022.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 14.
      s_fieldcatalog-fieldname = 'MISCH_VERH5'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-023.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      if g_cnt6 <> '0'.
        s_fieldcatalog-col_pos = 14.
        s_fieldcatalog-fieldname = 'LIFNR_ND6'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 15.
        s_fieldcatalog-fieldname = 'MISCH_VERH6'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt7 <> '0'.
        s_fieldcatalog-col_pos = 16.
        s_fieldcatalog-fieldname = 'LIFNR_ND7'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 17.
        s_fieldcatalog-fieldname = 'MISCH_VERH7'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt8 <> '0'.
        s_fieldcatalog-col_pos = 18.
        s_fieldcatalog-fieldname = 'LIFNR_ND8'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 19.
        s_fieldcatalog-fieldname = 'MISCH_VERH8'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt9 <> '0'.
        s_fieldcatalog-col_pos = 20.
        s_fieldcatalog-fieldname = 'LIFNR_ND9'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 21.
        s_fieldcatalog-fieldname = 'MISCH_VERH9'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt10 <> '0'.
        s_fieldcatalog-col_pos = 22.
        s_fieldcatalog-fieldname = 'LIFNR_ND10'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 23.
        s_fieldcatalog-fieldname = 'MISCH_VERH10'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt11 <> '0'.
        s_fieldcatalog-col_pos = 24.
        s_fieldcatalog-fieldname = 'LIFNR_ND11'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 25.
        s_fieldcatalog-fieldname = 'MISCH_VERH11'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt12 <> '0'.
        s_fieldcatalog-col_pos = 26.
        s_fieldcatalog-fieldname = 'LIFNR_ND12'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 27.
        s_fieldcatalog-fieldname = 'MISCH_VERH12'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt13 <> '0'.
        s_fieldcatalog-col_pos = 29.
        s_fieldcatalog-fieldname = 'LIFNR_ND13'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 30.
        s_fieldcatalog-fieldname = 'MISCH_VERH13'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
    ENDFORM.                    "Layout_FieldCatalog
    *&      Form  get_CKMLMV003
          text
    Form get_CKMLMV003.
      Select WERKS
             MATNR
             MISCH_VERH
             KALNR_BAL
             GJAHR
             PERIO
             MGTYP
             from CKMLMV003
             into table i_CKMLMV003_out
             Where ( MATNR in s_MATNR and
                     WERKS in s_WERKS and
                     GJAHR in s_GJAHR and
                     PERIO in s_PERIO and
                     MGTYP = p_MGTYP ).
      Sort i_CKMLMV003_out by MATNR  KALNR_BAL.
    ENDFORM.                    "get_CKMLMV003
    *&      Form  get_CKMLMV001
          text
    Form get_CKMLMV001.
      If Not i_CKMLMV003_out is Initial.
        Select MATNR
               KALNR
               LIFNR_ND
               EKORG_ND
               from CKMLMV001
               into Table i_CKMLMV001_out
               for all entries in i_CKMLMV003_out
               Where ( KALNR = i_CKMLMV003_out-KALNR_BAL
                      and WERKS = i_CKMLMV003_out-WERKS
                      and MATNR = i_CKMLMV003_out-MATNR ).
        sort i_CKMLMV001_out by MATNR  KALNR.
      ENDIF.
    ENDFORM.                    "get_CKMLMV001
    *&      Form  Get_Finaldata
          text
    Form Get_Finaldata.
      Loop at  i_CKMLMV001_out into i_CKMLMV001_str.
        Loop at  i_CKMLMV003_out into i_CKMLMV003_str.
          If ( i_CKMLMV001_str-KALNR = i_CKMLMV003_str-KALNR_BAL  and i_CKMLMV003_str-MATNR = i_CKMLMV001_str-MATNR  ) .
            If ( flag = 0 ).
              g_plant = i_CKMLMV003_str-WERKS.
              g_PurchOrg = i_CKMLMV001_str-EKORG_ND.
              g_quantstr = i_CKMLMV003_str-MGTYP.
              flag = 1.
            ENDIF.
            Move i_CKMLMV003_str-MATNR  to  i_Final_str-MATNR.
            Move i_CKMLMV003_str-WERKS  to  i_Final_str-WERKS.
            Move i_CKMLMV003_str-GJAHR  to  i_Final_str-GJAHR.
            Move i_CKMLMV003_str-PERIO  to  i_Final_str-PERIO.
            Move i_CKMLMV003_str-MISCH_VERH  to  i_Final_str-MISCH_VERH1.
            Move i_CKMLMV001_str-LIFNR_ND  to  i_Final_str-LIFNR_ND1.
           Move-Corresponding i_CKMLMV003_str to i_CKMLMV003_temp.
            Append i_Final_str to i_Final_out.
            Clear : i_CKMLMV003_str   .
          ENDIF.
        ENDLOOP.
        Clear : i_CKMLMV001_str ,  i_Final_str , i_CKMLMV003_temp.
      ENDLOOP.
      Sort i_Final_out by WERKS MATNR GJAHR  PERIO .
      Loop at i_Final_out into i_Final_str.
        if i_Final_str-MATNR = i_Final_str1-MATNR and i_Final_str-GJAHR = i_Final_str1-GJAHR and i_Final_str-PERIO = i_Final_str1-PERIO and i_Final_str-WERKS = i_Final_str1-WERKS.
          cnt = cnt + 1.
          Case cnt.
            When 2.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH2.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND2.
            When 3.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH3.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND3.
            When 4.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH4.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND4.
            When 5.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH5.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND5.
            When 6.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH6.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND6.
              g_cnt6 = 1.
            When 7.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH7.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND7.
              g_cnt7 = 1.
            When 8.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH8.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND8.
              g_cnt8 = 1.
            When 9.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH9.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND9.
              g_cnt9 = 1.
            When 10.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH10.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND10.
              g_cnt10 = 1.
            When 11.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH11.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND11.
              g_cnt11 = 1.
            When 12.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH12.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND12.
              g_cnt12 = 1.
            When 13.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH13.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND13.
              g_cnt13 = 1.
          ENDCASE.
        ELSE.
          if cnt GE 1 .
            append i_Final_str1 to i_Final_out1.
            Clear : i_Final_str1.
          ENDIF.
          Move-Corresponding i_Final_str to i_Final_str1.
          cnt = 0.
          cnt = cnt + 1.
        ENDIF.
        Clear :  i_Final_str.
      Endloop.
      append i_Final_str1 to i_Final_out1.
       if i_Final_str-MATNR = i_Final_str1-MATNR and i_Final_str-GJAHR = i_Final_str1-GJAHR and i_Final_str-PERIO = i_Final_str1-PERIO .
         cnt = cnt + 1.
         Case cnt.
           When 2.
             Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH2.
             Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND2.
           When 3.
             Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH3.
             Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND3.
           When 4.
             Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH4.
             Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND4.
           When 5.
             Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH5.
             Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND5.
         ENDCASE.
    **Move-Corresponding i_Final_str to i_Final_str1.
       ELSE.
         if cnt GE 1 .
           append i_Final_str1 to i_Final_out1.
           Clear : i_Final_str1.
         ENDIF.
         Move-Corresponding i_Final_str to i_Final_str1.
         cnt = 0.
         cnt = cnt + 1.
       ENDIF.
       Clear :  i_Final_str.
    Endloop.
    append i_Final_str1 to i_Final_out1.
    ENDFORM.                    "Get_Finaldata
    *&      Form  top_of_page
          text
    Form top_of_page.
      clear t_header.
      refresh t_header.
      i_header_str-typ = 'H'.
      I_header_Str-info = Text-035.
      append I_header_str to t_header.
      clear I_header_str.
    Date
      I_header_str-typ = 'S'.
      I_header_str-key = Text-036.
      CONCATENATE sy-datum+6(2) '.'
      sy-datum+4(2) '.'
      sy-datum(4) INTO I_header_str-info. "todays date
      append I_header_str to t_header.
      clear: I_header_str.
      i_header_str-typ = 'S'.
      I_header_Str-Key = 'Quantity Structure Type :'.
      I_header_Str-info = g_QuantStr.
      append I_header_str to t_header.
      clear I_header_str.
      i_header_str-typ = 'S'.
      I_header_Str-Key = 'Purchase Org :'.
      I_header_Str-info = g_PurchOrg.
      append I_header_str to t_header.
      clear I_header_str.
      i_header_str-typ = 'S'.
      I_header_Str-Key = 'Plant :'.
      I_header_Str-info = g_Plant.
      append I_header_str to t_header.
      clear I_header_str.
      CLEAR i_line_event_str.
      i_line_event_str-name = 'TOP_OF_PAGE'.
      APPEND i_line_event_str TO i_events.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
    i_logo = 'Z_LOGO'.
    ENDFORM.                    "top_of_page
    *&      ALVGrid_Final_Display
    Form ALVGrid_Final_Display.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program     = v_repid
           i_DEFAULt              = c_valx
          i_callback_top_of_page = 'TOP_OF_PAGE'
           i_Save                 = c_valx
          it_fieldcat            = t_fieldcatalog
           it_sort                = t_sort
          it_events              = I_events
        TABLES
          t_outtab               = i_final_out1.
    ENDFORM.                    "ALVGrid_Final_Display
    *&      Form  ALVGRID_OO_Display
          text
    Form ALVGRID_OO_Display.
      i_FCAT_str-col_pos = 1.
      i_FCAT_str-fieldname = 'MATNR'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
    i_fcat_str-seltext = 'MATERIAL'.
      i_fcat_str-scrtext_m = Text-024.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 2.
      i_FCAT_str-fieldname = 'GJAHR'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_fcat_str-scrtext_m = Text-012.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 3.
      i_FCAT_str-fieldname = 'PERIO'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_fcat_str-scrtext_m = Text-013.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 4.
      i_FCAT_str-fieldname = 'WERKS'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-025.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 5.
      i_FCAT_str-fieldname = 'LIFNR_ND1'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_fcat_str-scrtext_m = Text-014.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 6.
      i_FCAT_str-fieldname = 'MISCH_VERH1'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-015.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 7.
      i_FCAT_str-fieldname = 'LIFNR_ND2'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-016.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 8.
      i_FCAT_str-fieldname = 'MISCH_VERH2'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-017.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 9.
      i_FCAT_str-fieldname = 'LIFNR_ND3'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-018.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 10.
      i_FCAT_str-fieldname = 'MISCH_VERH3'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-019.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 11.
      i_FCAT_str-fieldname = 'LIFNR_ND4'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-020.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 12.
      i_FCAT_str-fieldname = 'MISCH_VERH4'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-021.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 13.
      i_FCAT_str-fieldname = 'LIFNR_ND5'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-022.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 14.
      i_FCAT_str-fieldname = 'MISCH_VERH5'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-023.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
       if g_cnt6 <> '0'.
        i_FCAT_str-col_pos = 15.
        i_FCAT_str-fieldname = 'LIFNR_ND6'.
        i_FCAT_str-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        i_FCAT_str-scrtext_m = Text-022.
        append i_FCAT_str to i_FCAT.
        clear i_FCAT_str.
        i_FCAT_str-col_pos = 16.
        i_FCAT_str-fieldname = 'MISCH_VERH6'.
        i_FCAT_str-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        i_FCAT_str-scrtext_m = Text-023.
        append i_FCAT_str to i_FCAT.
        clear i_FCAT_str.
      ENDIF.
    *if  not grid1 is Initial.
    If sy-SUBRC = 0.
      Call Method grid1->set_table_for_first_display
        CHANGING
          it_outtab                     = i_final_out1[]
          it_fieldcatalog               = I_FCAT
        EXCEPTIONS
          Invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          Others                        = 4.
      If sy-subrc <> 0.
      ENDIF.
    CALL METHOD G_DYNDOC_ID->INITIALIZE_DOCUMENT
        EXPORTING
        BACKGROUND_COLOR = CL_DD_AREA=>COL_TEXTAREA.
    Processing events <br />
      CALL METHOD GRID1->LIST_PROCESSING_EVENTS
        EXPORTING
        I_EVENT_NAME = 'TOP_OF_PAGE'
        I_DYNDOC_ID = G_DYNDOC_ID.
    Call Method grid2->set_table_for_first_display
       CHANGING
         it_outtab                     = i_final_out1[]
         it_fieldcatalog               = I_FCAT
       EXCEPTIONS
         Invalid_parameter_combination = 1
         program_error                 = 2
         too_many_lines                = 3
         Others                        = 4.
    If sy-subrc <> 0.
    ENDIF.
       ENDIF.
      ENDIF.
    Endform.                    "ALVGRID_OO_Display
    Form EVENT_TOP_OF_PAGE using  DG_DYNDOC_ID
                          TYPE REF TO CL_DD_DOCUMENT.
    DATA : DL_TEXT(255) TYPE C.
      CALL METHOD DG_DYNDOC_ID->ADD_TEXT
        EXPORTING
        TEXT = 'Flight Details'
        SAP_STYLE = CL_DD_AREA=>HEADING
        SAP_FONTSIZE = CL_DD_AREA=>LARGE
        SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
    Endform.
    *&      Module  STATUS_0101  OUTPUT
          text
    MODULE STATUS_0101 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    SET PF-STATUS 'STATUS'.
    SET TITLEBAR 'TITLE'.
      Create Object G_DYNDOC_ID
            EXPORTING STYLE = 'ALV_GRID'.
      if g_custom_container1 is initial .
        create object g_custom_container1
            Exporting
                Container_name = CCCONTAINER1
            Exceptions
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                Others = 5.
       Create Object G_SPLITTER
              Exporting PARENT = g_custom_container1.
      CALL METHOD G_SPLITTER->GET_CONTAINER
        EXPORTING
        ROW = 1
        COLUMN = 1
        RECEIVING
        CONTAINER = G_PARENT_TOP.
    *Assigning the Part 2 to GRID
      CALL METHOD G_SPLITTER->GET_CONTAINER
        EXPORTING
        ROW = 2
        COLUMN = 1
        RECEIVING
        CONTAINER = g_parent_grid.

    Hi,
    Check if any event is triggered from the event handler class, upon selection.
    Usually, the events are handled on double click or on hotspot etc.
    Regards,
    Satish Kanteti

  • How to add one column in existing search help.

    Hi Folks,
    My quesion is
    How to add one column in existing search help and also Now search help on that field is not an explicit search help. It should be implement using check table.
    Shivam

    Hi,
    If you want to add a field in Elementary search help, get the search help name for the and go to change mode and add the field in it.
    If you want to add a field in collective search help, go to included search helps tab and a new search help name and add the fields to it.
    I think this should help you to certain extent.
    Regards,
    Kranthi
    Edited by: Kranthi on Jan 14, 2010 11:15 AM

  • How to find an existing search help?

    Hi Friends,
    How to find an existing search help for some certain fields? for example search help "H_TVKO" is for "Help view for Sales Organizations"[for the field VKORG], and search help "MAT1" is for "Find Material Number"[for the field MATNR]...... but how to find these search helps for a certain field?
    Thanks a lot!!

    Hello Qiwei,
    You can find the search help using their table and fields name.
    simply you have to point the cursor on same field for which you want to see search help in SE11.and then in same window search help tab available click on this..
    It will show all search help which is having same field.
    Have a Nice Day.
    Regards,
    Sujeet
    Edited by: Sujeet on Jan 14, 2009 10:41 AM

  • Standard F4 help in ALV  Grid

    Hi Experts,
    I have created an ALV grid using classes. I need to bring standard F4 help in the ALV Grid.
    Also the value that user enters should be returned back to the ALV.
    Please provide some inputs.
    Thanks.

    Hi,
    cosider the below steps :
    1.in Fieldcatalog set the field as editable like for eg.
    WA_FIELDCAT-COL_POS    = L_LIN.
        WA_FIELDCAT-FIELDNAME  = 'DATAB'.
        WA_FIELDCAT-DATATYPE   = 'DATS'.
        WA_FIELDCAT-REPTEXT    = 'Valid From'(T06).
        WA_FIELDCAT-F4AVAILABL = 'X'.
        WA_FIELDCAT-EDIT       = 'X'.
        APPEND WA_FIELDCAT TO I_FIELDCAT.
    2. Define F4 on the fields you want:
    DATA:
    * Line of  F4 table
      L_S_F4 TYPE LVC_S_F4,
    * Table for F4 relevant fields
      L_T_F4 TYPE LVC_T_F4.
    * F4 on datab
      L_S_F4-FIELDNAME  = 'DATAB'.
      L_S_F4-REGISTER   = 'X'.
      L_S_F4-GETBEFORE  = SPACE.
      L_S_F4-CHNGEAFTER = SPACE.
      APPEND L_S_F4 TO L_T_F4.
      CLEAR L_S_F4.
    similarly you can add other fields on which you want to provide F4
      CALL METHOD P_G_ALV_GRID->REGISTER_F4_FOR_FIELDS
        EXPORTING
          IT_F4 = L_T_F4[].
    3.Implement the metohds for Event handler:
    METHOD HANDLE_ONF4.
       <here you can call the F4 help>
    Regards,
    Neha

  • How to put a dictionary field into an existing Search Help by calling FM

    Hi All
    I'm facing a problem when using  an existing search help in a screen input field. I'm not directly mentioning search help to that screen field. Instead of this i'm calling Function Module F4IF_FIELD_VALUE_REQUEST  like
          lv_tabname = 'Z_FBSTM_SHLP_EXIT'.
          lv_fieldname = 'SALES_AREA_CODE'.
          lv_searchhelp ='ZCP_SUBAREA_HELP'.
          lv_shlpparam = 'SALES_AREA_CODE'.
      ALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
          EXPORTING
            tabname                   = lv_tabname
            fieldname                 = lv_fieldname
            searchhelp                = lv_searchhelp
            shlpparam                 = lv_shlpparam
                 dynpprog                  = sy-cprog
                 dynpnr                    = sy-dynnr
    In this  way i'm not getting proper output.
    can you help me out.....
    help will be rewarded.

    I am giving the code   als  for the F4 help just  change  you fields and   and  table  of tha field   you will get it  .... and see the  module  in which  place  i had  write in the screen
    <b>PROCESS ON VALUE-REQUEST( F4 ) statement</b>
    Code to demonstrate how to perform a manual value help(F4) on a particular field using the PROCESS ON VALUE-REQUEST statement and how to return values back to a table control on the screen. For standard screen fields simply move the value to the appropriate screen field name
    Screen flow logic........
    PROCESS BEFORE OUTPUT.
    *MODULE PBO_MODULE.
    PROCESS AFTER INPUT.
    *MODULE PAI_MODULE.
    PROCESS ON VALUE-REQUEST. "F4
      FIELD EKPO-EBELP MODULE help_ekpo.
    * populate screen field from within PROCESS ON VALUE-REQUEST(F4) call
    *&      Module  help_responsibility  INPUT
    *       text
    MODULE help_ekpo INPUT.
    **Transport values to table dynpro/screen table control
      DATA: l_stepl LIKE  sy-stepl,
            l_indx  LIKE  sy-stepl.
      DATA: dynpfields        LIKE dynpread OCCURS 5 WITH HEADER LINE.
    * Adjust for scroling within table control
      CALL FUNCTION 'DYNP_GET_STEPL'
        IMPORTING
          povstepl        = l_stepl
        EXCEPTIONS
          stepl_not_found = 0
          OTHERS          = 0.
      l_indx = tc_ekpotable-top_line + l_stepl - 1.
              "tc_ekpotable should already have been declared
      REFRESH dynpfields.
      CLEAR   dynpfields.
      dynpfields-fieldname  = 'EKPO-EBELN'.
      dynpfields-fieldvalue = '00010'   "wa_ekpo-ebeln.
      dynpfields-stepl      = l_stepl.
      APPEND dynpfields.
      dynpfields-fieldname  = 'EKPO-EBELP'.
      dynpfields-fieldvalue = '00020'   "wa_ekpo-ebelp.
      dynpfields-stepl      = l_stepl.
      APPEND dynpfields.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
        EXPORTING
          dyname     = 'SAPLZZ_EKKO'    "Program name
          dynumb     = '0100'           "Screen number
        TABLES
          dynpfields = dynpfields
        EXCEPTIONS
          OTHERS     = 0.
    ENDMODULE.                 " help_ekpo  INPUT
    reward  points if it is usefull ....
    Girish

  • F4 Help in ALV GRID class based

    hi
    you have any idea about how to invoke the F4 help in ALV GRID Class based program.,
    if u have any other related document or program using F4 function in ALV GRId please send to me for reference
    Thanks & Regards
    K.G

    hi for what kind of fields you need to give f4.
    are they std or custom...
    please let me know about the fields..
    try to check my logic which i gave in the below post..
    it will give f4 help to the fields(if thet are standard table fieldS)
    Message was edited by: Vijay Babu Dudla

Maybe you are looking for

  • My Mac wont load

    I press the ON button, I hear the MAC Start Up Sound, then the loading wheel appears, and a progress bar appears below, which dosnt do anything then the MAC SHUTS OFF, I've had the MAC since 2011 and this is the first problem I've had

  • Cfcontent and MIME types for MS outlook .MSG format

    Hi I am using a web service that returns the contents of a MSG file as a binary string. I was hoping to use <cfcontent> to then be able to render the document on demand when the user required. (e.g.) <cfcontent type="application/vnd.ms-outlook"><cfou

  • [CS4 Server] Converting CS2-Document to CS4

    Hello everyone! I have some cs2-documents, which I want to work with. I open them in InDesign Server CS4 and save them again. After this they seem to be CS4 - Documents, but if try to work with paragraph styles i get an exception. If I try to open th

  • Watch app - iphone 4

    Hi i have iphone 4. so i cannot update to 8.2 does it mean i cannot get watch app? what should i do?   is it possible to have apple watch with iphone 4 or i have to buy an iphone 6. thank you.

  • Does Java 7 cause OS X Mavericks to crash?

    Dear Apple Support Community, I have recently updated to Java version 7 update 67, to support the retina display capabilities of my Macbook Pro with third party software (Matlab R2014a, Mathworks). Mavericks has crashed several times since the update