Urgent!!  abap objects

Hi,
I am having problems executing this program using events. I think it is a simple problem but am not able to solve it.
REPORT  Z_KMADHUR_PROGRAM5.
class declarations.
class pilot definition.
public section.
methods: call_flight_attendant.
EVENTS: call_button_presses.
endclass.
class passenger definition.
public section.
methods: constructor importing value(i_seatnumber) type i,
         service_number importing value(i_servicenumber) type i,
         service_type importing value(i_servicetype) type i,
         call_for_help.
EVENTS: call_button_pressed exporting value(e_seatnumber) type i,
        call_service_number exporting value(e_servicenumber) type i,
        call_service_type exporting value(e_servicetype) type i.
PROTECTED SECTION.
data seatnumber type i.
data servicenumber type i.
data servicetype type i.
endclass.
class flight_attendant DEFINITION.
PUBLIC SECTION.
METHODS: constructor
         importing i_id type string,
         help_the_pilot for EVENT
         call_button_presses OF pilot,
         help_a_passenger FOR EVENT
         call_button_pressed OF passenger
         IMPORTING e_seatnumber,
         give_service_number for event
         call_service_number of passenger
         IMPORTING e_servicenumber,
         give_service_type for event
         call_service_type of passenger
         IMPORTING e_servicetype.
         PROTECTED SECTION.
DATA id TYPE string.
ENDCLASS.
class Implementations
class pilot implementation.
method call_flight_attendant.
RAISE EVENT call_button_presses.
ENDMETHOD.
ENDCLASS.
         class passenger implementation.
         method: constructor.
         seatnumber = i_seatnumber.
         servicenumber = servicenumber.
         servicetype = servicetype.
         endmethod.
         method: call_for_help.
         RAISE EVENT call_button_pressed
EXPORTING e_seatnumber = seatnumber.
RAISE EVENT call_service_number
exporting e_servicenumber = servicenumber.
RAISE EVENT call_service_type
exporting e_servicetype = servicetype.
      endmethod.
      endclass.
class flight_attendant implementation.
method: constructor.
id = i_id.
endmethod.
method: help_the_pilot.
write: / id, 'helps pilot'.
endmethod.
method: help_a_passenger.
write: / id, 'helps passenger on seat',e_seatnumber.
endmethod.
method: give_service_number.
write: 'to have', e_servicenumber.
endmethod.
method: give_service_type.
write: e_servicetype.
endmethod.
endclass.
global data
DATA: o_pilot type ref to pilot,
      o_passenger_1 type ref to passenger,
      o_passenger_2 type ref to passenger,
      o_passenger_3 type ref to passenger,
      o_passenger_4 type ref to passenger,
      o_passenger_5 type ref to passenger.
DATA: o_purser type ref to flight_attendant,
      o_stewardess type REF to flight_attendant,
classical processing blocks
      start-of-selection.
      create object o_pilot.
      create object o_passenger_1 exporting i_seatnumber = 11.
      create object o_passenger_2 exporting i_seatnumber = 17.
      create object o_passenger_3 exporting i_seatnumber = 21.
      create object o_passenger_4 exporting i_seatnumber = 25.
      create object o_passenger_5 exporting i_seatnumber = 31.
create object: o_purser
               exporting i_id = 'purser',
               o_stewardess
               exporting i_id = 'stewardess',
set handler: o_purser->help_the_pilot for o_pilot,
             o_stewardess->help_a_passenger for all instances,
             o_stewardess->give_service_number for all instances,
             o_stewardess->give_service_type for all instances.
call method: o_pilot->call_flight_attendant,
o_passenger_1->call_for_help,
o_passenger_1->call_service_number.
I am getting an error near the start-of-selection. It says "statement is not acceptable".
If i remove the start-of-selection, it says "unable to interpret object. Incorrect spelling or coma error".
<b>My output should look like:
purser helps pilot
stewardess helps passenger on seat 11 to have 2 foodservice.
stewardess helps passenger on seat 11 to have 2 drinkservice.
stewardess helps passenger on seat 17
stewardess helps passenger on seat 17 to have 1 foodservice.
stewardess helps passenger on seat 17 to have 1 drinkservice.
stewardess helps passenger on seat 21
stewardess helps passenger on seat 21 to have 3 foodservice.
stewardess helps passenger on seat 21 to have 3 drinkservice.
stewardess helps passenger on seat 25
stewardess helps passenger on seat 25 to have 1 foodservice.
stewardess helps passenger on seat 25 to have 1 drinkservice.
stewardess helps passenger on seat 31
stewardess helps passenger on seat 31 to have 2 foodservice.
stewardess helps passenger on seat 31 to have 2 drinkservice.</b>
Thanks in advance..
cheers,
Madhuri

Hi Madhuri,
Usually such errors happen when you fail to put start-of-selection statement to demarcate the variable declaration and the object creation while dealing with local classes.
It can also happen when you fail to close the class definition or implementation using endclass statement or you fail to put a period (.) after the endclass statement..
Just check in your program for similar cases.Of if you don't mind, can you just post the final, modified source-code so that we can analyse it for errors..
Regards,
Amit.

Similar Messages

  • ALV tree without using abap objects---------urgent

    hi
    can anybody send  me code for making alv tree without using ABAP objects.
    thanks in advance
    Aditya

    HI
    goto this link
    you will get all ALV TREE programs
    follow that code you can understand very easily
    http://www.sapdev.co.uk/reporting/alv/alvtree.htm
    <b>Reward if usefull</b>

  • Logical Database in Abap Objects

    Hi to All
    I want do it a program report using a Logical Database.
    Is this possible ??? But when I make a GET <node>, occurs the following error:
             "" Statement "ENDMETHOD" missing.  ""
    I'm doing the following:
    CLASS MONFIN IMPLEMENTATION.
           METHOD TRAER_DATOS.
                   GET VBRK.
           ENDMETHOD.
    ENDCLASS.
    Please, somebody tell me how I use the logical database in Abap Objects.
    Thank you very much
    Regards
    Dario R.

    Hi there
    Logical databases whilst of "some use" are not really part of OO.
    If you want to use a logical database in an abap OO program I would create a special class which just does the get data from your DB and pass this either at record or table level.
    Techniques such as GET XXXX LATE aren't really part of any OO type of application since at Object Instantiation time you should be able to access ALL the attributes of that object.
    As far as OO is concerned Logical databases are a throwback to "Dinosaur Technology".
    Since however modules such as SD and FI are still heavily reliant on relational structures (i.e linked tables etc)  then there is still some limited life in this stuff but for OO try and solve it by another method.
    If you really must use this stuff in OO then do it via a FMOD call and save the data in a table which your method will pass back to your application program.
    You can't issue a GET command directly in a method.
    Cheers
    Jimbo

  • Adding leading zeros in abap objects.

    Can anyone explain me
    1. How to add leading zeros to a field in abap objects.
    For eg:
    data: dmb(6) type c value '123456',
    actually the output value of c should have leading zeros added to it for length 16.
    i.e '0000000000123456' . If the length of dmb is less than 16 then leading zeros should be added to that value to make it 16 as length.
    Please tell me how to do it in ABAP Objects.

    Hi Camila
    Try to use the statement
    DATA: ALPHABET(15) VALUE '     ABCDEFGHIJ',
          M1(4)        VALUE 'ABCD',
          M2(6)        VALUE 'BJJCA '.
    SHIFT ALPHABET LEFT DELETING LEADING M1.
    The field
    ALPHABET
    remains unchanged.
    SHIFT ALPHABET LEFT DELETING LEADING SPACE.
    The field ALPHABET now has the following contents:
    'ABCDEFGHIJ     '.
    SHIFT ALPHABET RIGHT DELETING TRAILING M2.
    <b>ALPHABET</b> now has the following contents:
    '      ABCDEFGHI'.
    <u><b>IN CHARACTER MODE</b></u>
    <b>Effect</b>
    This is the default setting (see above), and the addition is therefore optional.
    <b>Note
    Performance:</b>
    For performance reasons, you should avoid using SHIFT in WHILE loops.
    The runtime required to shift a field with length 10 by one character to the right or left requires about 5 msn (standardized microseconds). A cyclical shift requires around 7 msn. The runtime for the ...
    LEFT DELETING LEADING
    ... variant is around 3.5 msn, for ...
    RIGHT DELETING TRAILING
    ... around 4.5 msn.
    Reward all helpfull answers
    Regards
    Pavan

  • Significance of Interfaces in ABAP Objects

    Hi Guys, here I have a query -
    Why do we use Interfaces in ABAP Objects?, and what is the significance of Interfaces in ABAP Objects?
    Please clarify the above with a suitable example.

    Moderator message - Welcome to SCN.
    But
    Moderator message - But this isn't a training forum. Please ask a specific question - post locked

  • Exception 'error_message' in ABAP Objects

    I've got a heterogeneous scenario with new program parts in ABAP objects and older parts in classical ABAP.
    In the older parts some R/3 standard functions are called which dump dialog messages which are not allowed at that state of the program flow ('on commit').
    The simple solution in classical ABAP was to use standard exception 'error_message' in the top level 'call function' statement thus catch all dialog messages in lower levels.
    I am looking for an analog solution in object oriented ABAP. But exception 'error_message' is not allowed with 'call method'. It cannot be defined statically in the methods declaration. And the system exception caused by the dialog error message is not included in the set of catchable system errors.
    I would be grateful for any hints concerning this problem.

    Hi
    Excuse me! But I didn't want to sent you my answer.
    Anyway:
    CLASS lcl_my_class DEFINITION.
      PUBLIC SECTION.
        METHODS my_method
                  EXPORTING
                    EXCEPTION TYPE CHAR1
                  EXCEPTIONS error_messages.
    ENDCLASS.                    "LCL_MY_CLASS DEFINITION
    CLASS lcl_my_class IMPLEMENTATION.
      METHOD my_method.
        IF EXCEPTION = 'X'.
          MESSAGE e208(00) WITH 'Message error'
                      RAISING error_messages.
        ELSE.
          MESSAGE I208(00) WITH 'OK!'.
        ENDIF.
      ENDMETHOD.                    "MY_METHOD
    ENDCLASS.                    "LCL_MY_CLASS IMPLEMENTATION
    So you did want to do a call like this:
    CALL METHOD lcl_my_class=>my_method
       EXCEPTIONS
         error_messages = 1
         error_message  = 2
         OTHERS         = 3.
    No! you can't do it, but you try to insert your call in fm where you use ERROR_MESSAGE addition. I think you can do it if your methods are std.
    Max
    Message was edited by: max bianchi

  • Re : select-options in abap-objects program

    Dear friends,
                      I want to give select-options in abap-objects program. How to give that.
                                 Thanking You
    with regards,
    Mani

    In the transaction SE24, enter your class name, click modify.
    in the tab named "Types" you have to declare two types. By example, if you want to receive one select-options that in your program that uses this class is declared like:
    " P_SAKNR FOR SKAT-SAKNR".
    you've got to declare two types in the class:
    a- TYPES:  begin of E_S_SAKNR,
                          sign(1),
                          option(2),
                          low(10),
                          high(10),
                      end of E_S_SAKNR.
    b - TYPES E_T_SAKNR type standard table of E_S_SAKNR.
    so, in the class method that you want to receive P_SAKNR as importing parameter. You got to do this:
    method TEST importing ET_SAKNR type E_T_SAKNR.
    now, in the implementation of this method you should be able to use ET_SAKNR as the same way as you usually use a parameter or a select-option. You could use it in a select with the operator IN by example..

  • Re : select-options in abap objects

    Dear friends,
    I want to give select-options in abap-objects program. How to give that.
    Thanking You
    with regards,
    Mani

    HI Mani,
    It's common mix ABAP Procedural with ABAP Objects in the same program.
    You should use the same way used in ABAP procedural program as Marco Cerdelli sad.
    But inside ABAP OBJECTS classes you can't use is these statement type.
    Don't forget to close this thread and all yours previous when your question be answered ! In case of doubt read the [rules of engagement|https://forums.sdn.sap.com/].
    Best Regards.
    Marcelo Ramos

  • 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

  • Poll: Development in ABAP Objects / Webdynpro vs. classical Dynpro

    Hey there ABAP developers,
    I just want to ask if you can give me one or two minutes of your attention for two poll questions.
    At the moment I´m writing my master thesis about the development of a monitoring tool in ABAP. One of my bigger chapters is about the decision, which programming paradigm should be used for new development projects in SAP. And another important one is about WebDynpro vs. classical Dynpros.
    Because of the fact, that I can´t create any polls in here, I just started this discussion and hope for many replies .
    It would be very nice if some of you could give me an answer to the following questions (only 2 ), so that I can maybe use the result of this poll in my master thesis, if there are enough responses.
    1. What percentage of new development projects are you developing in ABAP Objects? (Not to be considered small reports that just runs for only one time)
         A. 0 %
         B. less than 25%
         C. 25% - 49%
         D. 50% - 75%
         E. more than 75%
    2. Which GUI technology do you prefer?
         A. Classical Dynpro
         B. WebDynpro
         C. Business Server Pages (BSP)
         D. others (please mention)
    I want to thank you in advance for answering the questions,
    Best regards,
    Christoph

    Hi,
    Present SAP Implementation projects are very rare, maximum projects are support and up gradations only .
    If they want Implement the  SAP  newly  , defiantly they should creating ABAP Objects.
    Why Because  ABAP Objects are Object Oriented Concepts,  so,  for  future reference and re usability..etc .
    Now Come to the First Quetion.
    if it is implementation project   ABAP Objects are   25% - 49%.
    if it is Support project ABAP Objects are   25%
    Now Come to the Second Quetion.
    Depend upon Reqmnt, but Most of the Applications are Webdynpro .  i.e 70%.
    Remaining 30% All ( BSP and GUI ....Etc..)
    This is my opinion.
    Sambaiah.Paidipelli.

  • Dynamic documents in ABAP Objects (weblog)

    Hi SDNers,
    Do you want to implement the following features in ABAP Screens?
    1. Large font sizes and more colour options than traditional ABAP/4 (There are some limitations also)
    2. ICONS and pictures in different sizes
    3. Texts
    4. Links
    5. Pushbuttons
    6. Input fields
    7. Dropdown list boxes
    8. Tables with row span and with column span
    9. Tables with frames and without frames
    10. Tables with buttons, icons, pictures, input elements and texts in it.
    Then please read the below weblog to incorporate these features...
    <a href="/people/venkata.ramisetti/blog/2005/12/20/dynamic-documents-in-abap-objects">Dynamic Documents in ABAP Objects</a>
    Thanks,
    Ramakrishna

    one limitation which comes to my mind immediately is that you cannot create spool output of the dynamic document.
    Regards
    Raja

  • Help in abap objects

    hallow
    i wont example in regular abap like select stetmet and how i do that in abap objects (the same code)and which benefit i have in using objects.
    Regards

    hi,
    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
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sap-img.com/
    http://www.sapgenie.com/
    http://help.sap.com
    For funtion module to class
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
    for classes
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
    for methods
    http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
    for inheritance
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
    for interfaces
    http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
    4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
    6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
    7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
    8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8

  • Wa in ABAP Objects

    Hello!
    How can I write wa in ABAP Objects?
    CLASS money DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA: wa TYPE zaa_sflight,
        wa1 TYPE TABLE OF wa.
        CLASS-METHODS zmoney.
    ENDCLASS.
    The program says, wa is unknown. How can I write it correct?
    Thanks!!

    Hi Andrei Algaier,
        This is because wa is not defined as datatype in datadictionary or in program with types statement.
    example:
    types : wa type c.
    data : xyz type wa.
    xyz will be of type c.
    This might be helpful.
    Regards,
    Kalyan.

  • Select-option in ABAP objects

    Hi Guys,
               I need a small help from you. I want to know how to populate the value from select-option to abap object. Please help me, it is very important

    check this code
    REPORT ZSELOPT_TO_CLASS .
    TABLES: VBRK.
    SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
    DATA: IT_VBELN TYPE RSELOPTION.
    DATA: X_VBELN TYPE RSDSSELOPT.
    CLASS C1 DEFINITION.
    PUBLIC SECTION.
    DATA: IT_VBRP TYPE VBRP_TAB,
          X_VBRP LIKE LINE OF IT_VBRP.
    METHODS: GET_DATA IMPORTING S_VBELN TYPE RSELOPTION.
    METHODS: DISP_DATA.
    ENDCLASS.
    CLASS C1 IMPLEMENTATION.
    METHOD GET_DATA.
      *SELECT * FROM VBRP*
       INTO TABLE IT_VBRP
       WHERE VBELN IN S_VBELN.
    ENDMETHOD.
    METHOD DISP_DATA.
      LOOP AT IT_VBRP INTO X_VBRP.
        WRITE:/ X_VBRP-VBELN,
                X_VBRP-POSNR.
      ENDLOOP.
    ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
    DATA OBJ TYPE REF TO ZCL_SELOPT.
    CREATE OBJECT OBJ.
    LOOP AT S_VBELN.
      MOVE S_VBELN-LOW TO X_VBELN-LOW.
      MOVE S_VBELN-HIGH TO X_VBELN-HIGH.
      MOVE S_VBELN-SIGN TO X_VBELN-SIGN.
      MOVE S_VBELN-OPTION TO X_VBELN-OPTION.
      APPEND X_VBELN TO IT_VBELN.
    ENDLOOP.
    CALL METHOD OBJ->GET_DATA
                        EXPORTING
                          S_VBELN = IT_VBELN.
    CALL METHOD OBJ->DISP_DATA.
    Edited by: moazam hai on May 17, 2008 6:17 AM
    Edited by: moazam hai on May 17, 2008 6:19 AM

  • Single click in abap objects

    hi,
        can any1 pls explain me the single click event LINK_CLICK in abap object.
    does this single click event mean that if i click anywhere on my alv report it will trigger the event.
       pls explain me about this LINK_CLICK event in details pls

    answered the similar question last week. You can see here Event
    Link_click or ALV_Object Model HYPERLINK.
    This example demonstrates how to use a Hiperlink field in ALV. These example was based on 'SALV_DEMO_TABLE_COLUMNS' that contains Hiperlink, icon, Hotspot...
    The Code is:
    REPORT zsalv_mar NO STANDARD PAGE HEADING.
          CLASS lcl_handle_events DEFINITION
    CLASS lcl_handle_events DEFINITION.
      PUBLIC SECTION.
        METHODS:
          on_link_click FOR EVENT link_click OF cl_salv_events_table
            IMPORTING row column.
    ENDCLASS.                    "lcl_handle_events DEFINITION
          CLASS lcl_handle_events IMPLEMENTATION
    CLASS lcl_handle_events IMPLEMENTATION.
      METHOD on_link_click.
        DATA: l_row_string TYPE string,
              l_col_string TYPE string,
              l_row        TYPE char128.
        WRITE row TO l_row LEFT-JUSTIFIED.
        CONCATENATE text-i02 l_row INTO l_row_string SEPARATED BY space.
        CONCATENATE text-i03 column INTO l_col_string SEPARATED BY space.
        MESSAGE i000(0k) WITH 'Single Click' l_row_string l_col_string.
      ENDMETHOD.                    "on_single_click
    ENDCLASS.                    "lcl_handle_events IMPLEMENTATION
    DATA: gr_events TYPE REF TO lcl_handle_events.
    TYPES: BEGIN OF g_type_s_outtab.
    INCLUDE TYPE alv_tab.
    TYPES:   t_hyperlink TYPE salv_t_int4_column,
           END   OF g_type_s_outtab.
    DATA: gt_outtab TYPE STANDARD TABLE OF g_type_s_outtab.
    DATA: gr_table   TYPE REF TO cl_salv_table.
    TYPES: BEGIN OF g_type_s_hyperlink,
             handle    TYPE salv_de_hyperlink_handle,
             hyperlink TYPE service_rl,
             carrid    TYPE s_carrid,
           END   OF g_type_s_hyperlink.
    DATA: gt_hyperlink TYPE STANDARD TABLE OF g_type_s_hyperlink.
    SELECTION-SCREEN BEGIN OF BLOCK gen WITH FRAME.
    PARAMETERS: p_amount TYPE i DEFAULT 30.
    SELECTION-SCREEN END OF BLOCK gen.
    START-OF-SELECTION.
      PERFORM select_data.
      PERFORM display.
    *&      Form  select_data
          text
    -->  p1        text
    <--  p2        text
    FORM select_data .
      DATA: line_outtab  TYPE g_type_s_outtab,
            ls_hype      TYPE g_type_s_hyperlink,
            lt_hyperlink TYPE salv_t_int4_column,
            ls_hyperlink TYPE salv_s_int4_column,
            v_tabix      TYPE sytabix.
      SELECT *
        FROM alv_tab
        INTO CORRESPONDING FIELDS OF TABLE gt_outtab
            UP TO p_amount ROWS.
      LOOP AT gt_outtab INTO line_outtab.
        v_tabix = sy-tabix.
        ls_hype-handle    = sy-tabix.
        ls_hype-hyperlink = line_outtab-url.
        ls_hype-carrid    = line_outtab-carrid.
        INSERT ls_hype INTO TABLE gt_hyperlink.
        ls_hyperlink-columnname = 'URL'.
        ls_hyperlink-value      = sy-tabix.
        APPEND ls_hyperlink TO lt_hyperlink.
        line_outtab-t_hyperlink = lt_hyperlink.
        MODIFY gt_outtab FROM line_outtab INDEX v_tabix.
        CLEAR line_outtab.
        CLEAR lt_hyperlink.
        CLEAR ls_hyperlink.
      ENDLOOP.
    ENDFORM.                    " select_data
    *&      Form  display
          text
    -->  p1        text
    <--  p2        text
    FORM display .
      TRY.
          cl_salv_table=>factory(
            IMPORTING
              r_salv_table = gr_table
            CHANGING
              t_table      = gt_outtab ).
        CATCH cx_salv_msg.                                  "#EC NO_HANDLER
      ENDTRY.
      DATA: lr_functions TYPE REF TO cl_salv_functions_list.
      lr_functions = gr_table->get_functions( ).
      lr_functions->set_default( abap_true ).
    *... set the columns technical
      DATA: lr_columns TYPE REF TO cl_salv_columns_table,
            lr_column  TYPE REF TO cl_salv_column_table.
      lr_columns = gr_table->get_columns( ).
      lr_columns->set_optimize( abap_true ).
    *... §4.7 set hyperlink column
      DATA: lr_hyperlinks TYPE REF TO cl_salv_hyperlinks,
            ls_hyperlink  TYPE g_type_s_hyperlink.
      DATA: lr_functional_settings TYPE REF TO cl_salv_functional_settings.
      TRY.
          lr_columns->set_hyperlink_entry_column( 'T_HYPERLINK' ).
        CATCH cx_salv_data_error.                           "#EC NO_HANDLER
      ENDTRY.
      TRY.
          lr_column ?= lr_columns->get_column( 'URL' ).
          lr_column->set_cell_type( if_salv_c_cell_type=>link ).
          lr_column->set_long_text( 'URL' ).
        CATCH cx_salv_not_found.                            "#EC NO_HANDLER
      ENDTRY.
      lr_functional_settings = gr_table->get_functional_settings( ).
      lr_hyperlinks = lr_functional_settings->get_hyperlinks( ).
      LOOP AT gt_hyperlink INTO ls_hyperlink.
        TRY.
            lr_hyperlinks->add_hyperlink(
              handle    = ls_hyperlink-handle
              hyperlink = ls_hyperlink-hyperlink ).
          CATCH cx_salv_existing.                           "#EC NO_HANDLER
        ENDTRY.
      ENDLOOP.
      DATA: lr_events TYPE REF TO cl_salv_events_table.
      lr_events = gr_table->get_event( ).
      CREATE OBJECT gr_events.
      SET HANDLER gr_events->on_link_click FOR lr_events.
      gr_table->display( ).
    ENDFORM.                    " display

  • Interactive reports in abap objects

    Hi,
           plz send me the code of  interactive report using ABAP Objects .
    Thanks,
    T.Sreekanth.

    Hi,
    It will be similar to what you do in normal report.
    Here you may create an object instance and then call some method on the object.
    AT LINE-SELECTION.
    create object obj.
    CALL METHOD obj->method1
    IMPORTING
      text = im_text.
    write: im_text.
    Regards,
    Sesh

Maybe you are looking for

  • Why can't I make a call to a macbook pro

    I try calling my daughter's macbook pro, using her email address....it says connecting, but never connects....she says it freezes on her end.  She is able to facetime with other macs okay.

  • Attachments Help Please

    I'm not sure this is a BT issue but I'm hoping some kind person will be able to help me. PDF attachments with incoming emails are all opening in Word which is 'converting' them so the documents are altered & don't look right. I'd just like to open th

  • Need guidance for ePubs for iBooks

    I'm a professional formatter and have converted files to ePubs for several years. Now some of my clients want to upload directly to iBooks with an Author account. Since I'm a PC person I don't work with MACs although I myself have an Apple account (I

  • Elements 11 Editor has stopped working!

    I have been using my Elements 11 program and suddenly the editor portion will not launch.  The organizer opens and allows me to view photos and choose one to edit but when I click on editor it doesn't open.

  • Dropdown by key problem

    Hi I am using drop down by key UI element in my WD4A application . When I run it a <b>short dump</b> occur stating that "<b>The lead selection has not been set</b>". I have created a contect in ComponentController and written following code in INIT m