ALV with ABAP objects

Hi all,
How to use ABAP objects. I have created a program in se38 and how to call this function. ehat is the function call name. What are the uses.

Hi
Please check the standard SAP Programs
Goto SE38 and give BCALV and press F4 you will get standard SAP programs for most requirements.
They use ABAP OO to develop the ALV.
Also please check these links
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
http://www.geocities.com/mpioud/Abap_programs.html
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIDOCK/BCCIDOCK.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIGOF/BCCIGOF.pdf
http://www.sapdevelopment.co.uk/reporting/alv/alvscr.htm
http://esnips.com/doc/b708766f-a934-42a1-8064-c4de75b48fc4/Sample-Program-of-alv-using-oops.ppt
http://esnips.com/doc/a2e42503-cf0f-4418-94ee-580f5900a81f/alv-with-oop.doc
http://esnips.com/doc/2d953590-e8c5-490c-a607-d1ab7cf517d7/ALV.pdf
Hope this helps

Similar Messages

  • Header In ALV with abap objects

    Hi friends,
    How can we print the header in abap Objects using class ??
    thanks,
    Prashant patil

    Create a local class:
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS: handle_top_of_page FOR EVENT print_top_of_page
                                   OF cl_gui_alv_grid.
      PRIVATE SECTION.
    ENDCLASS.
    *       CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_top_of_page.
      WRITE: / 'Header info'.  
      ENDMETHOD.
    ENDCLASS.
    Then in your main program before you <i>set_table_for_first_display</i>, make sure you register your event handler:
    DATA:  grid                   TYPE REF TO  cl_gui_alv_grid,
             event_receiver    TYPE REF TO  lcl_event_receiver.
        CREATE OBJECT grid EXPORTING i_parent = container.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_top_of_page FOR grid.

  • Advanced ALV using ABAP objects

    Hi All ABAPers,
    I have a question in Advanced ALV using ABAP objects.Can we display the output ie., ALV Grid without defining the custom cointainer?ie., just as we do in the classical ALV without defining any screens.Can we do that as a normal executable program ie., without using module pool programming.Please give me a solution.
    Thanks & Regards,
    Chaitanya.

    If you want editable grids then the cl_salv_table method won't unfortunately be of use since (currently) there's no editable facility / method.
    So if you are using cl_gui_alv_grid here's how to "get round" the problem.
    I'm essentially using my own alv class which is a reference to cl_gui_alv_grid  but the methodology shown here is quite simple.
    What you can do is to create a method which calls a function module for example ZZ_CALL_SCREEN so you only have to code a Screen and a GUI in ONE function module and not in every  ALV report.
    for example you could create something like this
    My version has the option of 2 screens - so when I double click on a cell in one grid I can  perform some actions and then display a 2nd grid before returning back to the ist grid.You can easily modify this to suit your applications.
    The parameters are fairly self evident from the code. You can just use this as a model for your own applications.
    I agree that having to code a separate screen and GUI for OO ALV GRID reports was for some people a "show stopper" in switching  from the old SLIS  to OO ALV reports.
    I Hope if any SAP development guys are reading this PLEASE PROVIDE EDITABLE FUNCTIONALITY IN THE NEW CL_SALV_TABLE class.  Thanks in advance.
    method display_data.
    call function 'ZZ_CALL_SCREEN'
      exporting
        screen_number       =  screen_number
        program             =  program
        title_text          =  title_text
       i_gridtitle         =  i_gridtitle
        i_zebra             =  i_zebra
        i_edit              =  i_edit
        i_opt               =  i_opt
        i_object            =  z_object
      changing
        e_ucomm             =  e_ucomm
        it_fldcat           =  it_fldcat
        gt_outtab           =  gt_outtab.
    e_ucomm = sy-ucomm.
    endmethod.
    function zz_call_screen .
    *"*"Local interface:
    *"  IMPORTING
    *"     REFERENCE(SCREEN_NUMBER) TYPE  SY-DYNNR
    *"     REFERENCE(PROGRAM) TYPE  SY-REPID
    *"     REFERENCE(TITLE_TEXT) TYPE  CHAR50
    *"     REFERENCE(I_GRIDTITLE) TYPE  LVC_TITLE
    *"     REFERENCE(I_ZEBRA) TYPE  LVC_ZEBRA
    *"     REFERENCE(I_EDIT) TYPE  LVC_EDIT
    *"     REFERENCE(I_OPT) TYPE  LVC_CWO
    *"     REFERENCE(I_OBJECT) TYPE REF TO  ZZHR_ALV_GRID
    *"  CHANGING
    *"     REFERENCE(E_UCOMM) TYPE  SY-UCOMM
    *"     REFERENCE(IT_FLDCAT) TYPE  LVC_T_FCAT
    *"     REFERENCE(GT_OUTTAB) TYPE  STANDARD TABLE
    assign gt_outtab to <dyn_table>.
    move title_text to screen_title.
    assign i_object to <zogzilla>.
    export <dyn_table> to memory id 'dawggs'.
    export i_gridtitle to memory id 'i_gridtitle'.
    export i_edit to memory id 'i_edit'.
    export i_zebra to memory id 'i_zebra'.
    export i_opt to memory id 'í_opt'.
    export it_fldcat to memory id 'it_fldcat'.
    case screen_number.
    when '100'.
    call screen 100.
    when '200'.
    call screen 200.
    endcase.
    endfunction.
    process before output.
    module status_0100.
    process after input.
    module user_command_0100.
    rocess before output.
    module status_0200.
    process after input.
    module user_command_0200.
    *   INCLUDE LZHR_MISCO01                                               *
    *&      Module  STATUS_0100  OUTPUT
    *       text
    module status_0100 output.
    import <dyn_table> from memory id 'dawggs'.
    import i_gridtitle from memory id 'i_gridtitle'.
    import  i_edit from memory id 'i_edit'.
    import i_opt from  memory id 'í_opt'.
    import  it_fldcat from  memory id 'it_fldcat'.
    i_object = <zogzilla>.
    call method i_object->display_grid
      exporting
        i_gridtitle = i_gridtitle
        i_edit  = i_edit
        i_zebra = i_zebra
        i_opt = i_opt
        g_fldcat = it_fldcat
        g_outtab = <dyn_table>
       changing
         it_fldcat = it_fldcat
         gt_outtab = <dyn_table>.
      set pf-status '001'.
      set titlebar '000' with screen_title.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Module  STATUS_0200  OUTPUT
    *       text
    module status_0200 output.
    import <dyn_table> from memory id 'dawggs'.
    import i_gridtitle from memory id 'i_gridtitle'.
    import  i_edit from memory id 'i_edit'.
    import i_opt from  memory id 'í_opt'.
    import  it_fldcat from  memory id 'it_fldcat'.
    i_object = <zogzilla>.
    call method i_object->display_grid
      exporting
        i_gridtitle = i_gridtitle
        i_edit  = i_edit
        i_zebra = i_zebra
        i_opt = i_opt
        g_fldcat = it_fldcat
        g_outtab = <dyn_table>
       changing
         it_fldcat = it_fldcat
         gt_outtab = <dyn_table>.
    set pf-status '001'.
      set titlebar '000' with screen_title.
    endmodule.                 " STATUS_0200  OUTPUT
    *   INCLUDE LZHR_MISCI01                                               *
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    module user_command_0100 input.
      case sy-ucomm.
        when 'BACK'.
          leave to screen 0.
        when 'EXIT'.
          leave program.
        when 'RETURN'.
          leave program.
        when others.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    *&      Module  USER_COMMAND_0200  INPUT
    *       text
    module user_command_0200 input.
    case sy-ucomm.
        when 'BACK'.
          leave to screen 0.
        when 'EXIT'.
          leave program.
        when 'RETURN'.
          leave program.
        when others.
      endcase.
    endmodule.                 " USER_COMMAND_0200  INPUT
    Cheers
    jimbo

  • What is the constant name for Change layout Button in ALV Grid ABAP Objects

    Dear All,
    I have one query please help me.
    what is the constant name for Change layout Button in ALV Grid ABAP Objects.
    With Rgds,
    Babu

    Halo Vinod,
    The consant name is cl_gui_alv_grid=>mc_fc_current_variant.
    Regards
    Arshad

  • Who has the book:Object-Oriented Programming with ABAP Objects

    Hello everyone
    Now i want to learn ABAP OO,and Lots' of guys told me that the book  Object-Oriented Programming with ABAP Objects is realy a good book.but i searched on the net,and could not got PDF of this book,could some one gave me the net address if you know where to download the book or send me to my Mailbox:<email id removed by moderator>,I will very glad to receive any response from you,
    of course,if you have some advise on how to learn ABAP OO or some other material ,hope you could share your meaning with me, hope to receive your response.
    Best regards!
    From Carl
    Moderator message : Moved to career center.
    Edited by: Vinod Kumar on Aug 27, 2011 9:21 AM

    I'm sure you're not asking for illegal, "free" downloads. You can legally purchase the book, also in electronic format, at sap-press.com
    Thomas

  • [ABAP Mapping] Only with ABAP-Objects?

    Hi,
    found <a href="http://https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383">this how-to</a> that describes an ABAP mapping in SAP XI.
    Is ABAP mapping only possible with ABAP Objects? Do I have to use
    the StreamFactory class? Is there an alternative way to do such a mapping?
    Does anyone have another example for ABAP mapping?
    Thanks
    chris

    Hi Christian,
    usually you need that only for special cases. It is not so easy...
    You can find a simple example at my weblog <a href="/people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs Performance of Mapping Programs</a>. The same mapping is over there with other mapping kinds; as you see, ABAP seems to be most complex, he, he. One or two days, and you get it
    frohes Basteln,
    Udo

  • Upload an excel file input into an itab,display in ALV using ABAP objects

    Requirement:
    Create a selection screen which takes an excel file as input with parameters emp id, emp name, salary, mnth, ph no.
    Create a database table with the same fields.
    The program needs to have two modes. Display mode and update mode.
    Display mode only displays the file data in alv grid and update mode updates database table with similar parameters as above and also shows alv grid output.
    task is to do using Object oriented approach. This should also have the facility to modify the cell values in ALV grid and once saved then it needs to update the database accordingly.
    I have done the same functionality in a report program without using ABAP objects but finding difficulty in using object oriented approach.Please help me as i am new to abap-objects.
    Thanks in advance.......

    Hi,
    The selection screen design and all remains the same.
    Get all the detials which you need in your final internal table.
    This internal table will be used to display in the ALV grid.
    The approach remains the same as the normal programing.
    Prepare a field catalog table and then use it along with the internal table to display in the grid.
    The only change is that instead of FM you will have to make us of classes and their methods.
    Firstly you will have to create a screen.
    On this screen create a custom control object and give it some name. say for eg. CC_CONTAINER.
    This will be a container on which the ALV grid object will be placed.
    2 objects are needed to display the grid
    CL_GUI_CUSTOM_CONTAINER and CL_GUI_ALV_GRID.
    In the PBO of the screen first create an instance of object CL_GUI_CUSTOM_CONTAINER
    CREATE OBJECT y_lobj_cont
          EXPORTING
             container_name              = 'CC_CONTAINER'
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
        IF sy-subrc NE 0.
          MESSAGE ID sy-msgid TYPE y_k_s NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Then create a instance of the GRID
    IF y_lobj_grid IS INITIAL.
          CREATE OBJECT y_lobj_grid
            EXPORTING
              i_parent          = y_lobj_cont
             EXCEPTIONS
               error_cntl_create = 1
               error_cntl_init   = 2
               error_cntl_link   = 3
               error_dp_create   = 4
               OTHERS            = 5 .
          IF sy-subrc NE 0.
            MESSAGE ID sy-msgid TYPE y_k_s NUMBER sy-msgno
                       WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
        ENDIF.
    Then call the method SET_TABLE_FOR_FIRST_DISPLAY to display the grid.
    CALL METHOD y_lobj_grid->set_table_for_first_display
          EXPORTING
            it_toolbar_excluding          = y_v_lt_exclude
          CHANGING
            it_outtab                     = y_li_tbl
            it_fieldcatalog               = y_li_fcat
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc NE 0.
          MESSAGE ID sy-msgid TYPE y_k_s NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Check the example program BCALV_GRID_EDIT for better understanding.
    Regards,
    Ankur Parab

  • REFRESH ALV WITHOUT ABAP OBJECTS

    Hi, I am interested in refreshing an alv created WITHOUT ABAP OBJECTS; I use functions like REUSE_ALV_GRID_DISPLAY and I was wondering if is there any function like this to refresh an ALV when I make changes in the data inside of it.
    Thanx!

    Here is what you need to do.
    *-- Call the ALV function module
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                =
    *     I_BUFFER_ACTIVE                   = ' '
          i_callback_program                = v_repid
          i_callback_pf_status_set          = 'PF_STATUS_SET'
          i_callback_user_command           = 'USER_COMMAND'
          i_callback_top_of_page            = 'TOP_OF_PAGE'
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
          is_layout                         = i_layout
          it_fieldcat                       = i_fieldcat[]
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
    *     IT_SORT                           =
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       = ' '
    *     I_DEFAULT                         = 'X'
    *     I_SAVE                            = 'X'
    *     IS_VARIANT                        =
    *      it_events                         = i_events[]
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT                          =
    *     IS_REPREP_ID                      =
    *     I_SCREEN_START_COLUMN             = 0
    *     I_SCREEN_START_LINE               = 0
    *     I_SCREEN_END_COLUMN               = 0
    *     I_SCREEN_END_LINE                 = 0
    *     IT_ALV_GRAPHICS                   =
    *     IT_ADD_FIELDCAT                   =
    *     IT_HYPERLINK                      =
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          =  alvtab
        EXCEPTIONS
          program_error                     = 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.
    *-- then in your USER_COMMAND routine
    *       FORM USER_COMMAND                                             *
    FORM user_command USING ucomm    LIKE sy-ucomm
                            selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN 'ABC'.
          PERFORM do_abc.
        WHEN 'XYZ'.
          PERFORM do_xyz.
        WHEN OTHERS.
      ENDCASE.
      <b>MOVE '&REFRESH' TO ucomm. "<-- this is what you need</b>
    ENDFORM.                                    " USER_COMMAND
    Srinivas

  • How to use LDB PNP with ABAP objects in a program

    Hello,
    I am wondering if anybody has used the HR logical database(LDB) PNP with user defined ABAP objects in a program? I am using the FM- <b>LDB_PROCESS</b> but its not working. Also assigning PNP in the attributes section of the program -- so that I can use predefined fields from the LDB and then invoking the FM doesn't work -- throwing 'Logical database already active' error.
    I suppose even with the ABAP objects and the new FM -- I should still be able to utilize the pre-defined fields of the PNP database -- and also the built in authorizations. I cannot use GET PERNR and REJECT as they give errors. I understand that the use of HR-macros (RP-PROVIDE-FROM-LAST and et al.) are not allowed as they use the table work area -- which is not allowed in ABAP-OOPS.
    I would really appreciate if anyone could show me some insight regarding this. Thank you.
    Kshitij R. Devre

    Hi Kshitij
    It would be really good if we could use both together. But as I know, it is not possible. "GET pernr." is an event-like loop statement and so cannot be used in OO context. And I guess, the same restriction holds for the "LDB_PROCESS" since it uses LDB-specific processing.
    What I suggest you is to use standard and BAPI functions.
    Sorry for giving bad news...
    *--Serdar

  • ALV GRID-Abap Objects

    I am using ALV grid in ABAP objects. I have to sort ascending and descending. I saw the program BCALV_TEST_GRID. I copied the function code for ascending and descending from the program. But it is not working. what is the problem?

    You need to fill up the table
    it_sort             = gt_sort
    in the method
      call method gr_grid_d0100->set_table_for_first_display

  • Module pool programming with Abap Objects

    Hi masters,
    Somebody tell me that you can directly call a local class in a module pool.
        Is that possible?
        Can anybody refer me to any kind of information?
    Thanks a lot.

    Well, thanks for the answer, but not was the one i was waiting for... it wasn't helpful.
    But, i've continued searching for answers... and i've found that:
    OO Transactions Locate the document in its SAP Library structure
    In transaction maintenance (SE93), you can specify a transaction code as an OO transaction.
    You either link the transaction code to the Transaction Service of the Structure link ABAP Object Services for persistent objects or to a public method of a global or local class of a program. When calling up a transaction that is linked to an instance method, the system automatically generates an instance of the class in its own internal session.
    An example of a link between a transaction code and an instance method of a local class of an unspecified ABAP program:
    Example
    *& Modulpool DEMO_OO_TRANSACTION *
    program DEMO_OO_TRANSACTION.
    class DEMO_CLASS definition.
    public section.
    methods INSTANCE_METHOD.
    endclass.
    class DEMO_CLASS implementation.
    method INSTANCE_METHOD.
    message 'Instance method in local class' type 'I'.
    endmethod.
    endclass.
    The DEMO_OO_TRANSACTION program is a module pool of type M that does not contain any screens or dialog modules. Instead, the program contains the definition of a local class DEMO_CLASS.
    The DEMO_OO_METHOD transaction code is linked to this program as follows:
    The start object of the transaction is Method of a class (OO transaction).
    OO transaction model is not selected.
    The Class Name is DEMO_CLASS.
    The Method is INSTANCE_METHOD.
    Local in program is selected and DEMO_OO_TRANSACTION specified.
    When the transaction is called up, the program is loaded, an instance of the class is created, and the method is executed.
    Leaving content frame
    That's what i wanted.
    I hope it would be helpful for anyone else.

  • ALV USING ABAP OBJECTS

    HI ALL.
    WHY I AM NOT ABLE TO COLOUR u2018LIFNRu2019 COLUMN USING FIELDCATALOG(FCAT).
    HERE IS THE SOURCE CODE.
    PLZ HELP ME OUT.
    *& Module pool       ZOOPSDEMO                                         *
    PROGRAM  ZOOPSDEMO                               .
    DATA: BEGIN OF WA.
    INCLUDE STRUCTURE LFA1.
    DATA: LINE_COLOR(4) TYPE C,
    END OF WA.
    DATA ITAB LIKE TABLE OF WA.
    DATA FCAT TYPE LVC_T_FCAT WITH HEADER LINE.
    DATA: WA1 LIKE EKKO,
    JTAB LIKE TABLE OF EKKO.
    DATA: WA2 LIKE EKPO,
    KTAB LIKE TABLE OF EKPO.
    DATA: WA_LAYOUT TYPE LVC_S_LAYO.
    DATA: O_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          O_GRID TYPE REF TO CL_GUI_ALV_GRID.
    CLASS E_EVENTS DEFINITION.
    PUBLIC SECTION.
    METHODS:
    DC FOR EVENT DOUBLE_CLICK  OF CL_GUI_ALV_GRID IMPORTING E_ROW E_COLUMN.
    ENDCLASS.
    CLASS E_EVENTS IMPLEMENTATION.
    METHOD DC.
    IF E_COLUMN = 'LIFNR'.
    READ TABLE ITAB INTO WA INDEX E_ROW-INDEX .
    SELECT * FROM EKKO INTO TABLE JTAB UP TO 140 ROWS WHERE LIFNR = WA-LIFNR
    SET PARAMETER ID 'LIF' FIELD WA-LIFNR.
    CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
        I_STRUCTURE_NAME              = 'EKKO'
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
      IS_LAYOUT                     =
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
      CHANGING
        IT_OUTTAB                     = JTAB.
       IT_FIELDCATALOG               =
       IT_SORT                       =
       IT_FILTER                     =
    EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    IF E_COLUMN = 'EBELN'.
    READ TABLE JTAB INTO WA1 INDEX E_ROW-INDEX.
    SELECT * FROM EKPO INTO TABLE KTAB UP TO 100 ROWS WHERE EBELN =
    WA1-EBELN.
    CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
        I_STRUCTURE_NAME              = 'EKPO'
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
       IS_LAYOUT                     =
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
      CHANGING
        IT_OUTTAB                     = KTAB.
       IT_FIELDCATALOG               =
       IT_SORT                       =
       IT_FILTER                     =
    EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    ENDMETHOD.
    ENDCLASS.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    CREATE OBJECT O_CONTAINER
    EXPORTING
    CONTAINER_NAME = 'CONTAINER'.
    CREATE OBJECT O_GRID
    EXPORTING
    I_PARENT = O_CONTAINER.
    DATA O_EVENT TYPE REF TO E_EVENTS.
    CREATE OBJECT O_EVENT .
    SET HANDLER O_EVENT->DC FOR O_GRID.
    WA_LAYOUT-INFO_FNAME = 'LINE_COLOR'.
    WA-LINE_COLOR = 'C511'.
    MODIFY ITAB FROM WA INDEX 5 TRANSPORTING LINE_COLOR.
    WA_LAYOUT-SEL_MODE = 'D'.
    CALL METHOD O_GRID->SET_TABLE_FOR_FIRST_DISPLAY
      EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
        I_STRUCTURE_NAME              = 'LFA1'
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
        IS_LAYOUT                     = WA_LAYOUT
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
      CHANGING
        IT_OUTTAB                     = ITAB
         IT_FIELDCATALOG               = FCAT[].
       IT_SORT                       =
       IT_FILTER                     =
    EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    MODULE READ_DATA OUTPUT.
    PERFORM COL_HEAD.
    SELECT * FROM LFA1 INTO TABLE ITAB UP TO 140 ROWS.
    ENDMODULE.
    FORM COL_HEAD.
    FCAT-EMPHASIZE = 'C511'.
    MODIFY FCAT[] FROM FCAT TRANSPORTING EMPHASIZE WHERE FIELDNAME = 'LIFNR'
    ENDFORM.

    Hi ,
           In module status where you
    WA-LINE_COLOR = 'C511'.
    MODIFY ITAB FROM WA INDEX 5 TRANSPORTING LINE_COLOR
    better read table itab with index
    Read table itab into wa index 5 .
    WA-LINE_COLOR = 'C511'.
    MODIFY ITAB FROM WA INDEX 5 TRANSPORTING LINE_COLOR.
    please reward if useful .

  • How to use ABAP objects in ALV

    Can u give me the steps for doing ALV with ABAP objects

    Hello Mohammed
    Here are a few simplified version of the SAP sample reports that I have posted within SDN.
    This is a variant of my previously posted report ZUS_SDN_ALVGRID_EVENTS. Both dynpros (100 & 200) do not contain any elements. For simplicity I used the same flow logic for both dynpros:
    PROCESS BEFORE OUTPUT.
      MODULE STATUS_0100.
    PROCESS AFTER INPUT.
      MODULE USER_COMMAND_0100.
    <b>&----
    *& Report  ZUS_SDN_ALVGRID_EVENTS_1
    &----</b>
    REPORT  zus_sdn_alvgrid_events_1.
    DATA:
      gd_okcode        TYPE ui_func,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_docking2      TYPE REF TO cl_gui_docking_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_t001          TYPE STANDARD TABLE OF t001,
      gt_knb1          TYPE STANDARD TABLE OF knb1.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_t001     TYPE t001,
          ls_col_id   TYPE lvc_s_col.
        CHECK ( sender = go_grid1 ).
        READ TABLE gt_t001 INTO ls_t001 INDEX e_row-index.
        CHECK ( ls_t001-bukrs IS NOT INITIAL ).
        SELECT * FROM knb1 INTO TABLE gt_knb1
          WHERE bukrs = ls_t001-bukrs.
        IF ( syst-subrc NE 0 ).
          MESSAGE 'No customers found' TYPE 'S'.
        ELSE.
    *     Trigger PAI of dynpro '0100' and set new ok-code
          CALL METHOD cl_gui_cfw=>set_new_ok_code( 'CALL_SCREEN_0200' ).
        ENDIF.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM t001 INTO TABLE gt_t001.
      REFRESH: gt_knb1.
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_docking2
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent          = go_docking2
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click FOR go_grid1.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'T001'
        CHANGING
          it_outtab        = gt_t001
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNB1'
        CHANGING
          it_outtab        = gt_knb1
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL METHOD go_docking2->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0200'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'CALL_SCREEN_0200'.
          go_grid2->refresh_table_display( ).  " necessary
          CALL SCREEN '0200'.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    The following sample report ZUS_SDN_ALVGRID_EVENTS shows how to call a transaction when event HOTSPOT_CLICK was raised:
    <b>&----
    *& Report  ZUS_SDN_TWO_ALV_GRIDS
    &----</b>
    REPORT  ZUS_SDN_ALVGRID_EVENTS.
    DATA:
      gd_okcode        TYPE ui_func,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_knb1          TYPE STANDARD TABLE OF knb1.
    PARAMETERS:
      p_bukrs      TYPE bukrs  DEFAULT '1000'  OBLIGATORY.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    *   define local data
        DATA:
          ls_knb1     TYPE knb1,
          ls_col_id   type lvc_s_col.
        READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row_id-index.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
        SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
        CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
    *   Set active cell to field BUKRS otherwise the focus is still on
    *   field KUNNR which will always raise event HOTSPOT_CLICK
        ls_col_id-fieldname = 'BUKRS'.
        CALL METHOD go_grid1->set_current_cell_via_id
          EXPORTING
            IS_ROW_ID    = e_row_id
            IS_COLUMN_ID = ls_col_id.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  knb1 INTO TABLE gt_knb1
             WHERE  bukrs  = p_bukrs.
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_hotspot_click FOR go_grid1.
    * Build fieldcatalog and set hotspot for field KUNNR
      PERFORM build_fieldcatalog_knb1.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        CHANGING
          it_outtab       = gt_knb1
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG_KNB1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog_knb1 .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNB1'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE gt_fcat INTO ls_fcat
           WITH KEY fieldname = 'KUNNR'.
      IF ( syst-subrc = 0 ).
        ls_fcat-hotspot = abap_true.
        MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
      ENDIF.
    ENDFORM.                    " BUILD_FIELDCATALOG_KNB1
    Please note that the direct CALL TRANSACTION does not check the user's authority. To do so you could call the transaction using function module ABAP4_CALL_TRANSACTION.
    Here is a sample program for OO-based ALV grids (CL_GUI_ALV_GRID) that simulates radio buttons by using icons with hotspots.
    <b>PROGRAM ZUS_SDN_BCALV_GRID_DEMO_2.</b>
    * Based on: BCALV_GRID_DEMO.
    TYPE-POOLS: icon.
    TYPES: BEGIN OF ty_s_sflight.
    INCLUDE TYPE sflight.
    TYPES: button1    TYPE lvc_emphsz.
    TYPES: button2    TYPE lvc_emphsz.
    TYPES: button3    TYPE lvc_emphsz.
    TYPES: button4    TYPE lvc_emphsz.
    TYPES: END OF ty_s_sflight.
    DATA:
      gt_sflight    TYPE STANDARD TABLE OF ty_s_sflight,
      gt_fcat       TYPE lvc_t_fcat.
    DATA: ok_code LIKE sy-ucomm,
    *      gt_sflight TYPE TABLE OF sflight,
          g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          grid1  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          md_cnt    TYPE i.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    * define local data
        FIELD-SYMBOLS:
          <ls_entry>    TYPE ty_s_sflight,
          <ld_fld>      TYPE ANY.
        READ TABLE gt_sflight ASSIGNING <ls_entry> INDEX es_row_no-row_id.
        CHECK ( <ls_entry> IS ASSIGNED ).
    *   Set all radio buttons "unselected"
        <ls_entry>-button1 =  icon_wd_radio_button_empty.
        <ls_entry>-button2 =  icon_wd_radio_button_empty.
        <ls_entry>-button3 =  icon_wd_radio_button_empty.
        <ls_entry>-button4 =  icon_wd_radio_button_empty.
        ASSIGN COMPONENT e_column_id-fieldname OF STRUCTURE <ls_entry>
                                                  TO <ld_fld>.
        IF ( <ld_fld> IS ASSIGNED ).
    *     Set selected radio button "selected".
          <ld_fld> = icon_wd_radio_button.
        ENDIF.
    *   Force PAI followed by refresh of table display in PBO
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = 'DUMMY'
    *      IMPORTING
    *        RC       =
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
    *       MAIN                                                          *
      PERFORM select_data.
      CALL SCREEN 100.
    *       MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
               EXPORTING container_name = g_container.
        CREATE OBJECT grid1
               EXPORTING i_parent = g_custom_container.
        PERFORM build_fieldcatalog.
        CALL METHOD grid1->set_table_for_first_display
    *      EXPORTING
    *        i_structure_name = 'SFLIGHT'
          CHANGING
            it_fieldcatalog  = gt_fcat
            it_outtab        = gt_sflight.
    *   Set event handler for event TOOLBAR
        SET HANDLER:
          lcl_eventhandler=>handle_hotspot_click FOR grid1.
      else.
        CALL METHOD grid1->refresh_table_display
    *      EXPORTING
    *        IS_STABLE      =
    *        I_SOFT_REFRESH =
          EXCEPTIONS
            FINISHED       = 1
            others         = 2.
        IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDMODULE.                    "PBO OUTPUT
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
    *   to react on oi_custom_events:
      CALL METHOD cl_gui_cfw=>dispatch.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
        WHEN OTHERS.
    *     do nothing
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                    "PAI INPUT
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
    *  CALL METHOD G_CUSTOM_CONTAINER->FREE.
    *  CALL METHOD CL_GUI_CFW=>FLUSH.
      LEAVE PROGRAM.
    ENDFORM.                    "EXIT_PROGRAM
    *&      Form  BUILD_FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat,
        ls_hype        TYPE lvc_s_hype.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'LVC_S_FCAT'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DELETE gt_fcat WHERE ( fieldname <> 'EMPHASIZE' ).
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'SFLIGHT'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE gt_fcat INTO ls_fcat
           WITH KEY fieldname = 'EMPHASIZE'.
      IF ( syst-subrc = 0 ).
        DELETE gt_fcat INDEX syst-tabix.
      ENDIF.
      ls_fcat-fieldname = 'BUTTON4'.
      ls_fcat-icon    = 'X'.
      ls_fcat-hotspot = 'X'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      ls_fcat-fieldname = 'BUTTON3'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      ls_fcat-fieldname = 'BUTTON2'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      ls_fcat-fieldname = 'BUTTON1'.
      INSERT ls_fcat INTO gt_fcat INDEX 4.
      LOOP AT gt_fcat INTO ls_fcat.
        ls_fcat-col_pos = syst-tabix.
        MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
      ENDLOOP.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SELECT_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM select_data .
    * define local data
      DATA:
        ls_sflight    TYPE ty_s_sflight.
      SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE gt_sflight.
      ls_sflight-button1 = icon_wd_radio_button.
      ls_sflight-button2 = icon_wd_radio_button_empty.
      ls_sflight-button3 = icon_wd_radio_button_empty.
      ls_sflight-button4 = icon_wd_radio_button_empty.
      MODIFY gt_sflight FROM ls_sflight
          TRANSPORTING button1 button2 button3 button4
        WHERE ( carrid IS NOT INITIAL ).
    ENDFORM.                    " SELECT_DATA
    The various aspects of ALV list programming are collected within the reuse library (transaction <b>SE83</b>).
    And do not miss to look at <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">Easy Reference to ALV Grid Control</a>
    Regards
    Uwe

  • Abap Objects generating List Trees and Grids

    Hi Friends,
      Please provide me the Information for how to work with ABAP OBJECTS creating(and manipulating)the combination of List Trees and Grids.
    Regards,
    Sowjanya

    There are a couple of examples programs,  You can start by checking out transaction DWDM for some of the basic ABAP oo controls.  You can also check out any program which begins with BCALV* for examlple of ALV grids, trees, and lists.
    REgards,
    Rich Heilman

  • Dc 007- Control Framework: Invalid Processing of ABAP Object Control- DUMP

    Hello,
    we're upgrading to ECC6 and while running ALV report i get a dump that says that i'm trying to edit a control created with ABAP objects techniques using a function module.
    It worked just fine in version 46C.
    Is it possible to solve the problem without re-writing the program?
    Thanks
    Moshe

    I'm getting the same error when calling the below BAPI. When the BAPI gets an error, I get a shortdump.
    This is being when the user selects a convert planned orders button in a custom developed report that uses the SALV_OM alv grid.
                  "Call BAPI to convert planned orders to production orders
                   CALL FUNCTION 'BAPI_PRODORD_CREATE_FROM_PLORD'
                     EXPORTING
                       planned_order    = <s_output>-plnum
                       order_type       = 'ZEPR'
    *                 ORDER_NUMBER     =
                     IMPORTING
                       production_order = ld_production_order
    *                 PROD_ORDER_TYPE  =
                       return           = ld_return
                     EXCEPTIONS
                       OTHERS           = 1.

Maybe you are looking for

  • Error while running webdynpro application with an Interactive form

    Hi all, I am getting the following defect when I run a adobe interactive form (webdynpro application). Any pointers? Regards, Deepak 500   Internal Server Error Failed to process request. Please contact your system administrator. Error Summary While

  • I'm being told I need to download Flash player even though I have installed the latest version

    I'm using a Mac with Mac OS X, Version 10.7.5, with Safari 6.0.2 as my browser. I haven't had any problems with Flash player until today. Now suddenly, when I try to view Flash content, it tells me I need to download/install the latest version of Fla

  • Extreme - iTunes - External Drive

    Some time back I moved my massive music collection and some other files to a 1TB external drive which I am also using as a Tie Capsule. I then bought an Airport Extreme and plugged the external drive in to it. Now I cannot access my music library. It

  • InDesign CS5 and Windows 8

    My company is going toWindows 8. I use CS5.  Any hitches I should be aware of? Thanks!

  • Looking for a BAPI to print PO

    Hi ! I'm currently looking to a BAPI able to launch a printing of a purchase order. Does it exist ? Thanks ! Smoltok Moderator message: please do more research before asking, make sure you mention what you have researched so far when posting again. E