How the Object Oriented Concepts can be used in ALV

Hi guys,
Please tell me, how the Object Oriented Concepts are used in ALV? I request if someone can illustrate it by an example.
Thnx
Sid

Hi,
Check this example.
REPORT  ZTEST_ALV_OO    MESSAGE-ID ZZ                           .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID,  "First
      G_GRID1 TYPE REF TO CL_GUI_ALV_GRID. "Second
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: OK_CODE LIKE SY-UCOMM,
      SAVE_OK LIKE SY-UCOMM,
      G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST', "First Container
      G_CONTAINER2 TYPE SCRFNAME VALUE 'TEST1',"Second container
      GS_LAYOUT TYPE LVC_S_LAYO.
DATA:BEGIN OF  ITAB OCCURS 0,
     VBELN LIKE LIKP-VBELN,
     POSNR LIKE LIPS-POSNR,
     LFDAT like lips-vfdat,
     BOX(1),
     HANDLE_STYLE TYPE LVC_T_STYL,
     END OF ITAB.
*       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,
**Handler to Check the Data Change
    HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
                         OF CL_GUI_ALV_GRID
                         IMPORTING ER_DATA_CHANGED
                                   E_ONF4
                                   E_ONF4_BEFORE
                                   E_ONF4_AFTER,
**Double Click Handler
    HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
                                     IMPORTING E_ROW E_COLUMN ES_ROW_NO.
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'.
  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'.
      MESSAGE I000 WITH 'Click on POSNR row number '  E_ROW.
      "with this row num you can get the data
    ENDIF.
  ENDMETHOD.                    "handle_double_click
**Handle Data Change
  METHOD HANDLE_DATA_CHANGED.
  data:stable type LVC_S_STBL.
  stable-row = 'X'.
  stable-col = 'X'.
call method g_grid->refresh_table_display
  EXPORTING
    IS_STABLE      =  stable
  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.
  ENDMETHOD.                    "HANDLE_DATA_CHANGED
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
            G_CUSTOM_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER. "Container2
*- 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.
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.
"First Grid
  CREATE OBJECT G_CUSTOM_CONTAINER
         EXPORTING CONTAINER_NAME = G_CONTAINER1.
  CREATE OBJECT G_GRID
         EXPORTING I_PARENT = G_CUSTOM_CONTAINER.
"Second Grid
  CREATE OBJECT G_CUSTOM_CONTAINER1
         EXPORTING CONTAINER_NAME = G_CONTAINER2.
  CREATE OBJECT G_GRID1
         EXPORTING I_PARENT = G_CUSTOM_CONTAINER1.
* 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-BOX_FNAME = 'BOX'.
  GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
  GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
  CALL METHOD G_GRID->REGISTER_EDIT_EVENT
    EXPORTING
      I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
  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->HANDLE_DATA_CHANGED FOR G_GRID.
data: ls_outatb like line of itab,
      v_index type sy-tabix.
DATA: LS_EDIT TYPE LVC_S_STYL,
        LT_EDIT TYPE LVC_T_STYL.
LOOP AT ITAB INTO ls_outatb WHERE POSNR = '000010'.
    V_INDEX = SY-TABIX.
    LS_EDIT-FIELDNAME = 'VBELN'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 8.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    INSERT LINES OF LT_EDIT INTO TABLE ls_outatb-handle_style.
    MODIFY ITAB INDEX V_INDEX FROM ls_outatb  TRANSPORTING
                                      HANDLE_STYLE.
  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.
* 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.
  CALL METHOD G_GRID->REGISTER_EDIT_EVENT
    EXPORTING
      I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
**Calling the Method for ALV output for First Grid
  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[].
**Calling the Method for ALV output for Second Grid
   CALL METHOD G_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
*    EXPORTING
*      IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
    CHANGING
      IT_FIELDCATALOG      = IT_FIELDCAT
      IT_OUTTAB            = ITAB[].
* 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 = 'ITAB'.
  X_FIELDCAT-COL_POS    = L_POS.
  X_FIELDCAT-NO_ZERO    = 'X'.
  X_FIELDCAT-EDIT      = 'X'.
  X_FIELDCAT-OUTPUTLEN = '10'.
  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 = 'ITAB'.
  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 = 'Del Date'(015).
  X_FIELDCAT-FIELDNAME = 'LFDAT'.
  X_FIELDCAT-TABNAME = 'ITAB'.
  X_FIELDCAT-COL_POS    = L_POS.
  X_FIELDCAT-OUTPUTLEN = '10'.
  APPEND X_FIELDCAT TO IT_FIELDCAT.
  CLEAR X_FIELDCAT.
  L_POS = L_POS + 1.
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
Regards
vijay

Similar Messages

  • Notes on using Object  oriented concept in ABAP

    Hi ,
    I want somes notes on how to use Object  oriented concept in ABAP.
    Thanks in advance.
    Chetan

    Hi, this may help you
    OOPs ABAP uses Classes and Interfaces which uses Methods and events.
    If you have Java skills it is advantage for you.
    There are Local classes as well as Global Classes.
    Local classes we can work in SE38 straight away.
    But mostly it is better to use the Global classes.
    Global Classes or Interfaces are to be created in SE24.
    SAP already given some predefined classes and Interfaces.
    This OOPS concepts very useful for writing BADI's also.
    So first create a class in SE 24.
    Define attributes, Methods for that class.
    Define parameters for that Method.
    You can define event handlers also to handle the messages.
    After creation in each method write the code.
    Methods are similar to ABAP PERFORM -FORM statements.
    After the creation of CLass and methods come to SE38 and create the program.
    In the program create a object type ref to that class and with the help of that Object call the methods of that Class and display the data.
    Example:
    REPORT sapmz_hf_alv_grid .
    Type pool for icons - used in the toolbar
    TYPE-POOLS: icon.
    TABLES: zsflight.
    To allow the declaration of o_event_receiver before the
    lcl_event_receiver class is defined, decale it as deferred in the
    start of the program
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    G L O B A L I N T E R N A L T A B L E S
    *DATA: gi_sflight TYPE STANDARD TABLE OF sflight.
    To include a traffic light and/or color a line the structure of the
    table must include fields for the traffic light and/or the color
    TYPES: BEGIN OF st_sflight.
    INCLUDE STRUCTURE zsflight.
    Field for traffic light
    TYPES: traffic_light TYPE c.
    Field for line color
    types: line_color(4) type c.
    TYPES: END OF st_sflight.
    TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.
    DATA: gi_sflight TYPE tt_sflight.
    G L O B A L D A T A
    DATA: ok_code LIKE sy-ucomm,
    Work area for internal table
    g_wa_sflight TYPE st_sflight,
    ALV control: Layout structure
    gs_layout TYPE lvc_s_layo.
    Declare reference variables to the ALV grid and the container
    DATA:
    go_grid TYPE REF TO cl_gui_alv_grid,
    go_custom_container TYPE REF TO cl_gui_custom_container,
    o_event_receiver TYPE REF TO lcl_event_receiver.
    DATA:
    Work area for screen 200
    g_screen200 LIKE zsflight.
    Data for storing information about selected rows in the grid
    DATA:
    Internal table
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    C L A S S E S
    CLASS lcl_event_receiver DEFINITION.
    PUBLIC SECTION.
    METHODS:
    handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
    IMPORTING
    e_object e_interactive,
    handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
    IMPORTING e_ucomm.
    ENDCLASS.
    CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
    METHOD handle_toolbar.
    Event handler method for event toolbar.
    CONSTANTS:
    Constants for button type
    c_button_normal TYPE i VALUE 0,
    c_menu_and_default_button TYPE i VALUE 1,
    c_menu TYPE i VALUE 2,
    c_separator TYPE i VALUE 3,
    c_radio_button TYPE i VALUE 4,
    c_checkbox TYPE i VALUE 5,
    c_menu_entry TYPE i VALUE 6.
    DATA:
    ls_toolbar TYPE stb_button.
    Append seperator to the normal toolbar
    CLEAR ls_toolbar.
    MOVE c_separator TO ls_toolbar-butn_type..
    APPEND ls_toolbar TO e_object->mt_toolbar.
    Append a new button that to the toolbar. Use E_OBJECT of
    event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.
    This class has one attribute MT_TOOLBAR which is of table type
    TTB_BUTTON. The structure is STB_BUTTON
    CLEAR ls_toolbar.
    MOVE 'CHANGE' TO ls_toolbar-function.
    MOVE icon_change TO ls_toolbar-icon.
    MOVE 'Change flight' TO ls_toolbar-quickinfo.
    MOVE 'Change' TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.
    APPEND ls_toolbar TO e_object->mt_toolbar.
    ENDMETHOD.
    METHOD handle_user_command.
    Handle own functions defined in the toolbar
    CASE e_ucomm.
    WHEN 'CHANGE'.
    PERFORM change_flight.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMETHOD.
    ENDCLASS.
    S T A R T - O F - S E L E C T I O N.
    START-OF-SELECTION.
    SET SCREEN '100'.
    *& Module USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
    CASE ok_code.
    WHEN 'EXIT'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module STATUS_0100 OUTPUT
    MODULE status_0100 OUTPUT.
    DATA:
    For parameter IS_VARIANT that is sued to set up options for storing
    the grid layout as a variant in method set_table_for_first_display
    l_layout TYPE disvariant,
    Utillity field
    l_lines TYPE i.
    After returning from screen 200 the line that was selected before
    going to screen 200, should be selected again. The table gi_index_rows
    was the output table from the GET_SELECTED_ROWS method in form
    CHANGE_FLIGHT
    DESCRIBE TABLE gi_index_rows LINES l_lines.
    IF l_lines > 0.
    CALL METHOD go_grid->set_selected_rows
    EXPORTING
    it_index_rows = gi_index_rows.
    CALL METHOD cl_gui_cfw=>flush.
    REFRESH gi_index_rows.
    ENDIF.
    Read data and create objects
    IF go_custom_container IS INITIAL.
    Read data from datbase table
    PERFORM get_data.
    Create objects for container and ALV grid
    CREATE OBJECT go_custom_container
    EXPORTING container_name = 'ALV_CONTAINER'.
    CREATE OBJECT go_grid
    EXPORTING
    i_parent = go_custom_container.
    Create object for event_receiver class
    and set handlers
    CREATE OBJECT o_event_receiver.
    SET HANDLER o_event_receiver->handle_user_command FOR go_grid.
    SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.
    Layout (Variant) for ALV grid
    l_layout-report = sy-repid. "Layout fo report
    Setup the grid layout using a variable of structure lvc_s_layo
    Set grid title
    gs_layout-grid_title = 'Flights'.
    Selection mode - Single row without buttons
    (This is the default mode
    gs_layout-sel_mode = 'B'.
    Name of the exception field (Traffic light field) and the color
    field + set the exception and color field of the table
    gs_layout-excp_fname = 'TRAFFIC_LIGHT'.
    gs_layout-info_fname = 'LINE_COLOR'.
    LOOP AT gi_sflight INTO g_wa_sflight.
    IF g_wa_sflight-paymentsum < 100000.
    Value of traffic light field
    g_wa_sflight-traffic_light = '1'.
    Value of color field:
    C = Color, 6=Color 1=Intesified on, 0: Inverse display off
    g_wa_sflight-line_color = 'C610'.
    ELSEIF g_wa_sflight-paymentsum => 100000 AND
    g_wa_sflight-paymentsum < 1000000.
    g_wa_sflight-traffic_light = '2'.
    ELSE.
    g_wa_sflight-traffic_light = '3'.
    ENDIF.
    MODIFY gi_sflight FROM g_wa_sflight.
    ENDLOOP.
    Grid setup for first display
    CALL METHOD go_grid->set_table_for_first_display
    EXPORTING i_structure_name = 'SFLIGHT'
    is_variant = l_layout
    i_save = 'A'
    is_layout = gs_layout
    CHANGING it_outtab = gi_sflight.
    *-- End of grid setup -
    Raise event toolbar to show the modified toolbar
    CALL METHOD go_grid->set_toolbar_interactive.
    Set focus to the grid. This is not necessary in this
    example as there is only one control on the screen
    CALL METHOD cl_gui_control=>set_focus EXPORTING control = go_grid.
    ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0200 INPUT
    MODULE user_command_0200 INPUT.
    CASE ok_code.
    WHEN 'EXIT200'.
    LEAVE TO SCREEN 100.
    WHEN'SAVE'.
    PERFORM save_changes.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0200 INPUT
    *& Form get_data
    FORM get_data.
    Read data from table SFLIGHT
    SELECT *
    FROM zsflight
    INTO TABLE gi_sflight.
    ENDFORM. " load_data_into_grid
    *& Form change_flight
    Reads the contents of the selected row in the grid, ans transfers
    the data to screen 200, where it can be changed and saved.
    FORM change_flight.
    DATA:l_lines TYPE i.
    REFRESH gi_index_rows.
    CLEAR g_selected_row.
    Read index of selected rows
    CALL METHOD go_grid->get_selected_rows
    IMPORTING
    et_index_rows = gi_index_rows.
    Check if any row are selected at all. If not
    table gi_index_rows will be empty
    DESCRIBE TABLE gi_index_rows LINES l_lines.
    IF l_lines = 0.
    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
    EXPORTING
    textline1 = 'You must choose a line'.
    EXIT.
    ENDIF.
    Read indexes of selected rows. In this example only one
    row can be selected as we are using gs_layout-sel_mode = 'B',
    so it is only ncessary to read the first entry in
    table gi_index_rows
    LOOP AT gi_index_rows INTO g_selected_row.
    IF sy-tabix = 1.
    READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
    ENDIF.
    ENDLOOP.
    Transfer data from the selected row to screenm 200 and show
    screen 200
    CLEAR g_screen200.
    MOVE-CORRESPONDING g_wa_sflight TO g_screen200.
    LEAVE TO SCREEN '200'.
    ENDFORM. " change_flight
    *& Form save_changes
    Changes made in screen 200 are written to the datbase table
    zsflight, and to the grid table gi_sflight, and the grid is
    updated with method refresh_table_display to display the changes
    FORM save_changes.
    DATA: l_traffic_light TYPE c.
    Update traffic light field
    Update database table
    MODIFY zsflight FROM g_screen200.
    Update grid table , traffic light field and color field.
    Note that it is necessary to use structure g_wa_sflight
    for the update, as the screen structure does not have a
    traffic light field
    MOVE-CORRESPONDING g_screen200 TO g_wa_sflight.
    IF g_wa_sflight-paymentsum < 100000.
    g_wa_sflight-traffic_light = '1'.
    C = Color, 6=Color 1=Intesified on, 0: Inverse display off
    g_wa_sflight-line_color = 'C610'.
    ELSEIF g_wa_sflight-paymentsum => 100000 AND
    g_wa_sflight-paymentsum < 1000000.
    g_wa_sflight-traffic_light = '2'.
    clear g_wa_sflight-line_color.
    ELSE.
    g_wa_sflight-traffic_light = '3'.
    clear g_wa_sflight-line_color.
    ENDIF.
    MODIFY gi_sflight INDEX g_selected_row-index FROM g_wa_sflight.
    Refresh grid
    CALL METHOD go_grid->refresh_table_display.
    CALL METHOD cl_gui_cfw=>flush.
    LEAVE TO SCREEN '100'.
    ENDFORM. " save_changes
    chk this blog
    /people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid
    Reward if helpfull.
    Regards Madhu.

  • I have an iCloud backup notice on my screen.  If I hit the OK button nothing happens.  How can I get rid of the notice so I can continue using my iPad?

    I have an iCloud backup notice on my screen.  If I hit the OK button nothing happens.  How can I get rid of the notice so I can continue using my iPad?

    I found answer in right column.  Thanks.

  • HT1212 It says could not connect to the ipod because it is locked with a passcode. You must enter our passcode on the ipod before it can be used with Itunes. I forgot the passcode so how can I enter/ restore/reset it?

    It says could not connect to the ipod because it is locked with a passcode. You must enter our passcode on the ipod before it can be used with Itunes. I forgot the passcode so how can I enter/ restore/reset it?

    As the linked articl says, place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                          
    If recovery mode does not work try DFU mode.                         
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings         
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up      
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store         

  • Updated to IOS 6 has downloaded the US App Store and ITunes and replaced the UK one so can't use it how do I switch but to the UK store?

    Updated to IOS 6 on IPad 2 and it has downloaded the US App Store and ITunes and replaced the UK one so can't use it how do I switch but to the UK store?

    Worked out the solution had to log out and then back in

  • TS3694 how do i restore my iphone3, got error 3014, seems that the update/restore only can be used from iphone3g and new'er

    how do i restore my iphone3, got error 3014, seems that the update/restore only can be used from iphone3g and new'er

    Go to to your Users/Home/Library/Application Support/iWeb folder in the Finder and then enter  Time Machine.  Go back to the last backup that has the domain file, select it and use the Restore button.
    OT

  • HT1212 iTunes could not connect to the iPhone "Rasmus's iPhone" because it is locked with a passcode. You must enter your passcode on the iPhone before it can be used with iTunes. - How do I do this?

    iTunes could not connect to the iPhone “Rasmus's iPhone” because it is locked with a passcode. You must enter your passcode on the iPhone before it can be used with iTunes. - Why is that?

    iTunes is asking you to provide the passcode that was created when the device was activated.
    You are able to get around the passcode if you know the apple id login and password and are able to restore the device back to default settings.
    See this article for further directions:
    http://support.apple.com/kb/HT1212
    good luck.

  • Object oriented Concept

    Hi all, I feel confuse on object oriented.
    Basic, I get change to developer some online form. I use java bean , Servlet, JSTL and Mysql. In my java bean I only have the attribute set and get pattern. I just wonder I put my delete , search and update action on Servlet , not in the java bean , is that means that Is not object oriented enough? How to improve it ?
    thank you!

    Thank you for the reply, I did use some of the Spring in my Project, but only limit in flower control , such as simple spring + acegi , a lot of control still in servlet. I also try some other new stuff like display tag , but that only work on if your jsp page is out of the WEB-INF. I also go through some tutorials on JSF , but not time to figure out how JSF work with acegi yet.
    1 mention the display tag and JSF just try to explain, I looking for a new framework. But don?t want the whole framework to tire me up. For example in simple servlet I can use ? /WEB-INF/ + target to send my flower to any JSP page depend on the link that I click , but I don?t how to handle it spring. May be I did not get the real concept of spring yet. I looking for some framework that allow me to use new technology , but still allow me to use some old technology , like servlet then I can finish my project on time.
    But what is the relation between web framework and object oriented concept??

  • Help with object oriented concepts

    I am a senior highschool student and although I know Java syntax, I learned with Pascal and other procedural languages so I have a difficult time thinking in OOP concepts (which I will have to learn for college classes). So for practice I went to my college's website and found an assignment on the intro course to programming: [Here are the assignment instructions.|http://www.cs.gsu.edu/knguyen/teaching/2009/spring/csc2010/proj.pdf]
    My question is, how can I make my program illustrate more object oriented concepts?
    Links:
    ode-help.110mb.com/javaproject.java_

    Just a few comments (not necessarily about OO and in no particular order):
    It's probably not worth it to make constants for the letter A or the plus sign. Make constants for values people would not understand:
    // Ok
    public static final int ANSWER_TO_THE_UNIVERSE = 42;'
    // Probably overkill
    public static final int FORTY_TWO = 42;
    Good job on having DecimalFormat as a regular instance variable rather than static (since it is not thread-safe)
    Good job initializing your object in a consistent state (via the ctor). Now, make as many variables final as you can. Immutable objects are good:[www.javapractices.com/topic/TopicAction.do?Id=29]
    Not sure why you declared repeat() to return the boxed version of boolean, just use a primitive
    You have a run() method but are not implementing Runnable. Not that it is required, but usually when I see run(), I think of threading
    This is a matter of style, but you don't need to name the arguments in the ctor differently than the instance variables that get assigned. You can very easily say:
    // Note that it is final.  Make things immutable when you can.
    private final String bar;
    public Foo(final String bar) {
       // Note:  I don't need a different name here.  This is purely a matter of personal style.
       this.bar = bar;
    Consider a while loop in run() rather than a do-loop. What happens if you get no input the first time around?
    Java naming conventions dictate that classes start with a capital letter. Generally, an underscore is not used, camel-case is. So, your class should be JavaProject.
    Consider making an object for the arguments that are passed into input. Maybe call it GradeCategory, or whatever.
    That new object GradeCategory can have the output() method.
    For method names, also follow conventions using camel case. So get_double should be getDouble().
    Consider reworking such that you use an array or a collection of GradeCategory. You might want to then have an add method in your JavaProject. The add method should ensure the total weight of grades does not exceed 100%.
    You can rework the output method of JavaProject to iterate over your GradeCategory objects, calling their own output() methods. Perhaps it also first checks that the weight of all grades equals 100%.Just a few thoughts.
    - Saish

  • Object oriented concepts

    Hi Gurus,
    I want to know thw difference between objectoriented program and abap general programme?
    thanks in advance

    Hi Rama Krishna ,
    Object Orientation
    A programming technique in which solutions reflect real world objects
    What are objects ?
    An object is an instantiation of a class. E.g. If “Animal” is a class, A cat
    can be an object of that class .
    With respect to code, Object refers to a set of services ( methods /
    attributes ) and can contain data
    What are classes ?
    A class defines the properties of an object. A class can be instantiated
    as many number of times
    Advantages of Object Orientated approach
    Easier to understand when the system is complex
    Easy to make changes
    Encapsulation - Can restrict the visibility of the data ( Restrict the access to the data )
    Polymorphism - Identically named methods behave differently in different classes
    Inheritance - You can use an existing class to define a new class
    Polymorphism and inheritance lead to code reuse
    Classes in abap
    Classes in ABAP are either local or global
    Global classes are declared in class builder (SE24 )
    Local classes are declared within programs
    Components of a class
    Attributes : Internal data fields of class
    Attributes can be either instance attributes – specific to each instance of the class ( object ) or static attributes which are common to all instances
    Methods :
    Subroutines / procedures in a class that define the behavior of the object. Methods can also be instance methods or static methods
    Encapsulation in ABAP
    Encapsulation is obtained through the restriction in visibility of attributes / methods attained through the definition of Public, Private and Protected section of a class
    Public Section
    All of the components declared in the public section are accessible to all users of the class, and to the methods of the class and any classes that inherit from it. The public components of the class form the interface between the class and its users.
    Protected Section
    All of the components declared in the protected section are accessible to all methods of the class and of classes that inherit from it.
    Private Section
    Components that you declare in the private section are only visible in the methods of the same class.
    Inheritance in ABAP
    Inheritance allows you to derive a class based on an already existing class.
    CLASS <subclass> DEFINITION INHERITING FROM <superclass>.
    ENDCLASS.
    CLASS <subclass> IMPLEMENTATION.
    ENDCLASS.
    All attributes / methods of super class become the property of the subclass too. Only public and protected attributes / methods are visible in the subclass
    Polymorphism in ABAP
    When methods with same name perform differently under different
    circumstances we call it polymorphism.
    Methods redefined in a subclass is an example for Polymorphism
    Interfaces
    Interfaces are used to define the model of a class.
    They also like classes can be either local or global.
    Global interfaces are defined through SE24 and local interfaces are defined in program.
    Please check this online document (starting page 1291).
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
    Also check this links as well.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.futureobjects.de/content/intro_oo_e.html
    http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm
    /people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
    check the below links lot of info and examples r there
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.geocities.com/victorav15/sapr3/abap_ood.html
    http://www.brabandt.de/html/abap_oo.html
    Check this cool weblog:
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    /people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
    Hope this resolves your query.
    Reward all the helpful answers.
    Thanks & Regards
    Bhaskar rao.M

  • Is polymorphism a bad design for object oriented concept?

    i think polymorphism is bad concept for object oriented concept..having the same name with different parameter function ..according to my opinion may constitue in efficient skill in programming..instead if using the same name why we cannot use different name...for example each human being will have have unique characterstics..(i.e each persons DNA would be different..)so why can't we have different function names.. even if u choose a username to create a new account it would not support same names..i think it is confusing .. i think this concept is lessly used in modern programming usage... as it has less usage i think the future language designs should not support polymorphism..
    i just want to know ur opnions..

    Is it just me or did Sun fuck up the posting screens?I didn't notice anything; care to enlighten me?800-pixels-wide window and still a vertical scrollbar, but, to make up for
    that, 250 pixels of unused whitespace to the left. And the search text
    field is still unnamed.I agree with that rediculously wide left margin, i.e. rearranging some of
    those things would allow for a better screen estate usage. But didn't Sun
    already give us that crap in a previous incarnation of their mannah?
    Besides that, I still don't notice any difference ...
    kind regards,
    Jos (<--- call me a silly ignoramus)

  • Need documents of ABAP Object Oriented concepts

    Hi,
    I  need materials on ABAP Object Oriented Concepts to learn.
    If you have any good documents which covers all the topics of ABAP OO then please send me to [email protected]
    Thanks in advance.
    Regards,
    Chandru

    Chandra,
    Very good sites with docs.
    http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    Pls. reward if useful...

  • URGENT How may no of queries can be used a datsources in APD

    hi
    could any one pls let me know how many no of queries can be used at once as datsource to load in to transactional ODS in APD CONCEPT
    Regards,
    N

    You can do one (or more) join in the APD which will let you merge data from two previous nodes. This should allow you to get data from two or more queries (as long as you have a logical join condition to connect the data).
    There is nothing like a union though.

  • How many lines we can print using Non-alv report list ?

    Hi Experts,
    How many lines we can print using Non-alv report list ?
    regards
    vishnu

    Hi,
    It depends on the page size according to the page size we can set the no. of lines as follows,
    REPORT  program_name   NO STANDARD PAGE HEADING
    LINE-SIZE 290
    LINE-COUNT 65.
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

  • How big of a hardrive can i use in my gigabit ethernet g4 dual 500.

    Hi there.
    I wanted to now how big of a hard drive can i use in my gigabit ethernet g4 powerpc with a dual 500 processor . at the present time i have one 80 and one 20 gig drive in there now.
    So my answer is how big of a drive can i use before i have problems with seting it up. Like i want to use a 500 gig drive in my computer and my old 80 gig too. i want to buy a apple tv and store my dvds on the big 500 hardrive so i have alot of room for the vidio files, for apple t.v . If i can use one as big as one terabite you now the real big one that would be fine. The more room i have the better for me. I will be able to watch the movies i downloaded from the internet and i wont have to burn them at all.
    This is of corse if apple tv will handle it.

    Hi-
    If you need that much storage, and you'll have to buy a controller anyhow, get a SATA controller card, and put one or two 500gb SATA drives in. The enterprise class of SATA drives are made especially for multi media storage, have excellent seek times and fast data transfer rates. A "bargain" on a package can be had at OWC:
    http://eshop.macsales.com/item/Other%20World%20Computing/SATAM500GPCI/
    or
    http://eshop.macsales.com/item/Other%20World%20Computing/SATAM10TBPCI/
    The MaxLine Pro drives have great characteristics, and are reviewed favorably.
    I have an OWC SATA card, and the card works perfectly, and is cheaper than other makers cards of equivalent specs.
    G4AGP(450)Sawtooth, 2ghz PowerLogix, 2gbRAM, 300gbSATA+160gb HD, ATI Radeon 9800   Mac OS X (10.4.8)   Pioneer DVR-109, LaCie 160gb, 23"Cinema Display, Ratoc USB2.0, Nikon Coolscan

Maybe you are looking for

  • In the report level user wants two persons against each work center.

    Hi Experts, Please let me know the solution, I have provided scenario below. check the query which the user is referring to report: Example Work center     Person KNE33102     44003850 According to the user, the names for the Work centers should be a

  • IPhoto will not open want me to "rebuild photo library" and restart

    When I try to open iPhoto i get this error message: "Shut down and restart your computer, and then open iPhoto again. If the problem persists, try rebuilding your photo library. To do this, quit iPhoto, and then reopen it while keeping the Option and

  • HT5567 download ios 5 to my ipad 2.......

    I have a ipad 2 with 4.3.3and want to go to ios 5.............  how

  • Lost site definition in CS5.5

    My IMac crashed and now l the Site Definitions file is lost, I have tried to do a restore from my Time Machine but I am unable to find the Site Definitions Folder I have even tried reinstalling Dreamweaver as per the instructions in the Adobe support

  • ECC 5 Database LOAD Error

    Hi GURUs, I got following error in ECC 5 @ database Load steps, Can any body help me out how to slove it, ERROR 2006-07-29 11:11:49 MSC-01015 Process finished with error(s), check log file H:\Program Files\sapinst_instdir\ECC04SR1\WEBAS_ABAP_ORA_NUC\