How do I define Field-Catalog and Event-Catalog in OOPs ALV

Hi All,
This is the piece of the code on which I'm working upon. This program is giving an exception "No Field-Catalog Found". 
I'm new to OOPs ALV. Could anybody please tell me how to define the field-catalog and event-catalog in this.
module PBO output.
      IF g_custom_container IS INITIAL.
          CREATE OBJECT g_custom_container EXPORTING CONTAINER_NAME = 'CCCONTAINER'.
          CREATE OBJECT g_grid             EXPORTING I_PARENT       = g_custom_container.
      CALL METHOD g_grid->set_table_for_first_display
          EXPORTING I_STRUCTURE_NAME = 'IT_MATERIAL'
                    is_layout = layout
          CHANGING IT_OUTTAB         = gt_it_material.
      ENDIF.
  endmodule.
Regards,
Saurabh

hi,
chk this sampl ceode.
TYPE-POOLS: slis.
CLASS lcl_event_receiver DEFINITION DEFERRED.
TABLES : zmpets_shipactiv, zmpets_chargebk, zmpets_shiphdr.
DATA : BEGIN OF int_crb OCCURS 0,
       sel TYPE char1,
       icon TYPE icon_d,
       pernr LIKE zmpets_cil-pernr,
       vorna LIKE pa0002-vorna,
       movreason LIKE zmpets_shiphdr-movreason,
       shipdocnum LIKE zmpets_chargebk-shipdocnum,
       createdon LIKE zmpets_chargebk-createdon,
       chargeamount LIKE zmpets_chargebk-chargeamount,
       version LIKE zmpets_shipactiv-version,
       activity LIKE zmpets_shipactiv-activity,
       vendor LIKE zmpets_shiphdr-vendor,
      smtp_addr LIKE adr6-smtp_addr,
       empperid LIKE zmpets_167doc-empperid,
       celltab TYPE lvc_t_styl,
       END OF int_crb.
DATA : int_crb_ver LIKE int_crb OCCURS 0 WITH HEADER LINE.
DATA : int_crb_mail LIKE int_crb OCCURS 0 WITH HEADER LINE.
DATA : int_shipactiv LIKE zmpets_shipactiv OCCURS 0 WITH HEADER LINE.
DATA: gt_fieldcatalog TYPE lvc_t_fcat.
DATA : wf_flag TYPE i.
DATA : wf_res TYPE c.
DATA : wf_tabix TYPE sy-tabix.
DATA: BEGIN OF int_sin OCCURS 0,
      shipdocnum LIKE zmpets_chargebk-shipdocnum,
        shipdocnum LIKE zmpets_shipactiv-petsdocnumber,
      END OF int_sin.
DATA: objpack   LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: objhead   LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: objbin    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: objtxt    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: reclist   LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: doc_chng  LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
DATA l_num(3).
DATA: ok_code            LIKE          sy-ucomm,
      w_repid            LIKE          sy-repid,
      wl_sno             TYPE          i         VALUE 0,
      w_max              TYPE          i         VALUE 100,
      wf_layout          TYPE          lvc_s_layo,
      cont_on_main       TYPE          scrfname   VALUE  'GRID_CONTROL',
      cont_on_dialog     TYPE          scrfname   VALUE 'GRID_CONTROL',
      grid1              TYPE          REF TO cl_gui_alv_grid,
      grid2              TYPE          REF TO cl_gui_alv_grid,
      custom_container1  TYPE          REF TO cl_gui_custom_container,
      custom_container2  TYPE          REF TO cl_gui_custom_container,
      event_receiver     TYPE          REF TO lcl_event_receiver,
      lt_exclude         TYPE          ui_functions,
      ls_celltab         TYPE          lvc_s_styl,
      lt_celltab         TYPE          lvc_t_styl.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-001.
PARAMETERS : p_cash AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b3.
PERFORM fieldcatalog_init USING gt_fieldcatalog[].
Selection-Screen----
SELECTION-SCREEN  BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
SELECT-OPTIONS:s_chdate FOR zmpets_chargebk-createdon,
               s_pernr FOR zmpets_shiphdr-pernr,
               s_mvrsn FOR zmpets_shiphdr-movreason,
               s_sin FOR zmpets_chargebk-shipdocnum NO INTERVALS
NO-EXTENSION.
SELECTION-SCREEN  END OF BLOCK b1.
PERFORM f_clear_fields.
CALL SCREEN 100.
      CLASS lcl_event_receiver DEFINITION
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.
  PRIVATE SECTION.
ENDCLASS.                    "lcl_event_receiver DEFINITION
      CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_receiver IMPLEMENTATION.
  METHOD handle_toolbar.
§ 2.In event handler method for event TOOLBAR: Append own functions
  by using event parameter E_OBJECT.
    DATA: ls_toolbar  TYPE stb_button.
append a separator to normal toolbar
    CLEAR ls_toolbar.
    MOVE 3 TO ls_toolbar-butn_type.
    APPEND ls_toolbar TO e_object->mt_toolbar.
    CLEAR ls_toolbar.
new button -
    MOVE 'PROCESSED' TO ls_toolbar-function.
    MOVE icon_execute_object TO ls_toolbar-icon.
    MOVE 'Process the Record'(110) TO ls_toolbar-quickinfo.
    MOVE ' Process '(200) TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.
    APPEND ls_toolbar TO e_object->mt_toolbar.
  ENDMETHOD.                    "handle_toolbar
  METHOD handle_user_command.
§ 3.In event handler method for event USER_COMMAND: Query your
  function codes defined in step 2 and react accordingly.
    DATA: lt_rows TYPE lvc_t_row.
    CASE e_ucomm.
      WHEN 'PROCESSED'.
        CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
                 EXPORTING
                  defaultoption        = 'N'
  textline1     = 'Do you want to process the selected documents?'
          TEXTLINE2            = ' '
                   titel                = 'Process Documents'
          START_COLUMN         = 25
          START_ROW            = 6
          CANCEL_DISPLAY       = 'X'
                IMPORTING
                  answer               = wf_res.
*--IF THE USER CONFIRMS 'YES',
        IF wf_res = 'J'.
          PERFORM f_modify_activity.
          CALL METHOD grid1->refresh_table_display.
       PERFORM SENDINGMAIL.
        ENDIF.
    ENDCASE.
  ENDMETHOD.                           "handle_user_command
ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
MODULE pbo_100 OUTPUT
MODULE pbo_100 OUTPUT.
  SET PF-STATUS 'MAIN100'.
  SET TITLEBAR 'MAIN100'.
  w_repid = sy-repid.
  IF custom_container1 IS INITIAL.
*get the data from charge back table
    PERFORM select_table_chb.
create a custom container control for our ALV Control
    CREATE OBJECT custom_container1
        EXPORTING
            container_name = cont_on_main
        EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5.
    IF sy-subrc NE 0.
add your handling, for example
      CALL FUNCTION 'POPUP_TO_INFORM'
        EXPORTING
          titel = w_repid
          txt2  = sy-subrc
          txt1  = 'The control could not be created'(510).
    ENDIF.
    CREATE OBJECT grid1
              EXPORTING i_parent = custom_container1.
Set a titlebar for the grid control
    wf_layout-grid_title = 'Charge Back'(100).
allow to select multiple lines
    wf_layout-sel_mode = 'C'.
    wf_layout-stylefname = 'CELLTAB'.
Exclude all edit functions in this example since we do not need them:
    PERFORM exclude_tb_functions CHANGING lt_exclude.
    CALL METHOD grid1->set_table_for_first_display
               EXPORTING
            I_BUFFER_ACTIVE               =
            I_CONSISTENCY_CHECK           =
            I_STRUCTURE_NAME              =
            IS_VARIANT                    =
            I_SAVE                        =
            I_DEFAULT                     = 'X'
                 is_layout                     = wf_layout
            IS_PRINT                      =
            IT_SPECIAL_GROUPS             =
              it_toolbar_excluding          = lt_exclude
            IT_HYPERLINK                  =
            IT_ALV_GRAPHICS               =
          CHANGING
            it_outtab                     = int_crb[]
            it_fieldcatalog               = gt_fieldcatalog.
    CREATE OBJECT event_receiver.
    SET HANDLER event_receiver->handle_user_command FOR grid1.
    SET HANDLER event_receiver->handle_toolbar FOR grid1.
    CALL METHOD grid1->set_toolbar_interactive.
  ENDIF.                               "IF grid1 IS INITIAL
  CALL METHOD cl_gui_control=>set_focus
    EXPORTING
      control = grid1.
ENDMODULE.                    "pbo_100 OUTPUT
MODULE pai_100 INPUT
MODULE pai_100 INPUT.
  CASE ok_code.
    WHEN 'EXIT'.
      PERFORM f_clear_fields.
      LEAVE PROGRAM.
    WHEN 'CANCEL'.
      PERFORM f_clear_fields.
      LEAVE TO SCREEN 0.
    WHEN 'BACK'.
      PERFORM f_clear_fields.
      LEAVE TO SCREEN 0.
  ENDCASE.
  CLEAR ok_code.
ENDMODULE.                    "pai_100 INPUT
**&      Form  select_table_chb
      text
FORM select_table_chb.
  IF p_cash = 'X'.
*Consider the pending documents also.
*get the documents which are not processed yet,
*Doctype -> 06 = Charge Back document type.
    SELECT zmpets_shiphdrpernr pa0002vorna
     zmpets_shiphdrmovreason zmpets_chargebkshipdocnum
     zmpets_chargebkcreatedon zmpets_chargebkchargeamount
     zmpets_shipactivversion zmpets_shipactivactivity
zmpets_shiphdr~vendor
   adr6~smtp_addr
zmpets_167doc~empperid
             INTO CORRESPONDING FIELDS OF TABLE int_crb_ver
             FROM zmpets_chargebk
             JOIN zmpets_shiphdr
           ON zmpets_chargebkshipdocnum = zmpets_shiphdrshipdocno
             JOIN zmpets_shipactiv
     ON zmpets_chargebkshipdocnum = zmpets_shipactivpetsdocnumber
             JOIN pa0002
             ON zmpets_shiphdrpernr = pa0002pernr
                JOIN lfa1
                ON lfa1lifnr = zmpets_shiphdrvendor
                JOIN adr6
                ON adr6addrnumber = lfa1adrnr
             JOIN zmpets_167doc
             ON zmpets_167docpernr = pa0002pernr
                       WHERE zmpets_shipactiv~doctype = '06'
                    zmpets_shipactiv~activity NE '30'
                  ZMPETS_CHARGEBK~CREATEDON IN s_chdate
                  AND ZMPETS_SHIPHDR~pernr IN s_pernr
                  AND ZMPETS_SHIPHDR~MOVREASON IN s_mvrsn
                  AND ZMPETS_CHARGEBK~SHIPDOCNUM IN s_sin
                       AND zmpets_chargebk~loekz NE 'X'
                       AND zmpets_shipactiv~loekz NE 'X'
                       AND zmpets_shiphdr~loekz NE 'X'.
    IF sy-subrc <> 0.
*Message is 'No Pending Documents Available.'.
      MESSAGE s196(zm050).
    ELSE.
      LOOP AT int_crb_ver.
*Not yet processed. set to red
        int_crb_ver-icon = '@0A@'.
        MODIFY int_crb_ver.
      ENDLOOP.
      PERFORM f_filter_data_pending.
    ENDIF.
  ELSE.
*Get the document details from pa0002,zmpets_shipactiv,ZMPETS_CHARGEBK
*table.
*Consider document type as '01'  during the selection.
*Doctype -> 06 = Charge Back document type.
    SELECT zmpets_shiphdrpernr pa0002vorna zmpets_shiphdr~movreason
    zmpets_chargebkshipdocnum zmpets_chargebkcreatedon
zmpets_chargebkchargeamount zmpets_shipactivversion
zmpets_shipactivactivity zmpets_shiphdrvendor
*adr6~smtp_addr
zmpets_167doc~empperid
             INTO CORRESPONDING FIELDS OF TABLE int_crb_ver
             FROM zmpets_chargebk
             JOIN zmpets_shiphdr
             ON zmpets_chargebkshipdocnum = zmpets_shiphdrshipdocno
             JOIN zmpets_shipactiv
       ON zmpets_chargebkshipdocnum = zmpets_shipactivpetsdocnumber
             JOIN pa0002
             ON zmpets_shiphdrpernr = pa0002pernr
            JOIN lfa1
                ON lfa1lifnr = zmpets_shiphdrvendor
                JOIN adr6
                ON adr6addrnumber = lfa1adrnr
                 JOIN zmpets_167doc
                 ON zmpets_167docpernr = pa0002pernr
                       WHERE zmpets_chargebk~createdon IN s_chdate
                       AND zmpets_shiphdr~pernr IN s_pernr
                       AND zmpets_shiphdr~movreason IN s_mvrsn
                       AND zmpets_chargebk~shipdocnum IN s_sin
                      AND zmpets_shipactiv~activity NE '30'
                       AND zmpets_shipactiv~doctype = '06'
                       AND zmpets_chargebk~loekz NE 'X'
                       AND zmpets_shipactiv~loekz NE 'X'
                       AND zmpets_shiphdr~loekz NE 'X'.
    IF sy-subrc <> 0.
*Message is 'No Charge Back Documents Available.'.
      MESSAGE s201(zm050).
    ELSE.
      PERFORM f_filter_data.
    ENDIF.
  ENDIF.
ENDFORM.                    "select_table_chb
*&      Form  UPDATE_RECORDS
      text
-->  p1        text
<--  p2        text
FORM update_records TABLES p_et_index_rows
                                STRUCTURE lvc_s_row.
  DATA: ls_selected_line LIKE lvc_s_row,
          lf_row_index TYPE lvc_index.
  LOOP AT p_et_index_rows INTO ls_selected_line.
    lf_row_index = ls_selected_line-index.
  ENDLOOP.
ENDFORM.                    " UPDATE_RECORDS
**&      Form  fieldcatalog_init
      text
     -->P_GT_FIELDCATALOG[]  text
FORM fieldcatalog_init  USING lt_fieldcatalog TYPE lvc_t_fcat.
  DATA: ls_fieldcatalog TYPE lvc_s_fcat.
  CLEAR ls_fieldcatalog.
  ls_fieldcatalog-fieldname = 'SEL'.
  ls_fieldcatalog-tabname  = 'INT_CRB'.
  ls_fieldcatalog-datatype = 'C'.
  ls_fieldcatalog-col_pos  = 1.
  ls_fieldcatalog-edit     = 'X'.
  ls_fieldcatalog-reptext  = 'Select for Processing'.
  ls_fieldcatalog-coltext  = 'Select for Processing'.
  ls_fieldcatalog-seltext  = 'Select for Processing'.
  ls_fieldcatalog-tooltip  = 'Select for Processing'.
  ls_fieldcatalog-checkbox = 'X'.
  ls_fieldcatalog-key = 'X'.
  APPEND ls_fieldcatalog TO lt_fieldcatalog.
  CLEAR ls_fieldcatalog.
  ls_fieldcatalog-fieldname = 'ICON'.
  ls_fieldcatalog-tabname   = 'INT_CRB'.
  ls_fieldcatalog-datatype  = 'CHAR'.
  ls_fieldcatalog-col_pos    = 2.
  ls_fieldcatalog-intlen     = '4'.
  ls_fieldcatalog-reptext   =  'Status'.
  ls_fieldcatalog-coltext   =  'Status'.
  ls_fieldcatalog-seltext   =  'Status'.
  ls_fieldcatalog-tooltip   =  'Status'.
  APPEND ls_fieldcatalog TO lt_fieldcatalog.
  CLEAR ls_fieldcatalog.
  ls_fieldcatalog-fieldname = 'PERNR'.
  ls_fieldcatalog-tabname   = 'INT_CRB'.
  ls_fieldcatalog-datatype  = 'NUMC'.
  ls_fieldcatalog-col_pos   = 2.
  ls_fieldcatalog-intlen    = '8'.
  ls_fieldcatalog-reptext   =  'Employee Number'.
  ls_fieldcatalog-coltext   =  'Employee Number'.
  ls_fieldcatalog-seltext   =  'Employee Number'.
  ls_fieldcatalog-tooltip   =  'Employee Number'.
  ls_fieldcatalog-key = 'X'.
  APPEND ls_fieldcatalog TO lt_fieldcatalog.
  CLEAR ls_fieldcatalog.
  ls_fieldcatalog-fieldname  = 'VORNA'.
  ls_fieldcatalog-tabname    = 'INT_CRB'.
  ls_fieldcatalog-col_pos    =  3 .
  ls_fieldcatalog-datatype   = 'CHAR'.
  ls_fieldcatalog-outputlen      = '20'.
  ls_fieldcatalog-reptext    = 'Employee Name'.
  ls_fieldcatalog-coltext    = 'Employee Name'.
  ls_fieldcatalog-seltext    = 'Employee Name'.
  ls_fieldcatalog-tooltip    = 'Employee Name'.
ls_fieldcatalog-key      = 'X'.
  APPEND ls_fieldcatalog TO lt_fieldcatalog.
  CLEAR ls_fieldcatalog.
  ls_fieldcatalog-fieldname  = 'MOVREASON'.
  ls_fieldcatalog-tabname    = 'INT_CRB'.
  ls_fieldcatalog-col_pos    =  4.
  ls_fieldcatalog-datatype   = 'NUMC'.
  ls_fieldcatalog-outputlen  = '10'.
  ls_fieldcatalog-reptext    = 'Move Reason'.
  ls_fieldcatalog-coltext    = 'Move Reason'.
  ls_fieldcatalog-seltext    = 'Move Reason'.
  ls_fieldcatalog-tooltip    = 'Move Reason'.
ls_fieldcatalog-key      = 'X'.
  APPEND ls_fieldcatalog TO lt_fieldcatalog.
  CLEAR ls_fieldcatalog.
  ls_fieldcatalog-fieldname = 'SHIPDOCNUM'.
  ls_fieldcatalog-tabname   = 'INT_CRB'.
  ls_fieldcatalog-datatype  = 'NUMC'.
  ls_fieldcatalog-outputlen = '10'.
  ls_fieldcatalog-col_pos   =  5.
  ls_fieldcatalog-reptext   = 'Shipping Document Number'.
  ls_fieldcatalog-coltext   = 'Shipping Document Number'.
  ls_fieldcatalog-seltext   = 'Shipping Document Number'.
  ls_fieldcatalog-tooltip   = 'Shipping Document Number'.
ls_fieldcatalog-key = 'X'.
  APPEND ls_fieldcatalog TO lt_fieldcatalog.
  CLEAR ls_fieldcatalog.
  ls_fieldcatalog-fieldname = 'CREATEDON'.
  ls_fieldcatalog-tabname   = 'INT_CRB'.
  ls_fieldcatalog-col_pos   = 6.
  ls_fieldcatalog-datatype  = 'DATS'.
  ls_fieldcatalog-outputlen = '8'.
  ls_fieldcatalog-reptext   = 'Created On'.
  ls_fieldcatalog-coltext   = 'Created On'.
  ls_fieldcatalog-seltext   = 'Created On'.
  ls_fieldcatalog-tooltip   = 'Created On'.
ls_fieldcatalog-DO_sum      = 'X'.
  APPEND ls_fieldcatalog TO lt_fieldcatalog.
  CLEAR ls_fieldcatalog.
  ls_fieldcatalog-fieldname = 'CHARGEAMOUNT'.
  ls_fieldcatalog-tabname   = 'INT_CRB'.
  ls_fieldcatalog-col_pos   = 7.
  ls_fieldcatalog-datatype  = 'CURR'.
  ls_fieldcatalog-outputlen = '13'.
  ls_fieldcatalog-reptext   = 'Charge Back Amount'.
  ls_fieldcatalog-coltext   = 'Charge Back Amount'.
  ls_fieldcatalog-seltext   = 'Charge Back Amount'.
  ls_fieldcatalog-tooltip   = 'Charge Back Amount'.
ls_fieldcatalog-DO_sum      = 'X'.
  APPEND ls_fieldcatalog TO lt_fieldcatalog.
  CLEAR ls_fieldcatalog.
ENDFORM.                    "fieldcatalog_init
*&      Form  f_modify_activity
Modify the activity to 79 in zmpets_shipaciv table.
-->  p1        text
<--  p2        text
FORM f_modify_activity .
  REFRESH int_crb_mail.
  int_crb_mail[] = int_crb[].
*All the document number which is to be processed is stored in
*the internel table 'INT_SIN'.
  LOOP AT int_crb INTO int_crb.
    IF int_crb-sel ='X'.
      MOVE int_crb-shipdocnum TO int_sin.
      APPEND int_sin.
      CLEAR int_sin.
*Removing the processed documents.
      DELETE int_crb.
    ENDIF.
    CLEAR int_crb.
  ENDLOOP.
*Get the details from shipactiv table.
  IF int_sin[] IS NOT INITIAL.
    SELECT * FROM zmpets_shipactiv
        INTO TABLE int_shipactiv
          FOR ALL ENTRIES IN int_sin
                WHERE petsdocnumber = int_sin-shipdocnum.
*Modify the activity code, version, actual date and last changed date.
    SORT int_shipactiv BY petsdocnumber version DESCENDING.
    CLEAR wf_tabix.
    LOOP AT int_shipactiv.
      wf_tabix = sy-tabix.
      AT NEW petsdocnumber.
        READ TABLE int_shipactiv INDEX wf_tabix.
        int_shipactiv-activity = '030'.
        int_shipactiv-version = int_shipactiv-version + 1.
        int_shipactiv-actdate = sy-datum.
        int_shipactiv-lastchangedby = sy-uname.
        int_shipactiv-lastchangedt = sy-datum.
*Modify the data base table
        MODIFY zmpets_shipactiv FROM int_shipactiv.
      ENDAT.
      CLEAR int_shipactiv.
      AT LAST.
*Message is 'Data Processed Successfully.'.
        MESSAGE s203(zm050).
      ENDAT.
    ENDLOOP.
*-send mail to the vendor and employee that the shipment is cleared for
    LOOP AT int_crb_mail WHERE sel = 'X'.
      PERFORM f_send_mail.
    ENDLOOP.
    REFRESH int_crb_mail.
   CALL SELECTION-SCREEN 1000.
  ELSE.
*Message is 'No Data Selected for Processing.'.
    MESSAGE s200(zm050).
  ENDIF.
ENDFORM.                    " f_modify_activity
*&      Form  f_clear_fields
      text
-->  p1        text
<--  p2        text
FORM f_clear_fields .
  CLEAR int_crb.
  CLEAR int_crb_ver.
  CLEAR int_sin.
  REFRESH int_crb.
  REFRESH int_crb_ver.
  REFRESH int_sin.
  CLEAR int_shipactiv.
  REFRESH int_shipactiv.
  CLEAR wf_flag.
  CLEAR wf_tabix.
ENDFORM.                    " f_clear_fields
*&      Form  f_filter_data
      text
-->  p1        text
<--  p2        text
FORM f_filter_data .
*Take the latest Version Data.
*take all the activities, including the activity '30'.
then put the details in internal table 'INT_CRB'.
  SORT int_crb_ver BY shipdocnum version DESCENDING.
  CLEAR wf_tabix.
  CLEAR int_crb.
  REFRESH int_crb.
  LOOP AT int_crb_ver.
    wf_tabix = sy-tabix.
    AT NEW shipdocnum.
      READ TABLE int_crb_ver INDEX wf_tabix.
      MOVE-CORRESPONDING int_crb_ver TO int_crb.
      APPEND int_crb.
      CLEAR int_crb.
    ENDAT.
  ENDLOOP.
  IF int_crb[] IS INITIAL.
*Message is 'No Records Available.'.
    MESSAGE s202(zm050).
  ELSE.
    CLEAR wf_tabix.
    LOOP AT int_crb.
      wf_tabix = sy-tabix.
      REFRESH lt_celltab.
      ls_celltab-fieldname = 'SEL'.
      IF int_crb-activity = '030'.
        ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
*status becomes green. ie processed
        int_crb-icon = '@08@'. "Green
      ELSE.
        ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
*status set to red. ie not yet processed
        int_crb-icon = '@0A@'. "Red
      ENDIF.
      INSERT ls_celltab INTO TABLE lt_celltab.
      INSERT LINES OF lt_celltab INTO TABLE int_crb-celltab.
      MODIFY int_crb INDEX wf_tabix.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " f_filter_data
*&      Form  f_filter_data
      text
-->  p1        text
<--  p2        text
FORM f_filter_data_pending.
*Take the latest Version Data.
*take all the activities, including the activity '30'.
*then filter it with out the activities '30' and having the lastest
*version. then put the details in internal table 'INT_CRB'.
  SORT int_crb_ver BY shipdocnum version DESCENDING.
  CLEAR wf_tabix.
  CLEAR int_crb.
  REFRESH int_crb.
  LOOP AT int_crb_ver.
    wf_tabix = sy-tabix.
    AT NEW shipdocnum.
      READ TABLE int_crb_ver INDEX wf_tabix.
      IF int_crb_ver-activity NE '030'.
        MOVE-CORRESPONDING int_crb_ver TO int_crb.
        APPEND int_crb.
        CLEAR int_crb.
      ENDIF.
    ENDAT.
  ENDLOOP.
  IF int_crb[] IS INITIAL.
*Message is 'No Records Available.'.
    MESSAGE s202(zm050).
  ENDIF.
ENDFORM.                    " f_filter_data_pending
*&      Form  EXCLUDE_TB_FUNCTIONS
      text
     <--P_LT_EXCLUDE  text
FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
  DATA ls_exclude TYPE ui_func.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
  APPEND ls_exclude TO pt_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
  APPEND ls_exclude TO pt_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
  APPEND ls_exclude TO pt_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
  APPEND ls_exclude TO pt_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
  APPEND ls_exclude TO pt_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
  APPEND ls_exclude TO pt_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
  APPEND ls_exclude TO pt_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
  APPEND ls_exclude TO pt_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
  APPEND ls_exclude TO pt_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
  APPEND ls_exclude TO pt_exclude.
ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
*&      Form  f_send_mail
      text
-->  p1        text
<--  p2        text
FORM f_send_mail .
*store the vendor name, vendor email id , employee name and employee
*email id in the internal table int_crb
Creation of the document to be sent
  CLEAR doc_chng.
  REFRESH objpack.
  REFRESH objhead.
  REFRESH  reclist.
  REFRESH objtxt.
File Name
  doc_chng-obj_name = 'SHIPMENT'.
Mail Subject
  CONCATENATE 'Shipment Document No.' int_crb_mail-shipdocnum
  'Cleared.'
  INTO doc_chng-obj_descr SEPARATED BY ' '.
Mail Contents
  objtxt-line = 'Hi,'.
  APPEND objtxt.
  objtxt-line = ' '.
  APPEND objtxt.
  CONCATENATE 'Shipment Document Number ' int_crb_mail-shipdocnum
' cleared for move.' INTO objtxt-line SEPARATED BY ' '.
  APPEND objtxt.
  objtxt-line = ' '.
  APPEND objtxt.
  CLEAR  objtxt.
  objtxt-line = 'Regards '.
  APPEND objtxt.
  objtxt-line = ' '.
  APPEND objtxt.
  objtxt-line = 'SAP '.
  APPEND objtxt.
  CLEAR  objtxt.
  APPEND objtxt.
  DESCRIBE TABLE objtxt LINES tab_lines.
  READ TABLE objtxt INDEX tab_lines.
  doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(
objtxt ).
Creation of the entry for the compressed document
  CLEAR objpack-transf_bin.
  objpack-head_start = 1.
  objpack-head_num = 0.
  objpack-body_start = 1.
  objpack-body_num = tab_lines.
  objpack-doc_type = 'RAW'.
  APPEND objpack.
Completing the recipient list
target recipent
  CLEAR reclist.
  reclist-receiver = int_crb_mail-empperid. "employee email ID
  "wf_empperid.
  reclist-express  = 'X'.
  reclist-rec_type = 'U'.
  APPEND reclist.
copy recipents
CLEAR reclist.
reclist-receiver = 'anversha.shahul@'."int_crb_mail-smtp_addr
reclist-express  = 'X'.
reclist-rec_type = 'U'.
reclist-copy     = 'X'.
APPEND reclist.
Sending the document
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = doc_chng
    TABLES
      packing_list               = objpack
      object_header              = objhead
   contents_bin               = objbin
      contents_txt               = objtxt
      receivers                  = reclist
    EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      operation_no_authorization = 4
      OTHERS                     = 99.
  COMMIT WORK.
  SUBMIT rsconn01
                WITH mode = 'INT'
                WITH output = ' '
                  AND RETURN.
ENDFORM.                    " f_send_mail
rgds
anver
pls mark hlpful answers

Similar Messages

  • What are the options for integrating the event catalog and event landing pages in our website?

    We'd like to integrate the event catalog and event landing pages into our website but would prefer not to use the standard iframe embed code. Are there other solutions available, like an API or something else?
    Reason for this is that when we tried it with the iframe embed code the event catalog seems to load quite slow in a webpage on our website. Plus it seems we can't change the width and height of the event catalog with the CQ5 editor, or have the event catalog embed dynamically change in size depending on the amount of events in the catalog.

    Keeping everything in one scene is the better way to go.  Scenes are useful for animators who do not use navigation, they just make movies that play frame after frame without stopping.  But for anything that involves navigating the timeline you will have less headaches if you just avoid them and keep everything in the one main timeline.
    There are primarily two approaches to implementing pages in a timeline.  Either spread them out along the timeline and navigate from frame to frame to access them, or create them as movieclips (all in the same frame) and manage their visibility.  The latter approach makes it easier to maintain the status of a one page if navigating to another is necessary.  And you might find it useful to mix these two approaches at times.
    When you have everything on one timeline, you can have a layer dedicated to actionscript that you extend the full length of the timeline, which makes shareable code, such as variables and functions, available to anything along the timeline.  This avoids any need to have duplicate function definitions since you can have the same single function available to multiple pages in the site.  I usually use two actions layers... one for the shared stuff which has all code in frame 1 only, and another for frame specific code such as timeline commands and other action coding that needs to happen at particular frames.

  • How do I transfer imovie projects and events to new mac from external hard drive

    bought a  macbook pro retina.  backed up 3yr old macbook pro to external hard drive.  how do I transfer imovie projects and events to new mac?  thanks!

    Hi dalbatross,
    Welcome to the Support Communities!
    Did you set up your new computer by creating a Time Machine backup and restoring from it?
    If so, the Events and Projects that were on your internal Macintosh HD would copied to your new computer.
    Here is another way to copy the events & projects to the new computer from the external drive:
    iMovie Help: Work with multiple libraries
    http://help.apple.com/imovie/mac/10.0/#mov3fa25bae7
    Copy or move projects, events, or clips between libraries or hard disks
    Connect a hard disk that contains the target library to your computer, or copy the target library to your computer.
    Choose File > Open Library, and choose an option from the submenu.You can choose from recently opened libraries at the top of the submenu, locate an existing library on your computer, or create a new library.
    The selected library is opened in the Libraries list, with the first event selected and its contents displayed in the browser.
    In the Libraries list, select the event that contains the item you want to move or copy.
    In the browser, select the item you want to move or copy.Note:  To select multiple items, hold down the Command key as you click the items you want to select, or drag a selection rectangle around the items.
    Do one of the following:
    To move items between events or libraries: Drag the clip or project to another event or library.
    To copy items between events or libraries: Option-drag the clip or project to another event or library by first starting to drag and then holding down the Option key as you drag.
    Cheers,
    - Judy

  • How to find my iMovie projects and events since updating??????

    i updated my macbook pro retina to osx mavericks then my iMovie to the newer version. I now can't find or use my pervious projects or events and I've spent days hrs on some of them. I stored and use most of my projects/events on my external hd. its hooked up. can someone who knows how this works walk me through how to get my imovie projects and events linked from my external hd to this new imovie version that for some reason cant link them like the pervious.
    I hate when something work and then it gets updated and it doesnt work the same... frustrating.

    okay, do a search for iMovie cache or iMovie thumbnails, and you'll probably find them. Unless you choose reject clips and then move rejected clips to the trash, then check the cache or thumbnails, your clips won't be truly gone.  Just deleting them from the windows doesn't quite work.  Sorry I can't remember the technical name for 'em, just going by my experience.  Also, try deleting your project, and throwing that rascal in the trash, then start again. Usually it's becuz you chose copy the original rather than move it (to be on the safe side), like I did......
    anyways, thanks for writin'
    J.B.

  • Catalog and Non catalog?

    Hi,
    what is the difference between catalog and non catalog ?
    Thanks,

    Hi Rehan,
    In simple words, catalog refers to list of items available for purchase, with the description and price of each item. Usually, a bind-in order form is included with the catalog. Catalog is basically maintained by a company for classified items and it helps its user to shop items based on the catalog. e.g. say in a Color Industry you can classify different shades of colors in a catalog. Another example is Menu card of a restaurant/hotel.
    Non-catalog item is basically refers to items which are not defined under any catalog .e.g. say you are buying an air ticket or car rentals for official use...
    Hope this will help.
    Regards,
    S.P DASH

  • How to make an checkbox editable and uneditable within a single alv output.

    Hi,
    How to make an checkbox editable and uneditable within a single alv output depending on condition.
    I have used Reuse_alv_grid_display.
    In my output every checkbox is editable. i have used edit = 'X'.
    I want editable checkbox for correct value and uneditable checkbox for incorrect value in a single alv

    >
    Mukilansap wrote:
    > I want editable checkbox for correct value and uneditable checkbox for incorrect value in a single alv
    Use alv styles to achieve this, set the style for each record before displaying the ALV. Structure LVC_S_STYL.
    Take a look at the example BCALV_EDIT_02, it is OOPS based, but check how the style table is filled.
    regards,
    Advait

  • What is the diff bet CCM catalog and MDM catalog?

    Hi Friends
    What is the diff bet CCM catalog and MDM catalog?
    Thanks & Regards
    Kanni

    Hello,
    CCM & SRM-MDM are SAP Catalog Content Management solutions.
    In basic terms, MDM is latest solution & will be replacing CCM. All new features like service hierarchies are included in MDM 3.0.
    CCM: upload, manage, and search in procurement catalogs.
    http://help.sap.com/saphelp_ccm20/helpdata/en/index.htm
    MDM: Search, compare, and procure products from suppliers.
    It provides:
    Catalog content management functions, such as the import of catalog structures or data, the transfer of catalog items to a procurement application, and search functions
    Procurement catalogs
    Supplier catalogs in a Web-based environment
    The SRM-MDM Catalog is based on functions provided by SAP NetWeaver Master Data Management (SAP NetWeaver MDM) and bundles together in one specific application those SAP NetWeaver MDM functions required for catalog content management.
    http://help.sap.com/saphelp_srm70/helpdata/en/45/ddd04f8c6e2e97e10000000a155369/frameset.htm
    Hope this helps.
    Thanks
    Ashutosh

  • How to add custom field in SRM-MDM catalog

    Hi Guys,
    I have to add a custom field in SRM-MDM catalog. I know, it is done through MDM console, but how, it is done, This, I don't know.
    Please help me.
    Thanks in advance!!
    Note-> we are at SRM5.0 + MDM2.0
    Neelesh

    Please check the online help.
    [http://help.sap.com/saphelp_mdm550/helpdata/en/6c/24e342f6307176e10000000a1550b0/frameset.htm|http://help.sap.com/saphelp_mdm550/helpdata/en/6c/24e342f6307176e10000000a1550b0/frameset.htm]
    Regards,
    Masa

  • How to access screen field in pai event

    Hi All,
    I have created a custom screen it has the field say matnr selected from the dictionay.NOw  how will I should access this field in PAI event module?
    Thanks in advance
    Mahesh

    just declare the same variable in your abap editor as per your layout field name.
    suppose in your layout input field name is matnr just declare
    data : matnr like mara-matnr.
    in pai module if you are using matnr it will give you the screen data.
    like
    module pai input.
    if matnr ne '1000'.
    message 'Error matnr is not 1000' type 'E'.
    endif.
    endmodule.
    reagards
    shiba dutta

  • LIST output and event handling in OO ALV and

    Hi,
    I am creating an ALV Report.
    How can i Display the Grid as a List. I am abke to change the view from the first grid that is created. but i need to show it as a list output from beginning.
    Also i have created a hotspot in and it works when the ALV is displayed in Grid Format but it does not work when i switch the view to list output.
    Any suggestions.
    Regards,
    Tarun Bahal

    *& Report  ZFI_TRIAL_BALANCE
    REPORT  zfi_trial_balance LINE-SIZE 275 LINE-COUNT 3(2) NO STANDARD PAGE HEADING.
    TABLES: bseg.
    TYPES: BEGIN OF ty_bkpf ,
      bukrs TYPE bkpf-bukrs,
      belnr TYPE bkpf-belnr,
      gjahr TYPE bkpf-gjahr,
      budat TYPE bkpf-budat,
      END OF ty_bkpf.
    TYPES: BEGIN OF ty_bseg ,
      bukrs TYPE bseg-bukrs,
      belnr TYPE bseg-belnr,
      gjahr TYPE bseg-gjahr,
      hkont TYPE bseg-hkont,
      END OF ty_bseg.
    TYPES: BEGIN OF ty_bank,
      hkont TYPE bseg-hkont,
      txt50 TYPE skat-txt50,
      open_dmbtr_dr TYPE p,
      open_dmbtr_cr TYPE p,
      trans_dmbtr_dr TYPE p,
      trans_dmbtr_cr TYPE p,
      close_dmbtr_dr TYPE p,
      close_dmbtr_cr TYPE p,
      END OF ty_bank.
    TYPES: BEGIN OF ty_breakup,
      bukrs TYPE bseg-bukrs,
      blart TYPE bkpf-blart,
      belnr TYPE bseg-belnr,
      budat TYPE bkpf-budat,
      umskz TYPE bseg-umskz,
      rebzg TYPE bseg-rebzg,
      lifnr TYPE  bseg-lifnr,
      kunnr TYPE bseg-kunnr,
      name1 TYPE lfa1-name1,
      dmbtr TYPE p,
      END OF ty_breakup.
    INITIALIZATION.
    *       CLASS handler DEFINITION
    CLASS handler DEFINITION.
      PUBLIC SECTION .
        METHODS:handle_hotspot_click                              "handler definition for hotspot_click
        FOR EVENT hotspot_click OF cl_gui_alv_grid
        IMPORTING e_row_id
                  e_column_id
                  es_row_no,
                 handle_top_of_page
        FOR EVENT print_top_of_page OF cl_gui_alv_grid
        IMPORTING table_index,
                handle_subtotal_text
        FOR EVENT subtotal_text OF cl_gui_alv_grid
        IMPORTING es_subtottxt_info
                  ep_subtot_line
                  e_event_data.
    ENDCLASS.                    "handler DEFINITION
    *       CLASS handler IMPLEMENTATION
    CLASS handler IMPLEMENTATION.
      METHOD handle_hotspot_click.                              "handler implementation for hotspot_click
        PERFORM handle_hotspot_click USING e_row_id
                                           e_column_id
                                           es_row_no .
      ENDMETHOD.                    "handle_hotspot_click
      METHOD handle_top_of_page.
        PERFORM handle_print_top_of_page.
      ENDMETHOD.                    "handle_hotspot_click
      METHOD handle_subtotal_text.
        PERFORM handle_subtotal_text USING es_subtottxt_info
                                           ep_subtot_line
                                           e_event_data.
      ENDMETHOD.                    "Subtotal_text
    ENDCLASS.                    "handler IMPLEMENTATION
    DATA: i_set_values TYPE TABLE OF rgsb4,
          wa_set_values LIKE LINE OF i_set_values,
          l_dmbtr TYPE dmbtr,
          l_dmbtr2 TYPE dmbtr,
          l_dmbtr3 TYPE dmbtr,
          l_dmbtr4 TYPE dmbtr,
          l_dmbtr_total TYPE dmbtr,
          l_shkzg TYPE shkzg,
          i_bkpf TYPE STANDARD TABLE OF ty_bkpf,
          i_bseg TYPE STANDARD TABLE OF ty_bseg,
          i_bank TYPE STANDARD TABLE OF ty_bank,
          i_breakup TYPE STANDARD TABLE OF ty_breakup,
          wa_bkpf LIKE LINE OF i_bkpf,
          wa_bseg LIKE LINE OF i_bseg,
          wa_bank LIKE LINE OF i_bank,
          wa_breakup LIKE LINE OF i_breakup,
          ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm,
          l_ktopl TYPE ktopl.
    DATA: gr_alvgrid TYPE REF TO cl_gui_alv_grid,
          gr_alvgrid_0200 TYPE REF TO cl_gui_alv_grid,
          gr_ccontainer TYPE REF TO cl_gui_custom_container,
          gr_ccontainer_0200 TYPE REF TO cl_gui_custom_container,
          gt_fieldcat TYPE lvc_t_fcat,
          gs_layout TYPE lvc_s_layo,
          gt_sort TYPE lvc_t_sort,
          gt_roid TYPE lvc_t_roid,
          gt_exclude TYPE ui_functions,
          g_scrstatus TYPE i,
          gs_variant TYPE disvariant,
          o_handler TYPE REF TO handler.
    CONSTANTS: c_doctype(22) TYPE c VALUE 'ZINFITR01_TRIALBALANCE'.
    DATA gs_stbl TYPE lvc_s_stbl.
    SELECTION-SCREEN: BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: l_date FOR sy-datum.
    PARAMETERS : l_bukrs TYPE bukrs,
                 l_segent TYPE fb_segment.
    SELECTION-SCREEN: END OF BLOCK block1.
    START-OF-SELECTION.
      gs_stbl-row = 'X'.
      gs_stbl-col = 'X'.
      CALL FUNCTION 'G_SET_GET_ALL_VALUES'
        EXPORTING
          setnr         = c_doctype
          table         = 'SKA1'
          class         = '0000'
        TABLES
          set_values    = i_set_values
        EXCEPTIONS
          set_not_found = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CLEAR i_bank.
      LOOP AT i_set_values INTO wa_set_values.
        CLEAR: l_dmbtr, l_dmbtr2, l_dmbtr3, l_dmbtr4, i_bkpf, i_bseg.
        wa_bank-hkont = wa_set_values-from.
        SELECT bukrs belnr budat gjahr FROM bkpf
          INTO CORRESPONDING FIELDS OF TABLE i_bkpf
          WHERE bukrs = l_bukrs
            AND budat < l_date-low.
        LOOP AT i_bkpf INTO wa_bkpf.
          SELECT dmbtr shkzg FROM bseg INTO (l_dmbtr, l_shkzg)
            WHERE bukrs = wa_bkpf-bukrs
              AND belnr = wa_bkpf-belnr
              AND gjahr = wa_bkpf-gjahr
              AND hkont = wa_set_values-from.
            IF l_shkzg = 'S'.
              l_dmbtr2 = l_dmbtr2 + l_dmbtr.
            ELSE.
              l_dmbtr2 = l_dmbtr2 - l_dmbtr.
            ENDIF.
            CLEAR: l_dmbtr, l_shkzg.
          ENDSELECT.
        ENDLOOP.
        IF l_dmbtr2 > 0.
          wa_bank-open_dmbtr_dr = l_dmbtr2.
        ELSE.
          wa_bank-open_dmbtr_cr = l_dmbtr2.
        ENDIF.
        CLEAR: l_dmbtr, i_bkpf, i_bseg.
        SELECT bukrs belnr budat gjahr FROM bkpf
          INTO CORRESPONDING FIELDS OF TABLE i_bkpf
          WHERE bukrs = l_bukrs
            AND budat IN l_date.
        LOOP AT i_bkpf INTO wa_bkpf.
          SELECT dmbtr shkzg FROM bseg INTO (l_dmbtr, l_shkzg)
            WHERE bukrs = wa_bkpf-bukrs
              AND belnr = wa_bkpf-belnr
              AND gjahr = wa_bkpf-gjahr
              AND hkont = wa_set_values-from.
            IF l_shkzg = 'S'.
              l_dmbtr3 = l_dmbtr3 + l_dmbtr.
            ELSE.
              l_dmbtr4 = l_dmbtr4 - l_dmbtr.
            ENDIF.
            CLEAR: l_dmbtr, l_shkzg.
          ENDSELECT.
        ENDLOOP.
    *    IF l_dmbtr3 > 0.
        wa_bank-trans_dmbtr_dr = l_dmbtr3.
    *    ELSE.
        wa_bank-trans_dmbtr_cr = l_dmbtr4.
    *    ENDIF.
        l_dmbtr = l_dmbtr2 + l_dmbtr3 + l_dmbtr4.
        IF l_dmbtr > 0.
          wa_bank-close_dmbtr_dr = l_dmbtr.
        ELSE.
          wa_bank-close_dmbtr_cr = l_dmbtr.
        ENDIF.
        CLEAR: l_dmbtr.
        SELECT SINGLE ktopl FROM t001 INTO l_ktopl WHERE bukrs = l_bukrs.
        SELECT SINGLE txt50 FROM skat INTO wa_bank-txt50
          WHERE spras = sy-langu "( SELECT spras FROM t002 WHERE laiso = sy-langu )
          AND ktopl = l_ktopl
          AND saknr = wa_set_values-from.
        APPEND wa_bank TO i_bank.
        CLEAR wa_bank.
      ENDLOOP.
      LOOP AT i_bank INTO wa_bank.
    *    IF wa_bank-open_dmbtr_cr < 0.
        wa_bank-open_dmbtr_cr = wa_bank-open_dmbtr_cr * -1.
    *    ENDIF.
    *    IF wa_bank-trans_dmbtr_cr < 0.
        wa_bank-trans_dmbtr_cr = wa_bank-trans_dmbtr_cr * -1.
    *    ENDIF.
    *    IF wa_bank-close_dmbtr_cr < 0.
        wa_bank-close_dmbtr_cr = wa_bank-close_dmbtr_cr * -1.
    *    ENDIF.
        MODIFY i_bank FROM wa_bank.
      ENDLOOP.
      SORT i_bank ASCENDING BY hkont.
    END-OF-SELECTION.
    *  SET SCREEN 100.
      CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS01'.
      SET TITLEBAR 'TITLE1'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  save_ok  INPUT
    *       text
    MODULE save_ok INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
    ENDMODULE.                 " save_ok  INPUT
    *&      Module  create_alv  OUTPUT
    *       text
    MODULE create_alv OUTPUT.
      IF gr_alvgrid IS INITIAL.
        CREATE OBJECT gr_ccontainer
          EXPORTING
    *    PARENT                      =
            container_name              = 'CUSTOM_CONTAINER'
            repid                       = sy-repid
            dynnr                       = '0100'
          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 gr_alvgrid
          EXPORTING
            i_parent          = gr_ccontainer
          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.
        PERFORM prepare_field_catalog CHANGING gt_fieldcat .
        PERFORM prepare_layout CHANGING gs_layout .
        PERFORM prepare_sort CHANGING gt_sort.
        gs_variant-report = sy-repid.
        gs_variant-variant = 'ABC'.
        gs_variant-handle = '1'.
    *    IF sy-dynnr = '0100'.
        CALL METHOD gr_alvgrid->set_table_for_first_display
          EXPORTING
    *      I_BUFFER_ACTIVE               =
    *      I_BYPASSING_BUFFER            =
    *      I_CONSISTENCY_CHECK           =
    *      I_STRUCTURE_NAME              =
    *      is_variant                    = gs_variant
    *      i_save                        = 'A'
    *      i_default                     = 'X'
            is_layout                     = gs_layout
    *      IS_PRINT                      =
    *      IT_SPECIAL_GROUPS             =
    *      IT_TOOLBAR_EXCLUDING          =
    *      IT_HYPERLINK                  =
    *      IT_ALV_GRAPHICS               =
    *      IT_EXCEPT_QINFO               =
    *      IR_SALV_ADAPTER               =
          CHANGING
            it_outtab                     = i_bank
            it_fieldcatalog               = gt_fieldcat
    *    it_sort                       = gt_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.
      ELSE.
        CALL METHOD gr_alvgrid->refresh_table_display
          EXPORTING
            is_stable      = gs_stbl
    *        i_soft_refresh = 'X'
          EXCEPTIONS
            finished       = 1
            OTHERS         = 2.
        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 o_handler.
      SET HANDLER o_handler->handle_hotspot_click FOR gr_alvgrid.
      SET HANDLER o_handler->handle_top_of_page FOR gr_alvgrid.
      SET HANDLER o_handler->handle_subtotal_text FOR gr_alvgrid.
    *  ENDIF.
    ENDMODULE.                 " create_alv  OUTPUT
    *&      Form  prepare_field_catalog
    *       text
    *      <--P_GT_FIELDCAT  text
    FORM prepare_field_catalog  CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA: ls_fcat TYPE lvc_s_fcat.
      CLEAR pt_fieldcat.
      CLEAR gt_fieldcat.
    *  IF sy-dynnr = '0100'.
      ls_fcat-fieldname = 'HKONT' .
      ls_fcat-ref_field = 'HKONT'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '15' .
      ls_fcat-ref_table = 'BSEG' .
      ls_fcat-coltext = 'G/L Account' .
      ls_fcat-seltext = 'G/L Account' .
      ls_fcat-hotspot = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'TXT50' .
      ls_fcat-ref_field = 'TXT50'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'SKAT' .
      ls_fcat-coltext = 'Description' .
      ls_fcat-seltext = 'Description' .
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'OPEN_DMBTR_DR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Opening Balance: Debit' .
      ls_fcat-seltext = 'Opening Balance: Debit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'OPEN_DMBTR_CR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Opening Balance: Credit' .
      ls_fcat-seltext = 'Opening Balance: Credit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'TRANS_DMBTR_DR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Trans Balance: Debit' .
      ls_fcat-seltext = 'Trans Balance: Debit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'TRANS_DMBTR_CR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Trans Balance: Credit' .
      ls_fcat-seltext = 'Trans Balance: Credit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'CLOSE_DMBTR_DR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Closing Balance: Debit' .
      ls_fcat-seltext = 'Closing Balance: Debit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'CLOSE_DMBTR_CR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '20' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Closing Balance: Credit' .
      ls_fcat-seltext = 'Closing Balance: Credit'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    *  ELSE.
    *  ENDIF.
    ENDFORM.                    " prepare_field_catalog
    *&      Form  prepare_layout
    *       text
    *      <--P_GS_LAYOUT  text
    FORM prepare_layout  CHANGING ps_layout TYPE lvc_s_layo.
      DATA l_title(50) TYPE c.
      CONCATENATE 'Trial Balance: ' l_date-low+6(2) '-' l_date-low+4(2) '-'l_date-low(4) ' to ' l_date-high+6(2) '-' l_date-high+4(2) '-'l_date-high(4) INTO l_title RESPECTING BLANKS.
    *  ps_layout-zebra = 'X' .
      ps_layout-grid_title = l_title.
      ps_layout-cwidth_opt = 'X' .
      ps_layout-sel_mode = 'A'.
    *  ps_layout-no_toolbar = 'X'.
      ps_layout-no_headers = 'X'.
      ps_layout-frontend = 'L'.
    ENDFORM.                    " prepare_layout
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE save_ok.
        WHEN 'BACK'.
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  prepare_sort
    *       text
    *      <--P_GT_SORT  text
    FORM prepare_sort  CHANGING pt_sort TYPE lvc_t_sort.
      CLEAR: pt_sort, gt_sort.
      DATA ls_sort TYPE lvc_s_sort .
      IF sy-dynnr = '0100'.
        ls_sort-spos = '1' .
        ls_sort-fieldname = 'HKONT' .
        ls_sort-up = 'X' . "A to Z
        ls_sort-down = space .
        APPEND ls_sort TO pt_sort .
      ELSE.
        ls_sort-spos = '1' .
        ls_sort-fieldname = 'BELNR' .
        ls_sort-up = 'X' . "A to Z
        ls_sort-down = space .
        APPEND ls_sort TO pt_sort .
    *    ls_sort-spos = '2' .
    *    ls_sort-fieldname = 'BELNR' .
    **    ls_sort-up = 'X' . "A to Z
    **    ls_sort-down = space .
    *    ls_sort-subtot = 'X'.
    *    APPEND ls_sort TO pt_sort .
      ENDIF.
    ENDFORM.                    " prepare_sort
    *&      Form  handle_hotspot_click
    *       text
    *      -->P_E_ROW_ID  text
    *      -->P_E_COLUMN_ID  text
    *      -->P_ES_ROW_NO  text
    FORM handle_hotspot_click  USING i_row_id TYPE lvc_s_row
                                     i_column_id TYPE lvc_s_col
                                     is_row_no TYPE lvc_s_roid.
      CLEAR: wa_bank, i_breakup.
      READ TABLE i_bank INTO wa_bank INDEX is_row_no-row_id.
    *TYPES: BEGIN OF ty_breakup,
    *  bukrs TYPE bseg-bukrs,
    *  blart TYPE bkpf-blart,
    *  belnr TYPE bseg-belnr,
    *  budat TYPE bkpf-budat,
    *  umskz TYPE bseg-umskz,
    *  rebzg TYPE bseg-rebzg,
    *  lifnr TYPE  bseg-lifnr,
    *  name1 TYPE lfa1-name1,
    *  dmbtr TYPE p,
    *  END OF ty_breakup.
      SELECT bukrs belnr budat gjahr FROM bkpf
            INTO CORRESPONDING FIELDS OF TABLE i_bkpf
            WHERE bukrs = l_bukrs
              AND budat IN l_date.
      LOOP AT i_bkpf INTO wa_bkpf.
        SELECT bukrs belnr umskz rebzg lifnr kunnr dmbtr shkzg FROM bseg
          INTO (wa_breakup-bukrs, wa_breakup-belnr, wa_breakup-umskz, wa_breakup-rebzg, wa_breakup-lifnr, wa_breakup-kunnr, wa_breakup-dmbtr, l_shkzg)
          WHERE bukrs = l_bukrs
                  AND belnr = wa_bkpf-belnr
                  AND gjahr = wa_bkpf-gjahr
                  AND hkont = wa_bank-hkont.
          SELECT SINGLE blart budat FROM bkpf INTO (wa_breakup-blart, wa_breakup-budat)
            WHERE bukrs = l_bukrs
                  AND belnr = wa_bkpf-belnr
                  AND gjahr = wa_bkpf-gjahr.
          IF wa_breakup-lifnr IS NOT INITIAL.
            SELECT SINGLE name1 FROM lfa1 INTO wa_breakup-name1
              WHERE lifnr = wa_breakup-lifnr.
          ELSE.
            SELECT SINGLE name1 FROM kna1 INTO wa_breakup-name1
            WHERE lifnr = wa_breakup-kunnr.
            wa_breakup-lifnr = wa_breakup-kunnr.
          ENDIF.
        ENDSELECT.
        IF l_shkzg = 'H'.
          wa_breakup-dmbtr = wa_breakup-dmbtr * -1.
        ENDIF.
        IF wa_breakup IS NOT INITIAL.
          APPEND wa_breakup TO i_breakup.
        ENDIF.
        CLEAR wa_breakup.
      ENDLOOP.
      SET SCREEN 200.
      LEAVE SCREEN.
    ENDFORM.                    " handle_hotspot_click
    *&      Module  STATUS_0200  OUTPUT
    *       text
    MODULE status_0200 OUTPUT.
      SET PF-STATUS 'STATUS01'.
      SET TITLEBAR 'TITLE2'.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  USER_COMMAND_0200  INPUT
    *       text
    MODULE user_command_0200 INPUT.
      CASE save_ok.
        WHEN 'BACK'.
    *      CLEAR: gr_alvgrid, gr_ccontainer.
          SET SCREEN 100.
          LEAVE SCREEN .
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    *&      Module  create_alv_0200  OUTPUT
    *       text
    MODULE create_alv_0200 OUTPUT.
      IF gr_alvgrid_0200 IS INITIAL.
        CREATE OBJECT gr_ccontainer_0200
              EXPORTING
    *    PARENT                      =
                container_name              = 'CUSTOM_CONTAINER'
                repid                       = sy-repid
                dynnr                       = '0200'
              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 gr_alvgrid_0200
          EXPORTING
            i_parent          = gr_ccontainer_0200
          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.
        PERFORM prepare_field_catalog_0200 CHANGING gt_fieldcat .
    *  PERFORM prepare_layout CHANGING gs_layout .
        PERFORM prepare_sort CHANGING gt_sort.
        CALL METHOD gr_alvgrid_0200->set_table_for_first_display
          EXPORTING
    *      I_BUFFER_ACTIVE               =
    *      I_BYPASSING_BUFFER            =
    *      I_CONSISTENCY_CHECK           =
    *      I_STRUCTURE_NAME              =
    *      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               =
    *      IR_SALV_ADAPTER               =
          CHANGING
            it_outtab                     = i_breakup
            it_fieldcatalog               = gt_fieldcat
          it_sort                       = gt_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.
      ELSE.
        CALL METHOD gr_alvgrid_0200->refresh_table_display
          EXPORTING
            is_stable      = gs_stbl
    *        i_soft_refresh = 'X'
          EXCEPTIONS
            finished       = 1
            OTHERS         = 2.
        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.
    *  SET SCREEN 100.
    ENDMODULE.                 " create_alv_0200  OUTPUT
    *&      Form  prepare_field_catalog_0200
    *       text
    *      <--P_GT_FIELDCAT  text
    FORM prepare_field_catalog_0200  CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA: ls_fcat TYPE lvc_s_fcat.
      CLEAR: pt_fieldcat, gs_layout.
      ls_fcat-fieldname = 'BUKRS' .
      ls_fcat-ref_field = 'BUKRS'.
      ls_fcat-inttype = 'c' .
      ls_fcat-outputlen = '5' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Co' .
      ls_fcat-seltext = 'Company Code'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'BLART' .
      ls_fcat-ref_field = 'BLART'.
      ls_fcat-inttype = 'c' .
      ls_fcat-outputlen = '5' .
      ls_fcat-ref_table = 'BKPF'.
      ls_fcat-coltext = 'Doc Typ' .
      ls_fcat-seltext = 'Document Type'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'BELNR' .
      ls_fcat-ref_field = 'BELNR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '12' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Doc Num' .
      ls_fcat-seltext = 'Document Number'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'BUDAT' .
      ls_fcat-ref_field = 'BUDAT'.
      ls_fcat-inttype = 'DATS' .
      ls_fcat-outputlen = '13' .
      ls_fcat-ref_table = 'BKPF'.
      ls_fcat-coltext = 'G/L Date' .
      ls_fcat-seltext = 'G/L Posting Date'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'UMSKZ' .
      ls_fcat-ref_field = 'UMSKZ'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '5' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'G/L Indicator' .
      ls_fcat-seltext = 'Special G/L Indicator'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'REBZG' .
      ls_fcat-ref_field = 'REBZG'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '13' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Reference' .
      ls_fcat-seltext = 'Invoice Number'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'LIFNR' .
      ls_fcat-ref_field = 'LIFNR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '13' .
      ls_fcat-ref_table = 'LFA1'.
      ls_fcat-coltext = 'Vendor/Customer' .
      ls_fcat-seltext = 'Vendor/Customer Number'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'NAME1' .
      ls_fcat-ref_field = 'NAME1'.
      ls_fcat-inttype = 'C' .
      ls_fcat-outputlen = '50' .
      ls_fcat-ref_table = 'LFA1'.
      ls_fcat-coltext = 'Description' .
      ls_fcat-seltext = 'Description'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'DMBTR' .
      ls_fcat-ref_field = 'DMBTR'.
      ls_fcat-inttype = 'NUMC' .
      ls_fcat-outputlen = '25' .
      ls_fcat-ref_table = 'BSEG'.
      ls_fcat-coltext = 'Amount' .
      ls_fcat-seltext = 'Amount'.
      ls_fcat-no_sign = 'X'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ENDFORM.                    " prepare_field_catalog_0200
    *&      Form  handle_print_top_of_page
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM handle_print_top_of_page .
      WRITE: sy-uline.
      WRITE: /(255)'Tecnimont ICB' CENTERED.
      WRITE: /(255)'Trial Balance' CENTERED.
      WRITE: 'Trial Balance for ', l_bukrs, ':  From Period - ', l_date-low, 'To Period - ', l_date-high. "LEFT-JUSTIFIED .
      WRITE: /.
      WRITE: / sy-uline.
      FORMAT COLOR 1.
      WRITE: sy-vline, AT 2(59)'Account Code and Name'CENTERED, AT 60 sy-vline, AT 61(45) 'Opening Balance' CENTERED, AT 107 sy-vline, AT 108(41) 'Transactions' CENTERED , AT 150 sy-vline, AT 155(41) 'Closing Balance' CENTERED,  AT 197 sy-vline.
      FORMAT COLOR 4.
      WRITE: sy-vline,'GL Account'LEFT-JUSTIFIED, AT 16(50)'Description'CENTERED, AT 60 sy-vline, AT 61(23) 'Debits'CENTERED, AT 85(23) 'Credits.'CENTERED, AT 107 sy-vline, AT 108(23) 'Debits'CENTERED, AT 128(23)'Credits'CENTERED, AT 150 sy-vline, AT 151(23)
      'Debits'CENTERED, AT 174(23) 'Credits'CENTERED, AT 197 sy-vline.
      FORMAT COLOR OFF.
    *  WRITE: sy-uline.
    ENDFORM.                    " handle_print_top_of_page
    *&      Form  handle_subtotal_text
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM handle_subtotal_text USING es_subtottxt_info TYPE lvc_s_stxt
                                   ep_subtot_line TYPE REF TO data
                                   e_event_data TYPE REF TO
                                   cl_alv_event_data.
      DATA l_bank LIKE wa_bank.
      FIELD-SYMBOLS: <fs1> STRUCTURE wa_bank DEFAULT l_bank,
                   <fs2>.
      IF es_subtottxt_info-criteria = 'TXT50'.
        ASSIGN ep_subtot_line->* TO <fs1>.
        ASSIGN e_event_data->m_data->* TO <fs2>.
        CONCATENATE es_subtottxt_info-keyword 'Grand Summary: '
                     INTO <fs2>.
      ENDIF.
    ENDFORM.                    " handle_subtotal_text
    This  is the Code............... this code creates a Grid and not list and hotspot event wors on grid and not on list.
    Regards,
    Tarun Bahal

  • Event handling in oops alv

    hi experts,
    event double click.
    when double click  on vbeln it should go to va03 transaction . how would i do that in oops alv.

    hai,
    you can go through code below .
    *& Report  Z_CLARIFY                                                   *
    REPORT  Z_CLARIFY                               .
    DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: L_VALID TYPE C,
          V_FLAG,
          V_DATA_CHANGE,
          V_ROW TYPE LVC_S_ROW,
          V_COLUMN TYPE LVC_S_COL,
          V_ROW_NUM TYPE LVC_S_ROID.
    DATA: IT_ROW_NO TYPE LVC_T_ROID,
          X_ROW_NO TYPE LVC_S_ROID.
    DATA:BEGIN OF  ITAB OCCURS 0,
         VBELN LIKE LIKP-VBELN,
         POSNR LIKE LIPS-POSNR,
         CELLCOLOR TYPE LVC_T_SCOL, "required for color
         DROP(10),
         END OF ITAB.
    *The Below Definitions Must.....
    DATA:
    Reference to document
           DG_DYNDOC_ID       TYPE REF TO CL_DD_DOCUMENT,
    Reference to split container
           DG_SPLITTER          TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
    Reference to grid container
           DG_PARENT_GRID     TYPE REF TO CL_GUI_CONTAINER,
    Reference to html container
           DG_HTML_CNTRL        TYPE REF TO CL_GUI_HTML_VIEWER,
    Reference to html container
           DG_PARENT_HTML     TYPE REF TO CL_GUI_CONTAINER.
    "up to here
          CLASS lcl_event_handler DEFINITION
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION .
        METHODS:
    **Hot spot Handler
        HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
                          IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
    **Double Click Handler
        HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
                                         IMPORTING E_ROW E_COLUMN ES_ROW_NO,
        TOP_OF_PAGE FOR EVENT TOP_OF_PAGE              "event handler
                             OF CL_GUI_ALV_GRID
                             IMPORTING E_DYNDOC_ID.
           END_OF_LIST FOR EVENT end_of_list              "event handler
                            OF CL_GUI_ALV_GRID
                            IMPORTING E_DYNDOC_ID.
    ENDCLASS.                    "lcl_event_handler DEFINITION
          CLASS lcl_event_handler IMPLEMENTATION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    *Handle Hotspot Click
      METHOD HANDLE_HOTSPOT_CLICK .
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW_ID.
        V_COLUMN = E_COLUMN_ID.
        V_ROW_NUM = ES_ROW_NO.
       MESSAGE I000 WITH V_ROW 'clicked'.
        CLEAR IT_ROW_NO[].
        X_ROW_NO-ROW_ID = V_ROW.
        APPEND X_ROW_NO TO IT_ROW_NO .
        CALL METHOD G_GRID->SET_SELECTED_ROWS
          EXPORTING
            IT_ROW_NO = IT_ROW_NO.
      ENDMETHOD.                    "lcl_event_handler
    *Handle Double Click
      METHOD  HANDLE_DOUBLE_CLICK.
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW.
        V_COLUMN = E_COLUMN.
        V_ROW_NUM = ES_ROW_NO.
        IF E_COLUMN = 'VBELN'.
          SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
          CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
        ENDIF.
        IF E_COLUMN = 'POSNR'.
          SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
          CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN."
        ENDIF.
      ENDMETHOD.                    "handle_double_click
    METHOD END_OF_LIST.                   "implementation
    Top-of-page event
       PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
    ENDMETHOD.                            "top_of_page
        METHOD TOP_OF_PAGE.                   "implementation
    Top-of-page event
        PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
      ENDMETHOD.                            "top_of_page
    ENDCLASS.                    "LCL_EVENT_HANDLER IMPLEMENTATION
    *&             Global Definitions
    DATA:      G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
    "Container1
                G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
    DATA: OK_CODE LIKE SY-UCOMM,
          SAVE_OK LIKE SY-UCOMM,
          G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST',
          GS_LAYOUT TYPE LVC_S_LAYO.
    data: v_lines type i.
    data: v_line(3) type c.
    *- Fieldcatalog for First and second Report
    DATA: IT_FIELDCAT  TYPE  LVC_T_FCAT,
          X_FIELDCAT TYPE LVC_S_FCAT,
          LS_VARI  TYPE DISVARIANT.
                   START-OF_SELECTION
    START-OF-SELECTION.
      SELECT VBELN
             POSNR
             FROM LIPS
             UP TO 20 ROWS
             INTO CORRESPONDING FIELDS OF TABLE ITAB.
    describe table itab lines v_lines.
    END-OF-SELECTION.
      IF NOT ITAB[] IS INITIAL.
        CALL SCREEN 100.
      ELSE.
       MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
      ENDIF.
    *&      Form  CREATE_AND_INIT_ALV
          text
    FORM CREATE_AND_INIT_ALV .
      DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
      "attention.....from here
      "split your container here...into two parts
      "create the container
      CREATE OBJECT G_CUSTOM_CONTAINER
               EXPORTING CONTAINER_NAME = 'SCR100_CUST'.
      "this is for top of page
    Create TOP-Document
      CREATE OBJECT DG_DYNDOC_ID
                       EXPORTING STYLE = 'ALV_GRID'.
    Create Splitter for custom_container
      CREATE OBJECT DG_SPLITTER
                 EXPORTING PARENT  = G_CUSTOM_CONTAINER
                           ROWS    = 2
                           COLUMNS = 1.
    Split the custom_container to two containers and move the reference
    to receiving containers g_parent_html and g_parent_grid
      "i am allocating the space for grid and top of page
      CALL METHOD DG_SPLITTER->GET_CONTAINER
        EXPORTING
          ROW       = 1
          COLUMN    = 1
        RECEIVING
          CONTAINER = DG_PARENT_HTML.
      CALL METHOD DG_SPLITTER->GET_CONTAINER
        EXPORTING
          ROW       = 2
          COLUMN    = 1
        RECEIVING
          CONTAINER = DG_PARENT_GRID.
    CALL METHOD DG_SPLITTER->GET_CONTAINER
       EXPORTING
         ROW       = 2
         COLUMN    = 1
       RECEIVING
         CONTAINER = DG_PARENT_HTML.
    CALL METHOD DG_SPLITTER->GET_CONTAINER
       EXPORTING
         ROW       = 1
         COLUMN    = 1
       RECEIVING
         CONTAINER = DG_PARENT_GRID.
      "you can set the height of it
    Set height for g_parent_html
      CALL METHOD DG_SPLITTER->SET_ROW_HEIGHT
        EXPORTING
          ID     = 1
          HEIGHT = 5.
      "from here as usual..you need to specify parent as splitter part
      "which we alloted for grid
      CREATE OBJECT G_GRID
             EXPORTING I_PARENT = DG_PARENT_GRID.
    Set a titlebar for the grid control
      CLEAR GS_LAYOUT.
      GS_LAYOUT-GRID_TITLE = TEXT-003.
      GS_LAYOUT-ZEBRA = SPACE.
      GS_LAYOUT-CWIDTH_OPT = 'X'.
      GS_LAYOUT-NO_ROWMARK = 'X'.
      GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
      CALL METHOD G_GRID->REGISTER_EDIT_EVENT
        EXPORTING
          I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
      CREATE OBJECT G_HANDLER.
      SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
      SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
    SET HANDLER G_HANDLER->END_OF_LIST FOR G_GRID.
      SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.
      DATA: LS_CELLCOLOR TYPE LVC_S_SCOL. "required for color
      DATA: L_INDEX TYPE SY-TABIX.
      "Here i am changing the color of line 1,5,10...
      "so you can change the color of font conditionally
      LOOP AT ITAB.
        L_INDEX = SY-TABIX.
        IF L_INDEX = 1 OR L_INDEX = 5 OR L_INDEX = 10.
          LS_CELLCOLOR-FNAME = 'VBELN'.
          LS_CELLCOLOR-COLOR-COL = '6'.
          LS_CELLCOLOR-COLOR-INT = '0'.
          LS_CELLCOLOR-COLOR-INV = '1'.
          APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
          MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
          LS_CELLCOLOR-FNAME = 'POSNR'.
          LS_CELLCOLOR-COLOR-COL = '6'.
          LS_CELLCOLOR-COLOR-INT = '0'.
          LS_CELLCOLOR-COLOR-INV = '1'.
          APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
          MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
        ENDIF.
      ENDLOOP.
    setting focus for created grid control
      CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
        EXPORTING
          CONTROL = G_GRID.
    Build fieldcat and set editable for date and reason code
    edit enabled. Assign a handle for the dropdown listbox.
      PERFORM BUILD_FIELDCAT.
      PERFORM  SET_DRDN_TABLE.
    Optionally restrict generic functions to 'change only'.
      (The user shall not be able to add new lines).
      PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
    **Vaiant to save the layout
      LS_VARI-REPORT      = SY-REPID.
      LS_VARI-HANDLE      = SPACE.
      LS_VARI-LOG_GROUP   = SPACE.
      LS_VARI-USERNAME    = SPACE.
      LS_VARI-VARIANT     = SPACE.
      LS_VARI-TEXT        = SPACE.
      LS_VARI-DEPENDVARS  = SPACE.
    **Calling the Method for ALV output
      CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
          IS_VARIANT           = LS_VARI
          IS_LAYOUT            = GS_LAYOUT
          I_SAVE               = 'A'
        CHANGING
          IT_FIELDCATALOG      = IT_FIELDCAT
          IT_OUTTAB            = ITAB[].
      "do these..{
    Initializing document
      CALL METHOD DG_DYNDOC_ID->INITIALIZE_DOCUMENT.
    Processing events
      CALL METHOD G_GRID->LIST_PROCESSING_EVENTS
        EXPORTING
          I_EVENT_NAME = 'TOP_OF_PAGE'
          I_DYNDOC_ID  = DG_DYNDOC_ID.
      "end }
    Set editable cells to ready for input initially
      CALL METHOD G_GRID->SET_READY_FOR_INPUT
        EXPORTING
          I_READY_FOR_INPUT = 1.
    ENDFORM.                               "CREATE_AND_INIT_ALV
    *&      Form  EXCLUDE_TB_FUNCTIONS
          text
         -->PT_EXCLUDE text
    FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
    Only allow to change data not to create new entries (exclude
    generic functions).
      DATA LS_EXCLUDE TYPE UI_FUNC.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  build_fieldcat
          Fieldcatalog
    FORM BUILD_FIELDCAT .
      DATA: L_POS TYPE I.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
      X_FIELDCAT-FIELDNAME = 'VBELN'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-NO_ZERO    = 'X'.
      X_FIELDCAT-OUTPUTLEN = '10'.
      X_FIELDCAT-HOTSPOT = 'X'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Item'(025).
      X_FIELDCAT-FIELDNAME = 'POSNR'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '5'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Drop'(025).
      X_FIELDCAT-FIELDNAME = 'DROP'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '5'.
      X_FIELDCAT-EDIT = 'X'.
      X_FIELDCAT-DRDN_HNDL = '1'.
      X_FIELDCAT-DRDN_ALIAS = 'X'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
    ENDFORM.                    " build_fieldcat
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      IF G_CUSTOM_CONTAINER IS INITIAL.
    **Initializing the grid and calling the fm to Display the O/P
        PERFORM CREATE_AND_INIT_ALV.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    there are many such examples
    goto->se38->type bcalv* and press f4, u can see many examples.
    Reward points if helpful.
    Thanks and regards
    Swetha Singh.

  • Changing color of a field after changing the data using OOPS ALV.

    Hi Experts,
    I have displayed three fields (price, no. of products and total amount) in my ALV grid using OOPS.
    Then am changing the data in either price or no. of products fields. When I click ENTER key the value in total amount changes correspondingly. Am able to achieve till this point.
    Now I have to change the color of the three fields( price, products and total amount) of the affected row alone and not the entire set of rows in the output grid.
    Please provide suggestions.
    Thanks in advance.

    Hi,
    You have to use Layout and Output data in your OO ALV. The below code is using FM you can replicate it in OO ALV
    types: begin of t_data,
             flg(3) type c,
             sty    type lvc_t_styl,
             col    type lvc_t_scol,
           end of t_data,
           t_tdata type table of t_data.
    constants: c_red type i value '255',
              c_g   type i value '1'.
    DATA: i_fcat type LVC_T_FCAT,
          s_fcat type lvc_s_fcat,
          s_lay  type lvc_s_layo,
          s_sty  type lvc_s_styl,
          s_col  type lvc_s_scol,
          i_data type t_tdata,
          s_data type t_data.
    s_lay-stylefname = 'STY'.
    s_lay-CTAB_FNAME = 'COL'.
    s_fcat-FIELDNAME = 'FLG'.
    APPEND s_fcat to i_fcat.
    CLEAR: s_data.
    s_data-flg = 'Yes'.
    s_sty-FIELDNAME = 'FLG'.
    s_sty-style = CL_GUI_ALV_GRID=>MC_STYLE_HOTSPOT.
    insert s_sty into TABLE s_data-sty.
    s_col-fname = 'FLG'.
    s_col-color-col = 6.
    s_col-color-inv = 1.
    insert s_col into table s_data-col.
    APPEND s_data to i_data.
    CLEAR: s_data.
    s_data-flg = 'No'.
    s_sty-FIELDNAME = 'FLG'.
    s_sty-style = CL_GUI_ALV_GRID=>MC_STYLE_HOTSPOT_NO.
    insert s_sty into TABLE s_data-sty.
    APPEND s_data to i_data.
    CLEAR: s_data.
    s_data-flg = 'No'.
    s_sty-FIELDNAME = 'FLG'.
    s_sty-style = CL_GUI_ALV_GRID=>MC_STYLE_HOTSPOT_NO.
    s_col-fname = 'FLG'.
    s_col-color-col = 6.
    insert s_col into table s_data-col.
    insert s_sty into TABLE s_data-sty.
    APPEND s_data to i_data.
    CLEAR: s_data.
    s_data-flg = 'Yes'.
    s_sty-FIELDNAME = 'FLG'.
    s_sty-style = CL_GUI_ALV_GRID=>MC_STYLE_HOTSPOT.
    insert s_sty into TABLE s_data-sty.
    APPEND s_data to i_data.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
       IS_LAYOUT_LVC                     = s_lay
       IT_FIELDCAT_LVC                   = i_fcat
      TABLES
        T_OUTTAB                          = i_data
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF SY-SUBRC <> 0.
    ENDIF.
    Thanks,
    Kiruba

  • How to find function code for buttons on toolbar in oops alv

    Hi experts,
    I want to remove some buttons from toolbar in oops alv, i know the procedure like get function code and pass the value in a table and pass that table to IT_TOOLBAR_EXCLUDING of
    method set_table_for_first_display but I WANT TO KNOW HOW TO FIND FUNCTION CODE FOR BUTTONS ON TOOLBAR IN OOPS ALV

    Hi Prakash,
    -->First you have to set the pf status in your alv program by,
    {FORM pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'FIRST'.
    ENDFORM.                    "PF_STATUS}
    -->Pass this Subroutine name in the Function module, Reuse_alv_grid_display's parameters i.e,
          i_callback_pf_status_set          = 'PF_STATUS'}
    *-->Then doble click on that pf status,
    From the menu bar, select Extras->Adjust Template->List Viewer,
    This will give you the existing statndard gui status of the program*
    ->Then catch that function codes in the User command Parameter of the Function module Reuse.. i.e,
          i_callback_user_command           = 'COMM'
    And make a subroutine of the name 'COMM'i.e,
    FORM comm USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
      DATA: okcode TYPE sy-ucomm.
      okcode = ucomm.
      CASE okcode.
        WHEN 'REF'.
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel         = 'MANSI'
            txt1          = 'CREATED BY'
            txt2          = SY-UNAME
          TXT3          = ' '
          TXT4          = ' '
    endcase.
    Hope it helps you
    Regrds
    Mansi

  • Problem in raising the event DATA_CHANGED in OOP ALV

    Hi experts,
    I am currently having trouble in raising the event 'data_changed' in my OOP ALV . The event is triggered everytime I make changes to my editable cells but when it comes to clicking on the save button, it only calls 'data_changed_finished' and bypasses 'data_changed'.
    I need to call 'data_changed' before the data is saved to do some verification.
    My code is shown below.
    CALL METHOD gr_alvgrid->register_edit_event
         EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    *--functions
        CALL METHOD gr_alvgrid->set_table_for_first_display
        EXPORTING
        is_variant           = s_variant
        i_save               = 'A'
        i_default            = gc_true
        is_layout            = gs_layout
        it_toolbar_excluding = gt_exclude
        CHANGING
        it_outtab            = gt_list
        it_fieldcatalog      = gt_fieldcat
        EXCEPTIONS
        invalid_parameter_combination = 1
        program_error = 2
        too_many_lines = 3
        OTHERS = 4 .
        IF sy-subrc <> 0.
    "raise message
        ENDIF.
    CREATE OBJECT gr_event.
    SET HANDLER gr_event->handle_data_changed FOR gr_alvgrid.
    SET HANDLER gr_event->handle_data_changed_finished FOR gr_alvgrid.
    CALL METHOD gr_alvgrid->set_toolbar_interactive.
    CALL METHOD gr_alvgrid->set_ready_for_input
                  EXPORTING i_ready_for_input = 1.
    In my PAI
    CASE ok_code.
        WHEN 'SAVE'.
    *--->this calls the event 'data_changed_finished' and bypasses  'data_changed'.*                                                     
    *Check if there's data changed.
          CALL METHOD gr_alvgrid->check_changed_data
            IMPORTING
              e_valid = l_valid.
      ENDCASE.
    I checked the sap sample program BCALV_EDIT_04 and I don't see any difference except for register_edit_event but I don't think that I can leave this out in my code . Is there any points i'm missing here?
    Thanks,
    Patrick

    Hi, Spin
    do like below,
    DATA: gr_alvgrid TYPE REF TO cl_gui_alv_grid,
          cc_alv TYPE REF TO cl_gui_custom_container.
    IF cc_alv IS INITIAL. " USE This Condition
      CREATE OBJECT cc_alv
        EXPORTING
          container_name = 'CC_ALV'.
      CREATE OBJECT gr_alvgrid
        EXPORTING
          i_parent = cc_alv.
      CALL METHOD gr_alvgrid->set_table_for_first_display
        EXPORTING
          is_variant                    = s_variant
          i_save                        = 'A'
          i_default                     = gc_true
          is_layout                     = gs_layout
          it_toolbar_excluding          = gt_exclude
        CHANGING
          it_outtab                     = gt_list
          it_fieldcatalog               = gt_fieldcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc = 0.
        "raise message
      ENDIF.
    ENDIF.
    Please reply if any Issue,
    Thanks and Regard,
    Faisal

  • How to distinguish the field on which event is triggered? (ABAP Web Dynpro)

    I have an application where there are multiple input fields in the layout. After the user clicks search help for the input field and selects a value, some action has to be performed for each input field. Currently, I am coding the required action in "WDDOMODIFYVIEW" method. This method will be called whenever there is any action on any input field (as its name says), but how can I distinguish on which input field the method is triggered? or How can I know on which field the search help has been triggered?
    or I would be happy to implement any other solution if available.

    HI Deepak Dakshinadi  ,
    You can implement OVS in your input field.
    In the event ON_OVS you will get the value of the attribute  OVS_CONTEXT_ATTRIBUTE which can give you the id of the input field in which OVS is implemented.
    I think by using this you can distinguished among your input field and based on which you can do your particular coding.
    Check the link for implementing OVS.
    http://wiki.sdn.sap.com/wiki/display/WDABAP/ABAPWDObjectValueSelector(OVS)
    and check the forum to get the id of the field of that particular search help triggered.
    Re: More than 1 OVS in 1 View

Maybe you are looking for