Java package concept in ABAP Objects

Hi, just a question on grouping of classes in ABAP Objects.
In Java, you can group classes by "package" to avoid
namespace collision, my question, in ABAP Objects, how
do you group classes to avoid namespace collision?
I know that there is package concept in SAP/ABAP but it
is different concept in Java.
Thanks in advanced for your reply.

Hello One and Lonley,
the package concept in ABAP and Java is quite different. In java the package name is part of the development object in ABAP not. So any class pool name is global unique. In combination with the restriction on 30 chars this leads often to somehow cryptic names.
The only way to escape this somehow is the excessive use of local classes. That mean classes defined within main programs. If you are on 7.00 you may check FuGr SAPLSAUNIT_TREE_CTRL_LISTENER for this technique.
Best Regards
  klaus

Similar Messages

  • Best Practice: Usage of the ABAP Packages Concept?

    Hi SDN folks,
      I've just started on a new project - I have significant ABAP development experience (15 years+) - but one thing that I have never seen used correctly is the Package concept in ABAP - for any of the projects that I have worked on.
    I would like to define some best practices - about when we should create packages - and about how they should be structured.
    My understanding of the package concept is that they allow you to bundle all of the related objects of a piece of development work together. In previous projects - and almost every project I have ever worked on - we just have packages ZBASIS, ZMM, ZSD, ZFI and so on. But this to me is a very crude usage of packages, and really it seems that we have not moved on passed the 4.6 usage of the old development class concept - and it means that packages do not really add much value.
    I read in the SAP PRESS Next Generation ABAP book (Thomas Ljung, Rich Hellman) (I only have the 1st edition) - that we should use packages for defining separation of concern for an application. So it seems there they are recommending that for each and every application we write - we define at the least 3 packages - one for Model, one for Controller and one for view based objects. It occurs to me that following this approach will lead to a tremendous number of packages over the life cycle of an implementation, which could potentially lead to confusion - and so also add little value. Is this really the best practice approach? Has anyone tried this approach across a full blown implementation?
    As we are starting a new implementation - we will be running with 7 EHP2 and I would really like to get the most out of the functionality that is provided. I wonder what others have for experience in the definition of packages.
    One possible usage occurs to me that you could define the packages as a mirror image of the application business object class hierarchy (see below). But perhaps this is overcomplicating their usage - and would lead to issues later in terms of transportation conflicts etc.:
                                          ZSD
                                            |
                    ZSOrder    ZDelivery   ZBillingDoc
    Does anyone have any good recommendations for the usage of the ABAP Package concept - from real life project experience?
    All contributions are most welcome - although please refrain from sending links on how to create packages in SE80
    Kind Regards,
    Julian

    Hi Julian,
    I have struggled with the same questions you are addressing. On a previous project we tried to model based on packages, but during the course of the project we encountered some problems that grew overtime. The main problems were:
    1. It is hard to enforce rules on package assignments
    2. With multiple developers on the project and limited time we didn't have time to review package assignment
    3. Devopelers would click away warnings that an object was already part of another project and just continue
    4. After go-live the maintenance partner didn't care.
    So, my experience is is that it is a nice feature, but only from a high level design point of view. In real life it will get messy and above all, it doesn't add much value to the development. On my neew assignment we are just working with packages based on functional area and that works just fine.
    Roy

  • Some documents to read as a starter in abap objects.

    Hi All,
    Need a help, I have read the basic concepts in ABAP objects, uptil cath try....... and event handling.
    However once this basoc reading is over, suggest me some additional links to read from, i wanna read more and learn since in my company there isnt much of exposure to object oriented concept in ABAP.

    Hello anu,
    Check out these links
    www.amazon.com/ABAP-Objects-Introduction-Programming-Applications/dp/0201750805
    www.amazon.com/ABAP-Objects-Reference-Horst-Keller/dp/1592290116
    searchsap.techtarget.com/sDefinition/0,,sid21_gci877494,00.html
    help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
    help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
    www.erpgenie.com/abap/index.htm
    en.wikipedia.org/wiki/ABAP
    www.sappressbooks.com/downloads/h958_preview.pdf
    <b>Reward points if helpful    :-)</b>
    Thanks,
    Sachin

  • ABAP Object oriented practice..

    Hi,
    I have gone through the basic concepts of ABAP object oriented programming using links provided by other sdn fellows. But this has not built thorough confidence.
    I request someone to suggest or send me some material which has some ABAP object oriented exercises along with the solutions so that I can re-do it and boost my confidence.
    Thanks.
    Regards,
    Rajesh.

    Hi Rajesh and vicky
    i have forwarded to u r mail.
    here is same link of it
    http://download.yousendit.com/0354F3845F085819
    Regards
    Message was edited by:
            santhosh reddy

  • Craete a simple abap object to select data from a table and display

    Hi,
    I know the concept of abap objects but i never worked on it,
    can any one give me simple example of how to create an abap object to display data from mara table.also please send me documents or info regd ABAP OBJECTS.
    I want to write a simple report in terms of abap object
    Regards,
    Sowjanya

    hi,
    Here is hte sample program in se38.
    REPORT ZFGLI00003
    *-- Include for data declarations and performs
    include ZFGLI00003_f01.
    *--Include for Classes and their Implementation
    include ZFGLI00003_cl.
    *                selection-screen                                      *
    *-- Selection Values : Block1
    selection-screen begin of block b1 with frame title text-001.
    *--         Ledger
    parameters: p_rldnr  like zzprodnt-rldnr default 'NP'.
    *--         Fiscal year
    parameters: p_ryear  like zzprodnt-ryear.
    *--         Period(month)
    parameters: p_rpmax  like zzprodnt-rpmax.
    selection-screen end of block b1.
    *-- Selection Values : Block2
    selection-screen begin of block b2 with frame title text-002.
    *--              Company ID's
    select-options : s_glcomp  for ZZPRODNT-ROBUKRS .
    *--              Profit Center
    select-options : s_prctr   for ZZPRODNT-RPRCTR .
    *--              Product Assignment
    select-options : s_prasn   for ZZPRODNT-RZZWWZ01 .
    *--              Corporate Brand
    select-options : s_crpbd   for ZZPRODNT-RZZWWZ05 .
    selection-screen end of block b2.
    *-- Selection Values : Block3  Download Options
    selection-screen begin of block b3 with frame title text-003.
    parameters : p_local radiobutton group 1,
                 p_unix  radiobutton group 1,
                 p_path  like rlgrap-filename obligatory
                         default 'C:P20Z_Formatted.txt'(009).
    selection-screen end of block b3.
    *            At Selection-Selection on value-request  for file path    *
    at selection-screen on value-request for p_path.
      if p_unix <> 'X'.
    *-- Getting F4 help for output file
        perform get_filename changing p_path.
      else.
        message i999(zi) with
              'Sorry !! Function not available for UNIX file.'(i01).
      endif.
    *-- At selection screen validations
    at selection-screen on p_path.
      if p_unix <> 'X'.
    *-- Validate local file
        if p_path+1(2) <> ':'.
          message e999(zi) with 'Invalid file path'(006).
        endif.
      else.
    *-- Validate unix file
        if p_path+0(1) <> '/'.
          message e999(zi) with 'Invalid file path'(006).
        endif.
      endif.
    *                   Initialization                                    *
    initialization.
    *-- Initialize the period
      perform init_period changing p_rpmax p_ryear.
    *                    start-of-selection                               *
    start-of-selection.
      data : o_tm1_intf type ref to lcl_tm1_intf.
      create object o_tm1_intf.
    *-- Extract the data from ZZPRODNT
      call method o_tm1_intf->get_data exporting e_rldnr  = p_rldnr
                                                 e_ryear  = p_ryear
                                                 e_rpmax  = p_rpmax
                                                 e_glcomp = s_glcomp[]
                                                 e_prctr  = s_prctr[]
                                                 e_prasn  = s_prasn[]
                                                 e_crpbd  = s_crpbd[]
                                       importing i_subrc  = v_subrc.
    *   INCLUDE ZFGLI00003_CL                                              *
    *       CLASS lcl_tm1_intf IMPLEMENTATION
    class lcl_tm1_intf definition.
      public section.
    *-- Data Declaration
        data  : lv_date     type sy-datum,       "Date
                lv_time     type sy-uzeit,       "Time
                lv_count    type i,              "Count for total records
                lv_acsline  type zfgl014-acsline,"ACS line code
                lv_amt_curr type zzprodnt-kslvt, "current month amount
                lv_amt_ytd  type zzprodnt-kslvt, "YTD Amount
                lv_check,                        "check if any record is
                                                 "downloaded
                lv_msg(100),                     "message
                lv_count_s(5)  ,                 "Count for total(char)
                lv_amt_curr_s(23),               "Current month amount(char)
                lv_amt_ytd_s(23),                "YTD Amount(char)
                lv_ksl_pd(17),                   "KSLxx
                lv_period(2) type n.             "month(period)
    *-- Types Declaration
        types : ty_rldnr type zzprodnt-rldnr,    "Type for Ledger
                ty_ryear type zzprodnt-ryear,    "Type for Fiscal Year
                ty_rpmax type zzprodnt-rpmax,    "Type for Period
                ty_glcomp type range of char4,   "Type for company selection
                ty_prctr type range of char10,   "Type for profit center sel
                ty_prasn type range of char6,    "Type for prod assignmt sel
                ty_crpbd type range of char4,    "Type for Corp Brand sel
                begin of ty_file,                "Type for File
                  line(150),
                end of ty_file,
                begin of ty_ZZPRODNT,            "Type-ledger summary table
                  company       type OBUKR,      "Company
                  gl_acct       type RACCT,      "GL Account
                  cst_ctr       type KOSTL,      "Cost Center
                  prt_ctr       type PRCTR,      "Profit Center
                  rfarea        type FKBER,      "Functional Area
                  wbs_ele       type PS_POSID,   "WBS Element
                  prd_***       type RKEG_WWZ01, "Product Assignment
                  corp_bd       type RKEG_WWZ05, "Corporate Brand
                  ksl01         type KSLXX9,     "Total of transactions - 01
                  ksl02         type KSLXX9,     "Total of transactions - 02
                  ksl03         type KSLXX9,     "Total of transactions - 03
                  ksl04         type KSLXX9,     "Total of transactions - 04
                  ksl05         type KSLXX9,     "Total of transactions - 05
                  ksl06         type KSLXX9,     "Total of transactions - 06
                  ksl07         type KSLXX9,     "Total of transactions - 07
                  ksl08         type KSLXX9,     "Total of transactions - 08
                  ksl09         type KSLXX9,     "Total of transactions - 09
                  ksl10         type KSLXX9,     "Total of transactions - 10
                  ksl11         type KSLXX9,     "Total of transactions - 11
                  ksl12         type KSLXX9,     "Total of transactions - 12
                  ksl13         type KSLXX9,     "Total of transactions - 13
                  ksl14         type KSLXX9,     "Total of transactions - 14
                  ksl15         type KSLXX9,     "Total of transactions - 15
                  ksl16         type KSLXX9,     "Total of transactions - 16
                end of ty_ZZPRODNT.
    *-- Structure Declaration
    *           Structure for final file
        data  : x_file         type ty_file,
    *           Structure for Product Ledger Summary table
                x_ZZPRODNT     type ty_ZZPRODNT,
    *           Structure for Functional Area to ACS line mapping
                x_zfgl014      type zfgl014.
    *-- Internal Table Declaration
    *           Table for records of Product Ledger Summary table
        data  : it_ZZPRODNT     type table of ty_ZZPRODNT,
    *           Table for final file
                it_file         type table of ty_file,
    *           Table for Functional Area to ACS line mapping
                it_zfgl014      type table of zfgl014.
    *-- Method Declaration.
        methods : get_data      importing e_rldnr  type ty_rldnr
                                          e_ryear  type ty_ryear
                                          e_rpmax  type ty_rpmax
                                          e_glcomp type ty_glcomp
                                          e_prctr  type ty_prctr
                                          e_prasn  type ty_prasn
                                          e_crpbd  type ty_crpbd
                                exporting i_subrc type sy-subrc.
    endclass.                    "lcl_tm1_intf DEFINITION
    *       CLASS lcl_tm1_intf IMPLEMENTATION
    class lcl_tm1_intf implementation.
    *-- Method get_data selects the North American Product Ledger Summary
    *   table data and then maps the Functional Area to ACS line to get
    *   the ACS line code
      method get_data.
    *-- Local Variable
        DATA: L_ZZPRODNT TYPE TY_ZZPRODNT.
    *-- Get the data from North American Product Ledger Summary table
        select robukrs
               racct
               rcntr
               rprctr
               rfarea
               rzzwbs_el
               rzzwwz01
               rzzwwz05
               ksl01
               ksl02
               ksl03
               ksl04
               ksl05
               ksl06
               ksl07
               ksl08
               ksl09
               ksl10
               ksl11
               ksl12
               ksl13
               ksl14
               ksl15
               ksl16
          from zzprodnt
          into table it_ZZPRODNT
         where rldnr    = e_rldnr
           and ryear    = e_ryear
           and rpmax    = e_rpmax
           and ROBUKRS  in e_glcomp
           and RPRCTR   in e_prctr
           and RZZWWZ01 in e_prasn
           and RZZWWZ05 in e_crpbd.
        if sy-subrc = 0.
          loop at it_ZZPRODNT into l_zzprodnt.
            condense l_ZZPRODNT-rfarea no-gaps.
            if l_ZZPRODNT-rfarea is initial.
              delete it_ZZPRODNT.
            endif.
          endloop.
    *-- Get the Functional Area to ACS line code mapping data
          select *
            from zfgl014
            into table it_zfgl014
             for all entries in it_ZZPRODNT
           where fkber = it_ZZPRODNT-rfarea .
          if sy-subrc = 0.
          endif.
        endif.
        i_subrc = sy-subrc.
      endmethod.                    "get_data
    endclass.                    "lcl_tm1_intf IMPLEMENTATION
    *   INCLUDE ZFGLI00003_F01                                             *
    *                             Table
    tables : zzprodnt.
    *                          Data Declaration
    data : v_subrc type sy-subrc.
    *&      Form  get_filename
    *  Description : This subroutine is used for F4 Prompting
    form get_filename changing p_path like rlgrap-filename.
    *-- Local variables
      data : lv_file  like ibipparms-path, "Local file for upload/download
             lv_repid like syst-cprog,     "ABAP program, caller in external
                                           "procedures
             lv_dynnr type syst-dynnr.     "Current screen No
      lv_repid = syst-cprog.
      lv_dynnr = syst-dynnr.
    *-- Function module used for F4 help
      call function 'F4_FILENAME'
           exporting
                program_name  = lv_repid
                dynpro_number = lv_dynnr
           importing
                file_name     = lv_file.
      move lv_file to p_path.
    endform.                    " get_filename
    *&      Form  init_period
    FORM init_period changing p_rpmax p_ryear.
      if sy-datum+4(2) = 01.
        p_rpmax = 12.
        p_ryear = sy-datum+0(4) - 1.
      else.
        p_rpmax = sy-datum+4(2) - 1.
        p_ryear = sy-datum+0(4).
      endif.
    ENDFORM.                    " init_period
    Hope this helps.
    Regards,
    Richa

  • 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.

  • Abap objects,java,xslt

    could u provide with links of abap,java and xslt mapping and also corresponding basic links using which i can master the  basics of abap objects ,java and xslt up to the extent what is required for mapping
    thanks

    Chexk these docs,
    <b>ABAP</b>
    https://websmp101.sap-ag.de/~sapdownload/011000358700003082332004E/HowToABAPMapping.pdf
    The how to guide on ABAP mapping should help.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
    <b>JAVA</b>
    /people/prasad.ulagappan2/blog/2005/06/08/sax-parser
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    Regards,
    Jai Shankar

  • 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...

  • Give me some examples of syntax of object oriented concept in abap

    pls let me know

    Go to ABAPDOCU transaction.
    On the left hand side, you should open the node ABAP Objects .
    YOu can find lots of examples.
    for concepts go thru this link:
    http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm

  • Changes to ABAP Objects via Notes/Packages

    Hi,
    Is there perhaps a mechanism where one can check all notes/packages that have impacted an ABAP object?
    Thanks in advance.
    Regards,
    Kennedy.

    Hello Kennedy
    If a SAP Note would consist exclusively out of customizing then you have no direct impact on any ABAP "objects".
    Otherwise you will always affect repository objects.
    You may define a filter of object types (R3TR ....) which you regard as impact on your ABAP objects. Using this filter you can check the contents of a note or EnhPackage(?).
    Regards
      Uwe

  • Material for Object Oriented Concepts in ABAP

    Hi,
          Please provide me the material for Object Oriented Concepts in ABAP.

    Hi
    Please check this link, may be helpful
    http://www.sap-img.com/ab029.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5654f411d194a60000e8353423/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    regards
    Srinivas

  • Calling inactive version of ABAP object from Java

    Hello,
    When I call an ABAP object from Java Program which version of ABAP object is called inactive or active ?
    Is there a mechanism to call the current inactive version or any other previous inactive /active versions ?
    Regards,
    Tarun

    Only the "active" version of ABAP code is active and runnable.
    You cannot run inactive versions. Like you have to compile a .java file to a .class file o make it runnable in the JVM.

  • Convert JAVA Web Dynpro to ABAP Web Dynpro application

    Hi,
    I was hoping someone could tell me if there is a way to port a JAVA Web Dynpro application to ABAP Web Dynpro. We have some JAVA WD apps that would now make more sense to have running on our ABAP system so we would like to convert them to ABAP WD apps.
    I know the theory is that WD is metadata/XML based so it should be possible to port the WD definition to ABAP and have the ABAP runtime generate the application again in ABAP. I expect that any custom code that is written in JAVA would need to be manually rewritten in ABAP - but it would be great if there was tool or method to at least port the majority of the application.
    Thanks in advance for your help,
    Simon

    Hi Simon
    You are correct in thinking that all WD apps are based on metadata, but unfortunately, the similarity between WD Java and WD ABAP is just a conceptual one, and no such tool exists to convert one to the other.
    In addition to this, there are certain implementation differences between ABAP and Java that mean you could not convert one to the other.  For instance, the whole concept of model objects does not exist in WD ABAP. Therefore, structural entities used in WD Java such as model components could not be tranlsated into anything that exists in ABAP, because the concept is redundant in the target language.
    Sorry about that, but Java and ABAP are sufficiently different beasts that such a tool is not possible.
    Regards
    Chris W

  • Creat transaction (se93) for Globa class in ABAP Objects

    Hi experts,
           Can any one tell me how to
    creat transaction (se93) for Globa class(se24)  in ABAP Objects
    if ,please assest me how to do it or send me example docu on this
    best Answer will be rewarded
    regards
    fareedas

    hi
    se93->give your transaction ->enter create.
    check the radio button (Method of calss(OO class).press enter.
    in next screen.
    transaction text ;give your own description
    tick the check box OO transaction model.
    give the class name method name which u have created in se 24.which was activated successfully.it should be activated otherwise it will not work.
    under GUI SUPPORT.
    TICK the all 3 check boxes.
    SAP GUI  FOR HTML
                            JAVA
                           WINDOWS.
    then save.
    u should b saved in package(don't forget).
    it was working.
    i have already checked and did it succesfully.
    reward points
    if u have any queries let me know.
    kiran jagana

  • ABAP Objects Design/Organization Issues

    Hi,
    I'm trying to design and implement reusable components using ABAP Objects. I'm familliar with OO concepts and have developed a few applications using C++ and Java.
    I'm trying to organize my classes into separate source files (include program in ABAP).
    ie.
    <b>include program a</b>
    CLASS a DEFINITION.
    ENDCLASS.
    <b>include program b</b>
    INCLUDE a.
    CLASS b DEFINITION.
    data x TYPE REF TO a.
    ENDCLASS.
    Lets say I want to write a report that uses both objects a and b. That means I have to include both programs. but since program b includes program a. including both programs a and b in my report would produce redeclarations of class a.
    <b>executable program c</b>
    REPORT c.
    INCLUDE a.
    INCLUDE b.   " error: redeclaration of class a
    DATA: x TYPE REF TO a.
          y TYPE REF TO b.
    This bothers me. Although it would be possible to <b>just include program b</b>, it would be a bit awkward since, i dont care if class a was used in the implementation of class b. Implementation should be abstracted from the user. Besides, everything should be explicit.
    Is there a way to organize things as such? Would importing these classes globally would solve the problem.
    Thanks.

    Emir,
    The way we do OO Programming in ABAP and other languages differ.
    In your case, it might be a better option to create these classes as global classes, so that you will not have this issue. You can SE24 to do the same.
    Regards,
    Ravi

Maybe you are looking for

  • Mac mini and photoshop elements 4

    hello, i'm using a mac mini intel solo with photoshop elements 4 and it is unbearable!!! has anybody else here experienced extremely slow reactions with this set up? i think it may just be a memory issue, i have the standard 512mb and the page outs g

  • Can all QuickTime cache files be safely deleted?

    I'm getting really short of hard disk space on my 12-inch Power Book G4, and I noticed that nearly 4 GB of space is occupied by QuickTime download cache files in my user library. I don't know of any Application that I can use to identify all these fi

  • Idoc to File(AS2)

    Hi, I am workingon IDOC to File(AS2) scenario. When i execute the mapping in IR it executes succesfully and gives the data in the specified File format. but when i test the interface, i am getting the output file in IDOC format where in  it has to be

  • Can ipod as a storage device connect to pc and mac

    If I have a mac formatted ipod classic and I want to use it as a hard drive, can I connect it to a pc and mac (to transfer files) without having to reformat?

  • New features and changes in 2007 B

    Hi All, What are the new features and changes(IDs, Objects, New objects in 2007 B ?