How to set variant for ALV grid from ABAP

Hello,
I have a program which displays some data with ALV grid. Then after some operation I would like to set different layout for the grid, but not by choosing it manually but by the program. I thought that it would be enough to use the method SET_VARIANT, so I'm setting DISVARIANT structure properly, using SET_VARIANT method and after that I'm calling REFRESH_TABLE_DISPLAY but layout is not changed. What else should I do? Is that possible?
Best regards,
Marcin

Hi,
Check this
* While declaring select-options
parameters: p_vari        like ltdx-variant.  " Layout
* then add the following code in
at selection-screen on value-request for p_vari.
  perform f_variant_f4 using p_vari.
* Code for f_variant_f4
form f_variant_f4 using  p_vari.
* private variables
  data : v_exit    type c.
  clear gs_variantt.
  v_variant_save = 'U'.
  call function 'LVC_VARIANT_F4'
    exporting
      is_variant    = gs_variant
      i_save        = v_variant_save
    importing
      e_exit        = v_exit
      es_variant    = gs_variantt
    exceptions
      not_found     = 1
      program_error = 2
      others        = 3.
  if sy-subrc ne c_0.
    message i999(yscc) with text-064.    " No Layout Available for F4
  endif.
  if v_exit is initial.
    gs_variant-variant = gs_variantt-variant.
    p_vari             = gs_variantt-variant.
  endif.
endform.                                 " F_variant_f4
* In PBO
    call method grid1->set_table_for_first_display
      exporting
        is_layout                     = gs_layout
        is_variant                    = gs_variant
        i_save                        = 'A'
        it_toolbar_excluding          = i_exclude[]
      changing
        it_outtab                     = i_output[]
        it_fieldcatalog               = i_fieldcat[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.

Similar Messages

  • How to setup variants for webdynpro report in ABAP? Help!

    Hi Experts,
       I have a webdynpro for ABAP report with selection screen. 
       How to setup variants for webdynpro report in ABAP?
    Thanks
    Gopal

    Hi Gopal,
      There is no concept of Variant in Webdynpro ABAP. But in our project we have some tool to do that. Its not release to the client I think. In my scenarieo, We create the Screen variant and program name will be supplied to the tool that will generate the ouput in PDF and Selection screen in One view. But the same is not avilable .
    If you want the same concept in Webdynpro ABAP, you need to go for Dynamic programming only. This is the only option is avilable.
    Warm Regards,
    Vijay

  • How to Set Checkbox of ALV Grid Dark on Display Mode

        ABAP experts, I want to switch between display mode and edit mode for some columns of ALV Grid. So I set "LVC_S_FCAT-EDIT" "X" for the columns which need to switch mode, and use method "SET_READY_FOR_INPUT" to switch.
        Currently, the function of switch mode has been achieved. But icons of checkbox columns are light but not dark when display mode, although the columns can't be edited. (Please refer to the image below.) I want to make checkbox columns dark as other columns on display mode.
        I tried to use "CL_GUI_ALV_GRID=>MC_STYLE_ENABLED" and "CL_GUI_ALV_GRID=>MC_STYLE_DISABLED", but failed. I also studied sample program "BCALV_EDIT_05" which is related to checkbox in ALV Grid, and compared my program with this program. But I still have not found problems.
        Help me solve this problem, please.
        Part of my codes are as follows.
        Part 1:
    IF iv_is_create_group = abap_true OR iv_is_edit_group = abap_true.
           set_enable( iv_flag = 1 ).
           LOOP AT gt_acct_group_item ASSIGNING <lfs_acct_group_item>.
             CLEAR ls_celltab.
             IF <lfs_acct_group_item>-celltab IS INITIAL.
               CLEAR ls_celltab.
               ls_celltab-fieldname = 'CHECK_BOX'.
               ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
               APPEND ls_celltab TO <lfs_acct_group_item>-celltab.
               CLEAR ls_celltab.
               ls_celltab-fieldname = 'XPORE'.
               ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
               APPEND ls_celltab TO <lfs_acct_group_item>-celltab.
             ELSE.
               LOOP AT <lfs_acct_group_item>-celltab ASSIGNING <lfs_celltab>.
                 <lfs_celltab>-style = cl_gui_alv_grid=>mc_style_enabled.
               ENDLOOP.
             ENDIF.
           ENDLOOP.
         ELSE.
           set_enable( iv_flag = 0 ).
           LOOP AT gt_acct_group_item ASSIGNING <lfs_acct_group_item>.
             IF <lfs_acct_group_item>-celltab IS INITIAL.
               CLEAR ls_celltab.
               ls_celltab-fieldname = 'CHECK_BOX'.
               ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
               APPEND ls_celltab TO <lfs_acct_group_item>-celltab.
               CLEAR ls_celltab.
               ls_celltab-fieldname = 'XPORE'.
               ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
               APPEND ls_celltab TO <lfs_acct_group_item>-celltab.
             ELSE.
               LOOP AT <lfs_acct_group_item>-celltab ASSIGNING <lfs_celltab>.
                 <lfs_celltab>-style = cl_gui_alv_grid=>mc_style_disabled.
               ENDLOOP.
             ENDIF.
           ENDLOOP.
         ENDIF.
         CALL METHOD gr_grid->refresh_table_display
    *      EXPORTING
    *        is_stable      =
    *        i_soft_refresh =
           EXCEPTIONS
             finished       = 1
             OTHERS         = 2
         IF sy-subrc <> 0.
    *     Implement suitable error handling here
         ENDIF.
        Part 2:
    METHOD set_enable.
         gr_grid->set_ready_for_input(
             i_ready_for_input = iv_flag
    ENDMETHOD.

    Hi Liu,
        Please go through the below code.
    *& Report  YEDIT_DISPLAY
    REPORT  YEDIT_DISPLAY.
    TABLES : VBAK.
    TYPE-POOLS SLIS.
    TYPES : BEGIN OF TY_VBAK,
              VBELN TYPE VBAK-VBELN,
             END OF TY_VBAK,
             BEGIN OF TY_FINAL,
               BOX TYPE C,
               VBELN TYPE VBAK-VBELN,
             END OF TY_FINAL.
    DATA : IT_VBAK TYPE TABLE OF TY_VBAK,
            WA_VBAK TYPE TY_VBAK,
            IT_FINAL TYPE TABLE OF TY_FINAL,
            WA_FINAL TYPE TY_FINAL,
            IT_FCAT TYPE TABLE OF SLIS_FIELDCAT_ALV,
            WA_FCAT TYPE SLIS_FIELDCAT_ALV.
    START-OF-SELECTION.
       PERFORM FETCH_DATA.
       PERFORM FCAT_DATA.
       PERFORM DISPLAY.
    *&      Form  FETCH_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FETCH_DATA .
       SELECT VBELN INTO TABLE IT_VBAK FROM VBAK UP TO 10 ROWS.
       LOOP AT IT_VBAK INTO WA_VBAK.
         WA_FINAL-VBELN = WA_VBAK-VBELN.
         APPEND WA_FINAL TO IT_FINAL.
         CLEAR : WA_FINAL , WA_VBAK.
       ENDLOOP.
    ENDFORM.                    " FETCH_DATA
    *&      Form  FCAT_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FCAT_DATA .
       WA_FCAT-COL_POS = 1.
       WA_FCAT-FIELDNAME = 'BOX'.
       WA_FCAT-TABNAME = 'IT_FINAL'.
       WA_FCAT-OUTPUTLEN = '3'.
       WA_FCAT-SELTEXT_M = 'BOX'.
       wa_fcat-checkbox = 'X'.
       WA_FCAT-EDIT = 'X'.
       APPEND WA_FCAT TO IT_FCAT.
       CLEAR WA_FCAT.
       WA_FCAT-COL_POS = 2.
       WA_FCAT-FIELDNAME = 'VBELN'.
       WA_FCAT-TABNAME = 'IT_FINAL'.
       WA_FCAT-OUTPUTLEN = '3'.
       WA_FCAT-SELTEXT_M = 'Sales Document'.
       APPEND WA_FCAT TO IT_FCAT.
       CLEAR WA_FCAT.
    ENDFORM.                    " FCAT_DATA
    *&      Form  DISPLAY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM DISPLAY .
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = SY-REPID
    *   I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
          IT_FIELDCAT                       = IT_FCAT
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
         TABLES
           T_OUTTAB                          = IT_FINAL
    * EXCEPTIONS
    *   PROGRAM_ERROR                     = 1
    *   OTHERS                            = 2
       IF SY-SUBRC <> 0.
    * Implement suitable error handling here
       ENDIF.
    ENDFORM.                    " DISPLAY
    FORM USER_COMMAND USING UCOMM TYPE SY-UCOMM
                             RTAB TYPE slis_selfield.
       CASE UCOMM.
         WHEN '&IC1'.
           MESSAGE 'SUCESSFUL' TYPE 'S'.
         WHEN '&DATA_SAVE'.
           PERFORM FIL_FCAT.
           PERFORM DISPLAY1.
         WHEN 'BACK'.
           LEAVE TO SCREEN 0.
         WHEN OTHERS.
           LEAVE TO SCREEN 0.
       ENDCASE.
    ENDFORM.
    *&      Form  FIL_FCAT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FIL_FCAT .
    CLEAR IT_FCAT.
       WA_FCAT-COL_POS = 1.
       WA_FCAT-FIELDNAME = 'BOX'.
       WA_FCAT-TABNAME = 'IT_FINAL'.
       WA_FCAT-OUTPUTLEN = '3'.
       WA_FCAT-SELTEXT_M = 'BOX'.
       wa_fcat-checkbox = 'X'.
    **  WA_FCAT-EDIT = 'X'.
       APPEND WA_FCAT TO IT_FCAT.
       CLEAR WA_FCAT.
       WA_FCAT-COL_POS = 2.
       WA_FCAT-FIELDNAME = 'VBELN'.
       WA_FCAT-TABNAME = 'IT_FINAL'.
       WA_FCAT-OUTPUTLEN = '3'.
       WA_FCAT-SELTEXT_M = 'Sales Document'.
       APPEND WA_FCAT TO IT_FCAT.
       CLEAR WA_FCAT.
    ENDFORM.                    " FIL_FCAT
    *&      Form  DISPLAY1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM DISPLAY1 .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = SY-REPID
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
          IT_FIELDCAT                       = IT_FCAT
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
         TABLES
           T_OUTTAB                          = IT_FINAL
    * EXCEPTIONS
    *   PROGRAM_ERROR                     = 1
    *   OTHERS                            = 2
       IF SY-SUBRC <> 0.
    * Implement suitable error handling here
       ENDIF.
    ENDFORM.                    " DISPLAY1
    Here i written code under the SAVE button , if requires you create your own status and apply.
    Regards,
    Krishna

  • How to upload logo for alv grid when we are using classes

    Hi am using cl_gui_alv_tree  for displaying alv grid. i want to upload logo in the heade section. as we do in simple alvs using resuse_alv_commentary_write.
    plz update me in this regard.
    regards
    venkat

    Welcome to SDN.
    Check the following threads -
    How To use TOP OF PAGE event in OOPS ALV?
    Logo & TOP_OF_PAGE in OO ALV
    Regards,
    Amit
    Reward all helpful replies.

  • Hi, how to set printer to alv grid, please check my code

    Hi,
    Iam giving my code, please observe...
    DEFAULT PRINTER NAME "A909".
    NOW IAM SETTING OT "LP01".
    GS_PRINT-PRINT = 'X'.
    P_PRINTR = 'LP01'.
    CALL FUNCTION 'UPDATE_DEFAULT_PRINTPARAMS'
    EXPORTING
    USER = SY-UNAME
    DESTINATION = P_PRINTR
    IMMEDIATELY = ' '
    RELEASE = 'X'
    NEW_LIST_ID = 'X'.
    SY-BATCH = 'X'
    CALL METHOD GO_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK = G_CONSISTENCY_CHECK
    I_STRUCTURE_NAME = 'KNA1'
    IS_VARIANT = GS_VARIANT
    I_SAVE = 'A'
    I_DEFAULT = 'X'
    IS_LAYOUT = GS_LAYOUT
    IS_PRINT = GS_PRINT
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING = GT_EXCLUDE
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    IT_OUTTAB = ITAB2[]
    IT_FIELDCATALOG = GT_FIELDCAT
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    others = 4
    After running this program iam getting the default printer spool request number 'A909', Iam not getting printing form 'LP01'.
    Need is to send the print to given printer (LP01), here printer may varry accoring to the selection. So nee is to set the printer that which has choosen.
    Please give me the valuble solution as early as possible.
    Please solve this as early as possible.

    Hi Ravi,
    You can choose for the print version to be created as a PostScript file instead of a PDF document. The PostScript file is then sent directly to a printer of your choice
    If you do not specify an output device here, a PDF file is generated and displayed on the screen.
    You use the methods of the interface class IF_SALV_WD_PDF_SETTINGS for this (implementing class CL_SALV_WD_CONFIG_TABLE).
    <b>Function</b>                      <b>Method</b>
    Set ALV output to be printed immediately -->  SET_PRINT_IMMEDIATE
    Check whether the ALV output is to be printed immediately --> GET_PRINT_IMMEDIATE
    Set printer -->  SET_PRINTER
    Get printer --> GET_PRINTER
    See the below for SAP link
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/27472def40601ee10000000a422035/content.htm
    see the thread also
    Re: How to set the printer in set_table_for_first_display
    mark all the helpful answers
    Regards
    Sudheer

  • List header for alv grid using abap objects

    Hai all,
          I have displayed alv grid in container control using abap objects i.e. using method set_table_for_first_display.
    now i need to display list header for this alv grid.
    please help me how to create with a sample coding.
    Thanks and regards,
    Prabu S.

    Create a splitter using CL_GUI_EASY_SPLITTER_CONTAINER with a top and bottom half.  Put the alv grid in the bottom half.  Use cl_dd_document (documented in help.sap.com )  to build the header in the top half.  Use events on CL_GUI_ALV_GRID to handle the top-of-list printing.
    Or, if available, use CL_SALV_TABLE, and read the documentation on that.  When I needed a header for my report, that's what I did.  There's plenty of good documentation about if you'll search for it.
    matt

  • How to get variants for ALV List or Grid?

    Hi,
    I have one standard program RGJVSO10, for 4.6c, to diplay variants they r using fm GJ_LIST_VARIANT_VALUE_HELP, where they r passing table name and get the variants.
    But in ECC6.0 for the same program they r using FM REUSE_ALV_VARIANT_F4, but the variants are not displaying, form the table what they r passing in 4.6c,
    Is ther any option to get those variants using this function module?

    Hi,
    I have check u r db table but not finding variant . i will check with prg and inform u .mean while u check with these variants.
    whether it suits u.
    REUSE_ALV_VARIANT_ALL_MAINTAIN
    REUSE_ALV_VARIANT_SELECT.
    REUSE_ALV_VARIANT__MAINTAIN
    REUSE_ALV_VARIANT_DEFAULT_GET
    Reward if its usefull.
    Regards
    Durgaprasad

  • How to set condition for my Choose From List

    hi ..plz check my code...i want to set a condition on my CFL which opens GL Accounts..it has to show only Active Accounts...but when i run the program iam able to see all accounts..what might me the proble..
    my code is as follows
    '''''''''' load form
    private sub loadform()
    '' here iam loading form which is designed in Screen painter where i have a textbox (uid = 19) and CFL_2 as its choosefromlist and object type = 1 alias name = ActCode
    conditionCFL()
    oform.visble = true
    end sub
    '''''''''' end of load form
    '''''''''setting condition
    private sub ConditionCFL()
    Try
                Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                Dim oCons As SAPbouiCOM.Conditions
                Dim oCon As SAPbouiCOM.Condition
                oCFLs = oForm.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                oCFLCreationParams.ObjectType = "1"
                oCFLCreationParams.UniqueID = "CFL1"
                oCFL = oCFLs.Add(oCFLCreationParams)
                ' Adding Conditions to CFL1
                oCons = oCFL.GetConditions()
                oCon = oCons.Add()
                oCon.Alias = "Postable"
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCon.CondVal = "Y"
                oCFL.SetConditions(oCons)
                oCFLCreationParams.UniqueID = "CFL2"
                oCFL = oCFLs.Add(oCFLCreationParams)
            Catch
                MsgBox(Err.Description)
            End Try
    end sub
    '''''''''end of setting condition
    i have still more code...plz follow the next code which is posted below.....

    continuation from above code...plz foloow complete code
    '''''''''''item event
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            Dim EventEnum As SAPbouiCOM.BoEventTypes
            EventEnum = pVal.EventType
            Try
                Select Case pVal.EventType
                    Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
                        If pVal.BeforeAction = True Then
                          Dim oCFLEvent As SAPbouiCOM.IChooseFromListEvent = DirectCast(pVal, SAPbouiCOM.IChooseFromListEvent)
                            Dim oDataTable As SAPbouiCOM.DataTable = oCFLEvent.SelectedObjects
                            Dim val As String
                            Try
                                If pVal.ItemUID = "19" Then
                                   Me.oDBDataSource.SetValue("U_BalenceSheet_Acct", 0, oCFLEvent.SelectedObjects.GetValue(0, 0))
                                End If
                             Catch ex As Exception
                                MsgBox(ex.ToString)
                            End Try
                        End If
                        Exit Select
                End Select
                           Catch ex As Exception
                                MsgBox(ex.ToString)
                            End Try
    end sub
    ''''''''''end of item event
    Edited by: Shenaz Sultana on Nov 13, 2009 2:18 PM

  • How to set Permissions for Mac HD from "No Access" to "Read only"

    Hi everyone! My friend's having a problem with her MacBook Pro. She accidentally changed the value of the Macintosh HD's privilege for everyone from Read only to No access. (See attached image for reference/guide). Seconds after, her Mac crashed. She rebooted her laptop, the Apple logo shows up with the usual scrolling week. Afterwards, the scrolling wheel disappears but the Apple logo is still there and it no longer proceeds to her login/desktop screen anymore.
    We already tried Repairing Disk Permissions (by pressing Command +R on bootup) and Repair Disks, rebooted, but it's still up to nothing. Unfortunately, she doesn't have a Time Machine backup.
    Is there a way to revert the changes even though the login/desktop screen can't be accessed? Is having the value "No access" on your Macintosh HD unsafe and will make you locked out of your system?
    I am looking forward to your fast and favorable feedback. :-)
    Thanks in advance!

    Is there a way to revert the changes even though the login/desktop screen can't be accessed? Is having the value "No access" on your Macintosh HD unsafe and will make you locked out of your system?
    There is currently no way to access the disk, no access means no access.
    Others may know better but I would backup the data on the drive, erase and reinstall.

  • Based from my code, how do I implement an ALV grid using OO concept...

    Hello experts,
    I am currently practicing ABAP Objects and I would like to use alv in my report. Now, How can I implement ALV in my report in the simplest way possible. Sample codes will be highly appreciated. Thanks guys and take care!
    REPORT  z_aris_oo_practice_9
            NO STANDARD PAGE HEADING
            LINE-SIZE 0
            LINE-COUNT 0.
    TABLES: spfli.
    Selection screen
    SELECTION-SCREEN BEGIN OF BLOCK box1 WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK box2 WITH FRAME.
    PARAMETERS: p_carrid TYPE spfli-carrid,
                p_connid TYPE spfli-connid.
    SELECTION-SCREEN END OF BLOCK box2.
    SELECTION-SCREEN BEGIN OF BLOCK box3 WITH FRAME.
    PARAMETERS: p_sumdis AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK box3.
    SELECTION-SCREEN END OF BLOCK box1.
          INTERFACE status
    INTERFACE status.
      METHODS write.
    ENDINTERFACE.                    "status
          CLASS main DEFINITION
    CLASS main DEFINITION.
      PUBLIC SECTION.
        INTERFACES status.
        METHODS: get_data,
                 combine_data.
        CLASS-DATA: counter TYPE i.
      PRIVATE SECTION.
        TYPES: BEGIN OF t_spfli,
             carrid    TYPE spfli-carrid,
             connid    TYPE spfli-connid,
             countryfr TYPE spfli-countryfr,
             cityfrom  TYPE spfli-cityfrom,
             airpfrom  TYPE spfli-airpfrom,
             countryto TYPE spfli-countryto,
             cityto    TYPE spfli-cityto,
             airpto    TYPE spfli-airpto,
             fltime    TYPE spfli-fltime,
             deptime   TYPE spfli-deptime,
             arrtime   TYPE spfli-arrtime,
            END OF t_spfli.
        DATA: it_spfli        TYPE STANDARD TABLE OF t_spfli.
    ENDCLASS.                    "main DEFINITION
          CLASS main IMPLEMENTATION
    CLASS main IMPLEMENTATION.
      METHOD status~write.
        WRITE: / 'The number of records is:', counter.
      ENDMETHOD.                    "status~write
      METHOD get_data.
        SELECT carrid   connid   countryfr
               cityfrom airpfrom countryto
               cityto   airpto   fltime
               deptime  arrtime
        FROM spfli
        INTO TABLE it_spfli
        WHERE carrid = p_carrid.
      ENDMETHOD.                    "get_data
      METHOD combine_data.
        FIELD-SYMBOLS: <fs_spfli> LIKE LINE OF it_spfli.
        LOOP AT it_spfli ASSIGNING <fs_spfli>.
          ADD 1 TO counter.
          WRITE: / <fs_spfli>-carrid,
                   <fs_spfli>-connid,
                   <fs_spfli>-countryfr,
                   <fs_spfli>-cityfrom,
                   <fs_spfli>-airpfrom,
                   <fs_spfli>-countryto,
                   <fs_spfli>-cityto,
                   <fs_spfli>-airpto,
                   <fs_spfli>-fltime,
                   <fs_spfli>-deptime,
                   <fs_spfli>-arrtime.
        ENDLOOP.
      ENDMETHOD.                    "show_data
    ENDCLASS.                    "main IMPLEMENTATION
    START-OF-SELECTION.
      DATA: main TYPE REF TO main,
            status TYPE REF TO status.
      CREATE OBJECT main.
      CALL METHOD main->get_data.
      CALL METHOD main->combine_data.
      CALL METHOD main->status~write.

    Hi,
    Check this example..., In this i implemented so many functionalities like top_of_page, drop_down at cell level etc.., also Check the programs BCALVEDIT also
    Just check it.
    REPORT  ZTEST_ALV_OO    MESSAGE-ID ZZ                           .
    DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: L_VALID TYPE C,
          V_FLAG,
          V_DATA_CHANGE,
          V_ROW TYPE LVC_S_ROW,
          V_COLUMN TYPE LVC_S_COL,
          V_ROW_NUM TYPE LVC_S_ROID.
    DATA: IT_ROW_NO TYPE LVC_T_ROID,
          X_ROW_NO TYPE LVC_S_ROID.
    DATA:BEGIN OF  ITAB OCCURS 0,
         VBELN LIKE LIKP-VBELN,
         POSNR LIKE LIPS-POSNR,
         CELLCOLOR TYPE LVC_T_SCOL, "required for color
         DROP(10),
         check,
         END OF ITAB.
    "The Below Definitions Must.....
    DATA:
    * Reference to document
           DG_DYNDOC_ID       TYPE REF TO CL_DD_DOCUMENT,
    * Reference to split container
           DG_SPLITTER          TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
    * Reference to grid container
           DG_PARENT_GRID     TYPE REF TO CL_GUI_CONTAINER,
    * Reference to html container
           DG_HTML_CNTRL        TYPE REF TO CL_GUI_HTML_VIEWER,
    * Reference to html container
           DG_PARENT_HTML     TYPE REF TO CL_GUI_CONTAINER.
    "up to here
    *       CLASS lcl_event_handler DEFINITION
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION .
        METHODS:
    **Hot spot Handler
        HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
                          IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
    **Double Click Handler
        HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
                                         IMPORTING E_ROW E_COLUMN ES_ROW_NO,
        TOP_OF_PAGE FOR EVENT TOP_OF_PAGE              "event handler
                             OF CL_GUI_ALV_GRID
                             IMPORTING E_DYNDOC_ID.
    *        END_OF_LIST FOR EVENT end_of_list              "event handler
    *                         OF CL_GUI_ALV_GRID
    *                         IMPORTING E_DYNDOC_ID.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    *       CLASS lcl_event_handler IMPLEMENTATION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    *Handle Hotspot Click
      METHOD HANDLE_HOTSPOT_CLICK .
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW_ID.
        V_COLUMN = E_COLUMN_ID.
        V_ROW_NUM = ES_ROW_NO.
    *    MESSAGE I000 WITH V_ROW 'clicked'.
        CLEAR IT_ROW_NO[].
        X_ROW_NO-ROW_ID = V_ROW.
        APPEND X_ROW_NO TO IT_ROW_NO .
        CALL METHOD G_GRID->SET_SELECTED_ROWS
          EXPORTING
            IT_ROW_NO = IT_ROW_NO.
      ENDMETHOD.                    "lcl_event_handler
    *Handle Double Click
      METHOD  HANDLE_DOUBLE_CLICK.
        CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
        V_ROW  = E_ROW.
        V_COLUMN = E_COLUMN.
        V_ROW_NUM = ES_ROW_NO.
        IF E_COLUMN = 'VBELN'.
          SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
          CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
        ENDIF.
        IF E_COLUMN = 'POSNR'.
          SET PARAMETER ID 'VL' FIELD ITAB-VBELN.
          CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN."
        ENDIF.
      ENDMETHOD.                    "handle_double_click
    *  METHOD END_OF_LIST.                   "implementation
    ** Top-of-page event
    *    PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
    *  ENDMETHOD.                            "top_of_page
        METHOD TOP_OF_PAGE.                   "implementation
    * Top-of-page event
        PERFORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID.
      ENDMETHOD.                            "top_of_page
    ENDCLASS.                    "LCL_EVENT_HANDLER IMPLEMENTATION
    *&             Global Definitions
    DATA:      G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container1
                G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
    DATA: OK_CODE LIKE SY-UCOMM,
          SAVE_OK LIKE SY-UCOMM,
          G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST',
          GS_LAYOUT TYPE LVC_S_LAYO.
    data: v_lines type i.
    data: v_line(3) type c.
    *- Fieldcatalog for First and second Report
    DATA: IT_FIELDCAT  TYPE  LVC_T_FCAT,
          X_FIELDCAT TYPE LVC_S_FCAT,
          LS_VARI  TYPE DISVARIANT.
    *                START-OF_SELECTION
    START-OF-SELECTION.
      SELECT VBELN
             POSNR
             FROM LIPS
             UP TO 20 ROWS
             INTO CORRESPONDING FIELDS OF TABLE ITAB.
    describe table itab lines v_lines.
    END-OF-SELECTION.
      IF NOT ITAB[] IS INITIAL.
        CALL SCREEN 100.
      ELSE.
        MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
      ENDIF.
    *&      Form  CREATE_AND_INIT_ALV
    *       text
    FORM CREATE_AND_INIT_ALV .
      DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
      "attention.....from here
      "split your container here...into two parts
      "create the container
      CREATE OBJECT G_CUSTOM_CONTAINER
               EXPORTING CONTAINER_NAME = G_CONTAINER1.
      "this is for top of page
    * Create TOP-Document
      CREATE OBJECT DG_DYNDOC_ID
                       EXPORTING STYLE = 'ALV_GRID'.
    * Create Splitter for custom_container
      CREATE OBJECT DG_SPLITTER
                 EXPORTING PARENT  = G_CUSTOM_CONTAINER
                           ROWS    = 2
                           COLUMNS = 1.
    * Split the custom_container to two containers and move the reference
    * to receiving containers g_parent_html and g_parent_grid
      "i am allocating the space for grid and top of page
      CALL METHOD DG_SPLITTER->GET_CONTAINER
        EXPORTING
          ROW       = 1
          COLUMN    = 1
        RECEIVING
          CONTAINER = DG_PARENT_HTML.
      CALL METHOD DG_SPLITTER->GET_CONTAINER
        EXPORTING
          ROW       = 2
          COLUMN    = 1
        RECEIVING
          CONTAINER = DG_PARENT_GRID.
    *  CALL METHOD DG_SPLITTER->GET_CONTAINER
    *    EXPORTING
    *      ROW       = 2
    *      COLUMN    = 1
    *    RECEIVING
    *      CONTAINER = DG_PARENT_HTML.
    *  CALL METHOD DG_SPLITTER->GET_CONTAINER
    *    EXPORTING
    *      ROW       = 1
    *      COLUMN    = 1
    *    RECEIVING
    *      CONTAINER = DG_PARENT_GRID.
      "you can set the height of it
    * Set height for g_parent_html
      CALL METHOD DG_SPLITTER->SET_ROW_HEIGHT
        EXPORTING
          ID     = 1
          HEIGHT = 5.
      "from here as usual..you need to specify parent as splitter part
      "which we alloted for grid
      CREATE OBJECT G_GRID
             EXPORTING I_PARENT = DG_PARENT_GRID.
    * Set a titlebar for the grid control
      CLEAR GS_LAYOUT.
      GS_LAYOUT-GRID_TITLE = TEXT-003.
      GS_LAYOUT-ZEBRA = SPACE.
      GS_LAYOUT-CWIDTH_OPT = 'X'.
      GS_LAYOUT-NO_ROWMARK = 'X'.
      GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
      CALL METHOD G_GRID->REGISTER_EDIT_EVENT
        EXPORTING
          I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_ENTER.
      CREATE OBJECT G_HANDLER.
      SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
      SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
    *  SET HANDLER G_HANDLER->END_OF_LIST FOR G_GRID.
      SET HANDLER G_HANDLER->TOP_OF_PAGE FOR G_GRID.
      DATA: LS_CELLCOLOR TYPE LVC_S_SCOL. "required for color
      DATA: L_INDEX TYPE SY-TABIX.
      "Here i am changing the color of line 1,5,10...
      "so you can change the color of font conditionally
      LOOP AT ITAB.
        L_INDEX = SY-TABIX.
        IF L_INDEX = 1 OR L_INDEX = 5 OR L_INDEX = 10.
          LS_CELLCOLOR-FNAME = 'VBELN'.
          LS_CELLCOLOR-COLOR-COL = '6'.
          LS_CELLCOLOR-COLOR-INT = '0'.
          LS_CELLCOLOR-COLOR-INV = '1'.
          APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
          MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
          LS_CELLCOLOR-FNAME = 'POSNR'.
          LS_CELLCOLOR-COLOR-COL = '6'.
          LS_CELLCOLOR-COLOR-INT = '0'.
          LS_CELLCOLOR-COLOR-INV = '1'.
          APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
          MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
        ENDIF.
      ENDLOOP.
    * setting focus for created grid control
      CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
        EXPORTING
          CONTROL = G_GRID.
    * Build fieldcat and set editable for date and reason code
    * edit enabled. Assign a handle for the dropdown listbox.
      PERFORM BUILD_FIELDCAT.
      PERFORM  SET_DRDN_TABLE.
    * Optionally restrict generic functions to 'change only'.
    *   (The user shall not be able to add new lines).
      PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
    **Vaiant to save the layout
      LS_VARI-REPORT      = SY-REPID.
      LS_VARI-HANDLE      = SPACE.
      LS_VARI-LOG_GROUP   = SPACE.
      LS_VARI-USERNAME    = SPACE.
      LS_VARI-VARIANT     = SPACE.
      LS_VARI-TEXT        = SPACE.
      LS_VARI-DEPENDVARS  = SPACE.
    **Calling the Method for ALV output
      CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
          IS_VARIANT           = LS_VARI
          IS_LAYOUT            = GS_LAYOUT
          I_SAVE               = 'A'
        CHANGING
          IT_FIELDCATALOG      = IT_FIELDCAT
          IT_OUTTAB            = ITAB[].
      "do these..{
    * Initializing document
      CALL METHOD DG_DYNDOC_ID->INITIALIZE_DOCUMENT.
    * Processing events
      CALL METHOD G_GRID->LIST_PROCESSING_EVENTS
        EXPORTING
          I_EVENT_NAME = 'TOP_OF_PAGE'
          I_DYNDOC_ID  = DG_DYNDOC_ID.
      "end }
    * Set editable cells to ready for input initially
      CALL METHOD G_GRID->SET_READY_FOR_INPUT
        EXPORTING
          I_READY_FOR_INPUT = 1.
    ENDFORM.                               "CREATE_AND_INIT_ALV
    *&      Form  EXCLUDE_TB_FUNCTIONS
    *       text
    *      -->PT_EXCLUDE text
    FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
    * Only allow to change data not to create new entries (exclude
    * generic functions).
      DATA LS_EXCLUDE TYPE UI_FUNC.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  build_fieldcat
    *       Fieldcatalog
    FORM BUILD_FIELDCAT .
      DATA: L_POS TYPE I.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Check'.
      X_FIELDCAT-FIELDNAME = 'CHECK'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-CHECKbox   = 'X'.
        X_FIELDCAT-EDIT = 'X'.
      X_FIELDCAT-OUTPUTLEN = '1'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
      X_FIELDCAT-FIELDNAME = 'VBELN'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-NO_ZERO    = 'X'.
      X_FIELDCAT-OUTPUTLEN = '10'.
      X_FIELDCAT-HOTSPOT = 'X'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Item'(025).
      X_FIELDCAT-FIELDNAME = 'POSNR'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '5'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
      L_POS = L_POS + 1.
      X_FIELDCAT-SCRTEXT_M = 'Drop'(025).
      X_FIELDCAT-FIELDNAME = 'DROP'.
      X_FIELDCAT-TABNAME = 'IT_FINAL'.
      X_FIELDCAT-COL_POS    = L_POS.
      X_FIELDCAT-OUTPUTLEN = '5'.
      X_FIELDCAT-EDIT = 'X'.
      X_FIELDCAT-DRDN_HNDL = '1'.
      X_FIELDCAT-DRDN_ALIAS = 'X'.
      APPEND X_FIELDCAT TO IT_FIELDCAT.
      CLEAR X_FIELDCAT.
    ENDFORM.                    " build_fieldcat
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      IF G_CUSTOM_CONTAINER IS INITIAL.
    **Initializing the grid and calling the fm to Display the O/P
        PERFORM CREATE_AND_INIT_ALV.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  SET_DRDN_TABLE
    *       text
    FORM SET_DRDN_TABLE.
      DATA:LT_DRAL TYPE LVC_T_DRAL,
            LS_DRAL TYPE LVC_S_DRAL.
      LOOP AT ITAB .
    * First listbox (handle '1').
        IF SY-INDEX = 1.
          LS_DRAL-HANDLE = '1'.
          LS_DRAL-VALUE =  ' '.
          LS_DRAL-INT_VALUE =  ' '.
        ELSE.
          LS_DRAL-HANDLE = '1'.
          LS_DRAL-VALUE =  ITAB-POSNR.
          LS_DRAL-INT_VALUE =  ITAB-POSNR.
        ENDIF.
        APPEND LS_DRAL TO LT_DRAL.
      ENDLOOP.
    **Setting the Drop down table for Reason Code
      CALL METHOD G_GRID->SET_DROP_DOWN_TABLE
        EXPORTING
          IT_DROP_DOWN_ALIAS = LT_DRAL.
    ENDFORM.                               " set_drdn_table
    *&      Form  EVENT_TOP_OF_PAGE
    *       text
    *      -->DG_DYNDOC_ID  text
    FORM EVENT_TOP_OF_PAGE USING   DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.
      "this is more clear.....check it
      "first add text, then pass it to comentry write fm
      DATA : DL_TEXT(255) TYPE C.  "Text
    * Populating header to top-of-page
      CALL METHOD DG_DYNDOC_ID->ADD_TEXT
        EXPORTING
          TEXT      = 'Test Report'
          SAP_STYLE = CL_DD_AREA=>HEADING.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move program ID
      CONCATENATE 'Program Name :' SY-REPID
             INTO DL_TEXT SEPARATED BY SPACE.
    * Add Program Name to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move User ID
      CONCATENATE 'User ID :' SY-UNAME INTO DL_TEXT SEPARATED BY SPACE
    * Add User ID to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move count (no of records).
      move v_lines to v_line.
      CONCATENATE 'No of records :' v_line INTO DL_TEXT SEPARATED BY SPACE.
    * Add Client to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move date
      WRITE SY-DATUM TO DL_TEXT.
      CONCATENATE 'Date :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
    * Add Date to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
      CLEAR : DL_TEXT.
    * Move time
      WRITE SY-UZEIT TO DL_TEXT.
      CONCATENATE 'Time :' DL_TEXT INTO DL_TEXT SEPARATED BY SPACE.
    * Add Time to Document
      PERFORM ADD_TEXT USING DL_TEXT.
    * Add new-line
      CALL METHOD DG_DYNDOC_ID->NEW_LINE.
    * Populating data to html control
      PERFORM HTML.
    ENDFORM.                    " EVENT_TOP_OF_PAGE
    *&      Form  ADD_TEXT
    *       To add Text
    FORM ADD_TEXT USING P_TEXT TYPE SDYDO_TEXT_ELEMENT.
    * Adding text
      CALL METHOD DG_DYNDOC_ID->ADD_TEXT
        EXPORTING
          TEXT         = P_TEXT
          SAP_EMPHASIS = CL_DD_AREA=>HEADING.
    ENDFORM.                    " ADD_TEXT
    *&      Form  HTML
    *       text
    FORM HTML.
      DATA : DL_LENGTH  TYPE I,                           " Length
             DL_BACKGROUND_ID TYPE SDYDO_KEY VALUE SPACE. " Background_id
    * Creating html control
      IF DG_HTML_CNTRL IS INITIAL.
        CREATE OBJECT DG_HTML_CNTRL
             EXPORTING
                  PARENT    = DG_PARENT_HTML.
      ENDIF.
    * Reuse_alv_grid_commentary_set
      CALL FUNCTION 'REUSE_ALV_GRID_COMMENTARY_SET'
        EXPORTING
          DOCUMENT = DG_DYNDOC_ID
          BOTTOM   = SPACE
        IMPORTING
          LENGTH   = DL_LENGTH.
    * Get TOP->HTML_TABLE ready
      CALL METHOD DG_DYNDOC_ID->MERGE_DOCUMENT.
    * Set wallpaper
      CALL METHOD DG_DYNDOC_ID->SET_DOCUMENT_BACKGROUND
        EXPORTING
          PICTURE_ID = DL_BACKGROUND_ID.
    * Connect TOP document to HTML-Control
      DG_DYNDOC_ID->HTML_CONTROL = DG_HTML_CNTRL.
    * Display TOP document
      CALL METHOD DG_DYNDOC_ID->DISPLAY_DOCUMENT
        EXPORTING
          REUSE_CONTROL      = 'X'
          PARENT             = DG_PARENT_HTML
        EXCEPTIONS
          HTML_DISPLAY_ERROR = 1.
      IF SY-SUBRC NE 0.
        MESSAGE I999 WITH 'Error in displaying top-of-page'(036).
      ENDIF.
    ENDFORM.                    " HTML
    Regards
    vijay

  • I have a mac mini server which I want to set up for remote access from windows and mac pcs.  How do I do this.  I can access it form my home network OK

    I have a mac mini server which I want to set up for remote access from windows and mac pcs.  How do I do this.  I can access it form my home network OK

    Posted in error.

  • How to implement 'hypelink' in ALV GRID

    Hi,everybody,please tell me how to implement 'hypelink' in ALV GRID?
    I just try to design a ALV GRID report but I do not kown the way of using 'hypelink'.  I refer to some documents but failsed.     somebody can help me and give a example including entire code.

    1. Create a table where hyperlinks & corresponding handles are stored (TYpe LVC_T_HYPE)
    DATA ls_hype TYPE lvc_s_hype .
    data lt_hype type lvc_t_hype.
    ls_hype-handle = '1' .
    ls_hype-href = 'http://www.company.com/carrids/car1' .
    APPEND ls_hype TO lt_hype .
    2. In your list data table create additional field of type INT4 which will contain the handle of the hyper link (ex. '1' for above hyperlink)
    DATA carrid_handle TYPE int4 .
    3. For the field which shall contain the hyperlink, make an entry in the field catalog indicating the field name which contains handle for the hyperlink. This is done by setting the handle field name in WEB_FIELD.
    ls_fieldcat-fieldname = 'CARRID'
    ls_fieldcat-web_field = 'CARRID_HANDLE'.
    4. While calling set_table_for_first_display, pass the hyperlink table created in step 1 to parameter 'it_hyperlink'
    ~Piyush Patil

  • I need simple example for alv grid

    hi
    i need code for simple example for alv grid.
    thanks.

    hi bharat,
                  this is report with most of the functionality.
    report zus_alv_demo_grid .
    tables:     ekko.
    type-pools: slis.
    types: begin of t_ekko,
    ebeln type ekpo-ebeln,
    ebelp type ekpo-ebelp,
    statu type ekpo-statu,
    aedat type ekpo-aedat,
    matnr type ekpo-matnr,
    menge type ekpo-menge,
    meins type ekpo-meins,
    netpr type ekpo-netpr,
    peinh type ekpo-peinh,
    line_color(4) type c, "Used to store row color
    end of t_ekko.
    data: it_ekko type standard table of t_ekko initial size 0,
           wa_ekko type t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid.
    Data declaration for EVENT and PRINT PARAMETER.
    data: gt_events type slis_t_event,
           gd_prntparams type slis_print_alv.
    data declaration for sorting.
    data : it_sortcat   type slis_sortinfo_alv occurs 1,
           wa_sort like line of it_sortcat.
    data :  i_list_comments type slis_t_listheader.
    start-of-selection.
      perform data_retrieval.
    perform user_command.
      perform build_fieldcatalog.
      perform build_layout.
      perform build_events.
      perform build_print_params.
      perform build_sortcat.
      perform display_alv_report.
    end-of-selection.
    *TOP-OF-PAGE.
    PERFORM top-of-page.
    end-of-page.
    *&      Form  build_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      fieldcatalog-do_sum = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " build_fieldcatalog
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    Set layout field for row attributes(i.e. color)
      gd_layout-info_fieldname =      'LINE_COLOR'.
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for
    *when double
                                            "click(press f2)*
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " build_layout
    *&      Form  data_retrieval
          text
    -->  p1        text
    <--  p2        text
    form data_retrieval.
      data: ld_color(1) type c.
      select ebeln ebelp statu aedat matnr menge meins netpr
    peinh from ekpo  into table it_ekko.
    *Populate field with color attributes
      loop at it_ekko into wa_ekko.
    Populate color variable with colour properties
    Char 1 = C (This is a color property)
    Char 2 = 3 (Color codes: 1 - 7)
    Char 3 = Intensified on/off ( 1 or 0 )
    Char 4 = Inverse display on/off ( 1 or 0 )
              i.e. wa_ekko-line_color = 'C410'
        ld_color = ld_color + 1.
    Only 7 colours so need to reset color value
        if ld_color = 8.
          ld_color = 1.
        endif.
        concatenate 'C' ld_color '10' into wa_ekko-line_color.
    wa_ekko-line_color = 'C410'.
        modify it_ekko from wa_ekko.
      endloop.
    endform.                    " data_retrieval
    *&      Form  display_alv_report
          text
    -->  p1        text
    <--  p2        text
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = gd_repid
                is_layout                = gd_layout
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_user_command  = 'USER_COMMAND'
                i_callback_pf_status_set = 'SET_PF_STATUS'
                it_event                 = gt_events
                is_print                 = gd_prntparams
                it_fieldcat              = fieldcatalog[]
                it_sort                 = it_sortcat
                i_save                   = 'X'
           tables
                t_outtab                 = it_ekko
           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.
    endform.              " DISPLAY_ALV_REPORT
    *&      Form  user_command
          text
    -->  p1        text
    <--  p2        text
    *&      Form  top-of-page
          text
    -->  p1        text
    <--  p2        text
    form top-of-page.
    *ALV Header declarations
      data: t_header type slis_t_listheader,
            wa_header type slis_listheader,
            t_line like wa_header-info,
            ld_lines type i,
            ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      concatenate  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
       sy-datum(4) into wa_header-info."todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
         into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
           it_list_commentary = t_header
           i_logo             = 'GANESH_LOGO'.
    endform.                    " top-of-page
          FORM user_command                                             *
    -->  R_UCOMM                                                       *
    -->  RS_SELFIELD                                                   *
    form user_command using r_ucomm like sy-ucomm
    rs_selfield type slis_selfield.
      case r_ucomm.
        when '&IC1'.
          if rs_selfield-fieldname = 'EBELN'.
            read table it_ekko into wa_ekko index rs_selfield-tabindex.
            set parameter id 'BES' field wa_ekko-ebeln.
            call transaction 'ME23N' and skip first screen.
          endif.
        when 'ULHAS'.
          if rs_selfield-fieldname = 'EBELN'.
            read table it_ekko into wa_ekko index rs_selfield-tabindex.
            set parameter id 'BES' field wa_ekko-ebeln.
            call transaction 'ME23N' and skip first screen.
          endif.
      endcase.
    endform.
          FORM set_pf_status                                            *
    -->  RT_EXTAB                                                      *
    form set_pf_status using rt_extab type slis_t_extab.
      set pf-status 'ZNEWSTATUS'.
    endform.
    *&      Form  build_events
          text
    -->  p1        text
    <--  p2        text
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
       exporting
         i_list_type           = 0
       importing
         et_events             = gt_events[]
    EXCEPTIONS
      LIST_TYPE_WRONG       = 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.
      read table gt_events with key name =  slis_ev_end_of_page
                  into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
      read table gt_events with key name =  slis_ev_end_of_list
                  into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " build_events
    *&      Form  build_print_params
          text
    -->  p1        text
    <--  p2        text
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " build_print_params
          FORM END_OF_PAGE                                              *
    form end_of_page.
      data: listwidth type i,
      ld_pagepos(10) type c,
      ld_page(10)    type c.
      write: sy-uline(50).
      skip.  write:/40 'Page:', sy-pagno .
    endform.
          FORM END_OF_LIST                                              *
    form end_of_list.
      data: listwidth type i,
      ld_pagepos(10) type c,
      ld_page(10)    type c.
      skip.  write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  build_sortcat
          text
    -->  p1        text
    <--  p2        text
    form build_sortcat.
    wa_sort-spos      = 1.
    wa_sort-fieldname = 'EBELN'.
    append wa_sort to it_sortcat.
    wa_sort-spos      = 2.
    wa_sort-fieldname = 'EBELP'.
    append wa_sort to it_sortcat.
    endform.                    " build_sortcat
    Rewards if helpfull
    regards
    vijay dwivedi

  • About Variants in ALV grid

    Hi all,
    I am displaying 4grids on a TAB Strip in ALV
    i have created one variant for each grid(report)
    But when i run the prog and press on F4 help for variant parameter, i am getting variants of all the grids
    Is there any way to get only those variants related to a particular grid.
    thanks in advance

    Hi,
    Specify different variant handles for each of the four grids. Some thing like the following,
    <b>ls_variant-report = <your program name>.</b>
    ****Set following handler different for each grid ****reference
    ****something like 'GRD1', 'GRD2' and so on..
    <b>ls_variant-handle = <your grid handle 4 characters>.</b>
        CALL METHOD ref_grid->set_table_for_first_display
          EXPORTING
          I_BYPASSING_BUFFER            =
          I_BUFFER_ACTIVE               =
          I_CONSISTENCY_CHECK           =
          I_STRUCTURE_NAME              =
    <b>        is_variant                    = ls_variant</b>
            i_save                        = 'A'
          I_DEFAULT                     = 'X'
            is_layout                     = ls_layout
          IS_PRINT                      =
          IT_SPECIAL_GROUPS             =
          it_toolbar_excluding          =
          IT_HYPERLINK                  =
          IT_ALV_GRAPHICS               =
          IT_EXCEPT_QINFO               =
          CHANGING
            it_outtab                     = lt_data
            it_fieldcatalog               = lt_fcat
          IT_SORT                       =
          IT_FILTER                     =
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
    Hope this helps..
    Sri
    Message was edited by: Srikanth Pinnamaneni

  • How to create variant for table/view ?

    Hi,
    When I go through SM30, I find a radio button called variant. I don't know the effect.
    Can anyone tell me how to create variant for table / view ?
    I want to know when we need to create variant for table/view.
    Best regards,
    Chris Gu

    hi ,
    Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.
    For further information about selection screens, refer to Selection Screens in the ABAP User's Guide.
    If you often run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant
    Procedure
    To create a new variant:
           1.      On the ABAP Editor initial screen, enter the name of the program for which you want to create a variant, select Variants, and choose Change.
           2.      On the variant maintenance initial screen, enter the name of the variant to be created.
    Note the naming convention for variants (see below).
           3.      Choose Create.
    If the program has more than one selection screen, a dialog box for screen assignment appears. The dialog box does not appear if the program only has one selection screen. The selection screen appears in this case.
           4.      If there is more than one selection screen, select the screens for which you want to create the variant
    5.      Choose Continue.
    The (first) selection screen for the report appears.
    If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them and to fill the fields with values. If you keep scrolling forwards, the Continue button appears on the last selection screen.
           6.      Enter the desired selection values, including multiple selection and dynamic selection.
           7.      Choose Continue.

Maybe you are looking for

  • GR/IR clearing with tolerances

    Hi, Where do you specify the tolarences for GR/IR clearing?

  • Problems in JNLP only in jre1.6

    I am having a JNLP application. It works fine in 1.4 and 1.5 versions. But i had a problem in 1.6 versions. some jars is missing error is occurring. For the first time its working fine in 1.6. If i again open the application its throws the NoClassfou

  • Sun AppServer 9.0 Update 1 on Solaris not supporting form-based auth

    Ok, I installed Appserver 9 on a Solaris box and then started up the default domain1. When I point the browser to http://localhost:4848 I am not pointed to the login page for the admingui, it just bypasses the authentication and I am allowed to perfo

  • Where to place a bean class in Tomcat 5.0

    Hi, I wrote a bean class and calling the bean class in the JSP file using the useBean tag. I am encountring an INTERNAL SERVER ERROR. At present i have placed my jsp-file,source-file, and class-file in jsp-examples folder. Did i place any files in th

  • How to reconfigure Oracle-xe (Oracle 10g for linux)?

    Hello! I found this article (seems useful since I use Mandriva 2010.2): [http://www.e-angel.net/index.php?tg=articles&idx=Print&topics=195&article=912|http://www.e-angel.net/index.php?tg=articles&idx=Print&topics=195&article=912] I installed Oracle 1