Alv grid format

I hav an internal table with 35 fields. I want to get the output in the ALV grid format.
How can i Pl help me

Hi
Dont bother about how many fields are there in internal table just write your coding in a simple and easy way such that there should not be any performance issue
Check this sample report
*& Report  ZALVGRID_WITH_RADIOBUTTONS                                  *
REPORT  ZALVGRID_WITH_RADIOBUTTONS              .
TYPE-POOLS: abap, icon. " INCLUDE <icon>. for releases < 6.20
TYPES: BEGIN OF ty_s_sflight.
INCLUDE TYPE sflight.
TYPES: button1 TYPE iconname.
TYPES: button2 TYPE iconname.
TYPES: button3 TYPE iconname.
TYPES: button4 TYPE iconname.
TYPES: END OF ty_s_sflight.
DATA:gt_sflight TYPE STANDARD TABLE OF ty_s_sflight,
     gs_layout TYPE lvc_s_layo,
     gt_fcat TYPE lvc_t_fcat.
DATA:gd_okcode TYPE ui_func,
     go_docking TYPE REF TO cl_gui_docking_container,
     go_grid TYPE REF TO cl_gui_alv_grid.
*icon_wd_radio_button_empty TYPE REF TO icon_wd_radio_button_empty.
* 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
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 = 'REFRESH'
* IMPORTING
* RC =
ENDMETHOD. "handle_hotspot_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
* MAIN *
START-OF-SELECTION.
PERFORM select_data.
PERFORM init_controls.
PERFORM build_fieldcatalog.
PERFORM set_layout.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
* i_structure_name = 'SFLIGHT'
is_layout = gs_layout
CHANGING
it_fieldcatalog = gt_fcat
it_outtab = gt_sflight.
* Link docking container to dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
lifetime_dynpro_dynpro_link = 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.
CALL SCREEN 100.
END-OF-SELECTION.
* MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
ENDMODULE. "PBO OUTPUT
* MODULE PAI INPUT *
MODULE pai INPUT.
* Leave report
CASE gd_okcode.
WHEN 'BACK' OR
'EXIT' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
* Refresh table display
WHEN 'REFRESH'.
PERFORM refresh_display.
WHEN OTHERS.
* do nothing
ENDCASE.
CLEAR gd_okcode.
ENDMODULE. "PAI INPUT
*& Form BUILD_FIELDCATALOG
* text
* --> p1 text
* <-- p2 text
FORM build_fieldcatalog .
* define local data
DATA:
ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'ICON'
* 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 <> 'NAME' ).
* NOTE: field ICON-NAME has data element ICONNAME.
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 = 'NAME'.
IF ( syst-subrc = 0 ).
DELETE gt_fcat INDEX syst-tabix.
ENDIF.
ls_fcat-fieldname = 'BUTTON4'.
ls_fcat-coltext = ls_fcat-fieldname.
ls_fcat-icon = 'X'.
ls_fcat-hotspot = 'X'.
INSERT ls_fcat INTO gt_fcat INDEX 5.
ls_fcat-fieldname = 'BUTTON3'.
ls_fcat-coltext = ls_fcat-fieldname.
INSERT ls_fcat INTO gt_fcat INDEX 5.
ls_fcat-fieldname = 'BUTTON2'.
ls_fcat-coltext = ls_fcat-fieldname.
INSERT ls_fcat INTO gt_fcat INDEX 5.
ls_fcat-fieldname = 'BUTTON1'.
ls_fcat-coltext = ls_fcat-fieldname.
INSERT ls_fcat INTO gt_fcat INDEX 5.
* Renumbering of the columns
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. " selected radiobutton
ls_sflight-button2 = icon_wd_radio_button_empty.
ls_sflight-button3 = icon_wd_radio_button_empty.
ls_sflight-button4 = icon_wd_radio_button_empty.
* Alternatively: create icons using function module 'ICON_CREATE'
* on SAP releases where these icons are not available.
MODIFY gt_sflight FROM ls_sflight
TRANSPORTING button1 button2 button3 button4
WHERE ( carrid IS NOT INITIAL ).
ENDFORM. " SELECT_DATA
*& Form INIT_CONTROLS
* text
* --> p1 text
* <-- p2 text
FORM init_controls .
CHECK ( go_docking IS NOT BOUND ).
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
* REPID =
* DYNNR =
* SIDE = DOCK_AT_LEFT
* EXTENSION = 50
* STYLE =
* LIFETIME = lifetime_default
* CAPTION =
* METRIC = 0
ratio = 90
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
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.
* Size of container = full screen size
CALL METHOD go_docking->set_extension
EXPORTING
extension = 99999
EXCEPTIONS
cntl_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.
* Create ALV grid instance
CREATE OBJECT go_grid
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
i_parent = go_docking
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
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 for event HOTSPOT_CLICK
SET HANDLER:
lcl_eventhandler=>handle_hotspot_click FOR go_grid.
ENDFORM. " INIT_CONTROLS
*& Form REFRESH_DISPLAY
* Refresh table display after switching the radiobuttons
* --> p1 text
* <-- p2 text
FORM refresh_display .
* define local data
DATA:
ls_stable TYPE lvc_s_stbl.
ls_stable-row = abap_true.
ls_stable-col = abap_true.
CALL METHOD go_grid->refresh_table_display
EXPORTING
is_stable = ls_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.
ENDFORM. " REFRESH_DISPLAY
*& Form SET_LAYOUT
* Set layout for ALV list
* --> p1 text
* <-- p2 text
FORM set_layout .
CLEAR: gs_layout.
gs_layout-cwidth_opt = abap_true. " optimize column width
gs_layout-zebra = abap_true.
ENDFORM. " SET_LAYOUT
Reward all helpfull answers
Regards
Pavan

Similar Messages

  • ALV GRID FORMAT IN BACKGROUND

    Dear All,
             There is t code called MB51 which the user use, we recommend them to execute that report in the background using this method -- t code-- execute in background--- enter the printer name and generate the temporary spool to veiw the report, however when we veiw that report using spo2, the <b>tool bar</b> (that comes when we execute  in the foreround) is missing, which is used to veiw it in the ALV grid format, actually the user easily select the feilds in that format and download them to excel sheets, in the background that <b>" Details"</b> <b>option</b> is not there, is there any work around for this.
    Thanks,..
    Ravi.

    Hi Clemens,
    Thanks for that valuable suggestion, atleast I got a direction to think about, so from here on its gotta be xml...
    But, since I have no idea about xml coding, also I went through those 2 links you had sent, but I'm still unable to understand the following points:
    1.How do I generate the xml code, relevant to formatting that I did in ALV Grid using the FM "REUSE_ALV_GRID_DISPLAY"?
    2. How do I go about saving the xml file onto the Application server?
    3. Can you please provide any sample ALV report code, where such XML formatting has been used?
    Thanks in advance.
    Regards,
    Azeem Ahmed Matte

  • Regarding downlaod the output from ALV grid format

    Hi 
    i want to download the output ALV grid format into excel sheet .
    but condition is when ever user press the button (&ZDL) the should be downloaded.
    and also how to convert the output into CSV format.

    hi,
    when '&ZDL'.
    use this condition
    check this one for down loading
    try to download an ALV report in excel format using (list ->export -> local file-> soread sheet )
    Re: advantages of alv reports
    Excel Download to ALV report
    hi this is full program
    REPORT ZCR_BOMPLANT_DOWNLOAD.
    TABLES : MAST , "Material to BOM Link
    STKO , "BOM Header
    MARA . "General Material Data
    TYPES : BEGIN OF TY_MASTER ,
    MATNR TYPE MAST-MATNR , "Material Number
    WERKS TYPE MAST-WERKS , "Plant
    STLAN TYPE MAST-STLAN , "BOM Usage
    STLNR TYPE MAST-STLNR , "Bill of material
    STLAL TYPE MAST-STLAL , "Alternative BOM
    ANDAT TYPE MAST-ANDAT , "Date record created on
    AEDAT TYPE MAST-AEDAT , "Date of Last Change
    AENAM TYPE MAST-AENAM , "Name of Person Who Changed Object
    STLST TYPE STKO-STLST , "BOM status
    ZPLP1 TYPE MBEW-ZPLP1 , "Future Planned Price 1
    DWERK TYPE MVKE-DWERK , "Delivering Plant (Own or External)
    END OF TY_MASTER .
    TYPES : MY_TYPE(20) TYPE C.
    DATA : IT_MASTER TYPE STANDARD TABLE OF TY_MASTER,
    WA_MASTER TYPE TY_MASTER .
    DATA : IT_HEADER TYPE TABLE OF MY_TYPE.
    DATA : W_PTH TYPE RLGRAP-FILENAME.
    DATA : W_FILE TYPE RLGRAP-FILENAME.
    *--- Add Header Fields to Header Table ---
    APPEND 'Material Number' TO IT_HEADER .
    APPEND 'Plant' TO IT_HEADER .
    APPEND 'BOM Usage' TO IT_HEADER .
    APPEND 'Bill Code' TO IT_HEADER .
    APPEND 'Alternative BOM' TO IT_HEADER .
    APPEND 'Created On' TO IT_HEADER .
    APPEND 'Changed On' TO IT_HEADER .
    APPEND 'Changed By' TO IT_HEADER .
    APPEND 'BOM Status' TO IT_HEADER .
    APPEND 'Planned Price' TO IT_HEADER .
    APPEND 'Delivery Plant' TO IT_HEADER .
    IF SY-MANDT = '700'.
    W_PTH = '
    lkdb01\ISD\IS\Software Developments\Developments\Data Files\SAP Dumps\BOM_Available\'.
    ELSE.
    W_PTH = 'C:\'.
    ENDIF.
    START-OF-SELECTION.
    *--- Load Data to Internal Table ---
    SELECT MASTMATNR MASTWERKS MASTSTLAN MASTSTLNR MASTSTLAL MASTANDAT MASTAEDAT MASTAENAM STKO~STLST
    INTO TABLE IT_MASTER
    FROM MAST
    INNER JOIN STKO ON STKOSTLNR EQ MASTSTLNR
    AND STKOSTLAL EQ MASTSTLAL
    INNER JOIN MARA ON MARAMATNR EQ MASTMATNR
    WHERE MARA~MTART LIKE 'ZFG%'
    AND STKO~LKENZ NE 'X'
    AND STKO~LOEKZ NE 'X'
    AND STKO~STLST EQ '1'.
    SELECT MAST~MATNR MAST~WERKS MAST~STLAN MAST~STLNR MAST~STLAL MAST~ANDAT MAST~AEDAT MAST~AENAM STKO~STLST MBEW~ZPLP1 MVKE~DWERK
    INTO TABLE IT_MASTER
    FROM MAST
    INNER JOIN STKO ON STKO~STLNR EQ MAST~STLNR
    AND STKO~STLAL EQ MAST~STLAL
    INNER JOIN MARA ON MARA~MATNR EQ MAST~MATNR
    INNER JOIN MBEW ON MBEW~MATNR EQ MAST~MATNR
    AND MBEW~BWKEY EQ MAST~WERKS
    INNER JOIN MVKE ON MVKE~MATNR EQ MAST~MATNR
    WHERE MARA~MTART LIKE 'ZFG%'
    AND STKO~LKENZ NE 'X'
    AND STKO~LOEKZ NE 'X'
    AND STKO~STLST EQ '1'.
    IF SY-SUBRC <> 0.
    MESSAGE I014(ZLOAD).
    ENDIF.
    *--- Set Path to Function Module ---
    CONCATENATE W_PTH SY-DATUM ' - ' 'BOM_AVAILABLE_PLANT.XLS' INTO W_FILE.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = W_FILE
    FILETYPE = 'DAT'
    TABLES
    DATA_TAB = IT_MASTER
    FIELDNAMES = IT_HEADER
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_WRITE_ERROR = 2
    INVALID_FILESIZE = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_EIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    OTHERS = 10.
    IF SY-SUBRC = 0.
    SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.
    MESSAGE I023(ZLOAD) WITH text-001.
    ELSE.
    MESSAGE I022(ZLOAD) WITH W_FILE. "Errors while downloading.
    ENDIF.
    END-OF-SELECTION.
    SUBMIT ZI005_MARA_DUMP_SOLIDEAL_N.

  • Out put in ALV grid format

    Hi,
      i need a help from you my dear friend I'm providing you the following information in which i have extract some of the fields from two internal tables and i have to display it in the alv grid format. All the work was done successfully but the problem is the values from internal table are moved but the values are not coming in output in ALV grid format. so pleease try to solve my problem.
    Thanking you
    TABLES: J_1IEXCHDR, J_1IEXCDTL.
    type-pools: slis.
    DATA: ITAB1 TYPE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
    DATA: ITAB2 TYPE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
    DATA: ITAB3 TYPE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
    DATA: OK_CODE LIKE SY-UCOMM,
          GT_SFLIGHT TYPE TABLE OF itab,
          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.
    DATA:   LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA:   GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    DATA:    G_TABNAME TYPE SLIS_TABNAME VALUE 'RTAB_ALV'.
    data: fieldcat  type slis_t_fieldcat_alv.
    data: begin of itab occurs 0,
         lifnr type j_1iexchdr-lifnr,
         docno type j_1iexchdr-docno,
         exyear type j_1iexchdr-exyear,
         budat type j_1iexchdr-budat,
         exbed type j_1iexcDTL-exbed,
         rdoc1 type j_1iexcDTL-rdoc1,
         ecs type j_1iexcDTL-ecs,
         exbas type j_1iexcDTL-exbas,
         end of itab.
    start-of-selection.
    perform get_data.
    perform call_alv.
    form get_data.
    select * into corresponding fields of table itab
             from  J_1IEXCHDR
                     inner join  J_1IEXCDTL
                        on  J_1IEXCDTLlifnr =  J_1IEXCHDRlifnr
                     where  J_1IEXCHDr~status = 'P'.
    append itab.
    endform.
    CALL_ALV
    form call_alv.
    perform build_field_catalog.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        i_callback_program = i_repid
    IT_SORT               = gt_sort
         it_fieldcat        = fieldcat[]
       TABLES
         t_outtab           = itab
       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.
    Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        it_fieldcat  = fieldcat
      tables
         t_outtab     = itab.
    endform.
    form build_field_catalog.
    clear: fieldcat. refresh: fieldcat.
    data: tmp_fc type slis_fieldcat_alv.
    tmp_fc-reptext_ddic = 'Vendor No'.
    tmp_fc-fieldname    = 'lifnr'.
    tmp_fc-tabname      = 'itab'.
    tmp_fc-outputlen    = '10'.
    append tmp_fc to fieldcat.
    tmp_fc-reptext_ddic = 'docno'.
    tmp_fc-fieldname    = 'docno'.
    tmp_fc-tabname      = 'itab'.
    tmp_fc-outputlen    = '10'.
    append tmp_fc to fieldcat.
      tmp_fc-reptext_ddic = 'exyear'.
    tmp_fc-fieldname    = 'exyear'.
    tmp_fc-tabname      = 'itab'.
    tmp_fc-outputlen    = '10'.
    append tmp_fc to fieldcat.
    tmp_fc-reptext_ddic = 'budat'.
    tmp_fc-fieldname    = 'budat'.
    tmp_fc-tabname      = 'itab'.
    tmp_fc-outputlen    = '10'.
    append tmp_fc to fieldcat.
    tmp_fc-reptext_ddic = 'exbas'.
    tmp_fc-fieldname    = 'exbas'.
    tmp_fc-tabname      = 'itab'.
    tmp_fc-outputlen    = '10'.
    append tmp_fc to fieldcat.
      tmp_fc-reptext_ddic = 'exbed'.
    tmp_fc-fieldname    = 'exbed'.
    tmp_fc-tabname      = 'itab'.
    tmp_fc-outputlen    = '10'.
    append tmp_fc to fieldcat.
    tmp_fc-reptext_ddic = 'rdoc1'.
    tmp_fc-fieldname    = 'rdoc1'.
    tmp_fc-tabname      = 'itab'.
    tmp_fc-outputlen    = '10'.
    append tmp_fc to fieldcat.
    tmp_fc-reptext_ddic = 'ecs'.
    tmp_fc-fieldname    = 'ecs'.
    tmp_fc-tabname      = 'itab'.
    tmp_fc-outputlen    = '10'.
    append tmp_fc to fieldcat.
    endform.
    *loop at itab.
    *WRITE: /  ITAB-LIFNR,
             ITAB-DOCNO,
             ITAB-EXYEAR,
             ITAB-BUDAT,
             ITAB-EXBAS,
             ITAB-EXBED,
             ITAB-RDOC1,
             ITAB-ECS.
    *endloop.

    Hi Praveen,
    In the field cat internal tabel for fieldname you have to pass the values in caps.look at the followig eg:
    tmp_fc-fieldname = 'LIFNR'.
    let me know if you still have a problem after this change.
    regards,
    Raju

  • To Display Report in a ALV GRID Format

    Hi All,
    I want to display dome information in ALV Grid format.
    Can anybody give example for displaying data in ALV Grid Format.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Hi ,
    1.FOR ALV Lists..
    REPORT Y_DEMO_ALV NO STANDARD PAGE HEADING.
    Data to be displayed
    DATA: I_SFLIGHT TYPE TABLE OF SFLIGHT.
    Selection
      SELECT * FROM SFLIGHT INTO TABLE I_SFLIGHT.
    Call ABAP List Viewer (ALV)
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_STRUCTURE_NAME   = 'SFLIGHT'
           TABLES
                T_OUTTAB           = I_SFLIGHT.
    2.Using Grids..
    REPORT Y_DEMO_ALV_1.
    Data to be displayed
    DATA: I_SFLIGHT TYPE TABLE OF SFLIGHT.
    Selection
      SELECT * FROM SFLIGHT INTO TABLE I_SFLIGHT.
    Call ABAP List Viewer (ALV)
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_STRUCTURE_NAME   = 'SFLIGHT'
           TABLES
                T_OUTTAB           = I_SFLIGHT.
    3.Demo Using most of the ALv Functionalities..
    REPORT  ZSATTRIAL4.
    TYPE-POOLS: slis.
    DB-Table
    TABLES sflight.
    Includes
    INCLUDE <icon>.
    INCLUDE <symbol>.
    CONSTANTS:
    c_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
    DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
          i_layout   TYPE slis_layout_alv,
          i_sp_group TYPE slis_t_sp_group_alv,
          i_events   TYPE slis_t_event,
          i_print    TYPE slis_print_alv,
          i_sort     TYPE slis_t_sortinfo_alv.
    *internal table for data to be displayed
    DATA: BEGIN OF i_sflight OCCURS 0.
            INCLUDE STRUCTURE sflight.
    DATA:  box,
           lights.
    DATA: END OF i_sflight.
    DATA: w_repid LIKE sy-repid.
    DATA: i_list_top_of_page TYPE slis_t_listheader.
    Report Selections
    SELECT-OPTIONS s_carrid FOR sflight-carrid.
    SELECT-OPTIONS s_connid FOR sflight-connid.
    SELECT-OPTIONS s_fldate FOR sflight-fldate.
    *SELECTION-SCREEN SKIP 1.
    Parameters
    PARAMETERS: p_maxrow TYPE i DEFAULT 30."to limit the selection
    SELECTION-SCREEN SKIP 1.
    Variant for ALV display
    SELECTION-SCREEN BEGIN OF BLOCK 0 WITH FRAME TITLE text-000.
    PARAMETERS: p_varnt LIKE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK 0.
    Layout of the report display
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
    PARAMETERS: p_zebra AS CHECKBOX DEFAULT ' ',        "Striped pattern
                p_nocolh AS CHECKBOX DEFAULT ' ',        "No column heading
                p_novlin AS CHECKBOX DEFAULT ' ',        "No vertical lines
                p_colopt AS CHECKBOX DEFAULT ' ',        "Optimizes col. wd
                p_keyhot AS CHECKBOX DEFAULT ' ',        "Key fields hot
                p_noinpt AS CHECKBOX DEFAULT ' '.        "No field for input
    SELECTION-SCREEN END OF BLOCK a.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
    PARAMETERS: p_lights AS CHECKBOX DEFAULT 'X',
                p_lightc AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK b.
    SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-003.
    PARAMETERS: p_totonl AS CHECKBOX DEFAULT ' ',
                p_totext(60),
                p_sttext(60).
    SELECTION-SCREEN END OF BLOCK c.
    SELECTION-SCREEN BEGIN OF BLOCK d WITH FRAME TITLE text-004.
    PARAMETERS: p_chkbox AS CHECKBOX DEFAULT 'X',
                p_detpop AS CHECKBOX DEFAULT 'X',
                p_groupb AS CHECKBOX DEFAULT ' ',
                p_groups AS CHECKBOX DEFAULT ' '.
    SELECTION-SCREEN END OF BLOCK d.
    SELECTION-SCREEN BEGIN OF BLOCK e WITH FRAME TITLE text-005.
    PARAMETERS: p_print AS CHECKBOX DEFAULT ' ',
                p_nosinf AS CHECKBOX DEFAULT ' ',
                p_nocove AS CHECKBOX DEFAULT ' ',
                p_nonewp AS CHECKBOX DEFAULT ' ',
                p_nolinf AS CHECKBOX DEFAULT ' ',
                p_reserv TYPE i.
    SELECTION-SCREEN END OF BLOCK e.
    DATA: w_boxnam TYPE slis_fieldname VALUE  'BOX',
                w_f2code LIKE sy-ucomm       VALUE  '&ETA',
                w_lignam TYPE slis_fieldname VALUE  'LIGHTS',
                w_save(1) TYPE c,
                w_default(1) TYPE c,
                w_exit(1) TYPE c,
                i_variant LIKE disvariant,
                i_variant1 LIKE disvariant.
    INITIALIZATION.
      w_repid = sy-repid.
      PERFORM fieldcat_init USING i_fieldcat.
      PERFORM eventtab_build USING i_events.
      PERFORM comment_build USING i_list_top_of_page.
      PERFORM sp_group_build USING i_sp_group.
      PERFORM t_sort_build USING i_sort.
    Set Options: save variant userspecific or general
    'A or 'U' are for user-specific variants list
    'X' or 'space' for general
      w_save = 'A'.
      PERFORM variant_init.
    Get default variant
      i_variant1 = i_variant.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                i_save     = w_save
           CHANGING
                cs_variant = i_variant1
           EXCEPTIONS
                not_found  = 2.
      IF sy-subrc = 0.
        p_varnt = i_variant1-variant.
      ENDIF.
    Process on value request (list of possible variants)
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_varnt.
      PERFORM f4_for_variant.
    PAI
    AT SELECTION-SCREEN.
      PERFORM pai_of_selection_screen.
    START-OF-SELECTION.
      PERFORM selection.
    END-OF-SELECTION.
      PERFORM layout_build USING i_layout. "wg. Parameters
      PERFORM print_build USING i_print.  "wg. Parameters
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name         = w_repid
             i_internal_tabname     = 'I_SFLIGHT'
                i_structure_name       = 'SFLIGHT'
                i_client_never_display = 'X'
                i_inclname             = w_repid
           CHANGING
                ct_fieldcat            = i_fieldcat[]
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Call ABAP/4 List Viewer
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            I_INTERFACE_CHECK           = ' '
               i_callback_program          =  w_repid
            I_CALLBACK_PF_STATUS_SET    = ' '
            I_CALLBACK_USER_COMMAND     = ' '
            I_CALLBACK_TOP_OF_PAGE      = ' '
            I_CALLBACK_HTML_TOP_OF_PAGE = ' '
            I_CALLBACK_HTML_END_OF_LIST = ' '
               i_structure_name            = 'SFLIGHT'
               i_background_id         = 'ALV_BACKGROUND'
            I_GRID_TITLE                =
            I_GRID_SETTINGS             =
               is_layout                   = i_layout
               it_fieldcat                 = i_fieldcat[]
            IT_EXCLUDING                =
               it_special_groups           = i_sp_group[]
               it_sort                     = i_sort[]
            IT_FILTER                   =
            IS_SEL_HIDE                 =
            I_DEFAULT                   = 'X'
               i_save                      = w_save
               is_variant                  = i_variant
               it_events                   = i_events[]
            IT_EVENT_EXIT               =
               is_print                    = i_print
            IS_REPREP_ID                =
            I_SCREEN_START_COLUMN       = 0
            I_SCREEN_START_LINE         = 0
            I_SCREEN_END_COLUMN         = 0
            I_SCREEN_END_LINE           = 0
       IMPORTING
            E_EXIT_CAUSED_BY_CALLER     =
            ES_EXIT_CAUSED_BY_USER      =
           TABLES
                t_outtab                    = i_sflight
          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.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
               i_callback_program      = w_repid
               i_structure_name        = 'SFLIGHT'
               is_layout               = i_layout
               it_fieldcat             = i_fieldcat[]
              IT_EXCLUDING            =
               it_special_groups       = i_sp_group[]
               it_sort                 = i_sort[]
              IT_FILTER               =
              IS_SEL_HIDE             =
              i_default                = W_DEFAULT
               i_save                  = w_save
               is_variant              = i_variant
               it_events               = i_events[]
              IT_EVENT_EXIT           =
               is_print                = i_print
              I_SCREEN_START_COLUMN   = 0
              I_SCREEN_START_LINE     = 0
              I_SCREEN_END_COLUMN     = 0
              I_SCREEN_END_LINE       = 0
         IMPORTING
              E_EXIT_CAUSED_BY_CALLER =
          TABLES
               t_outtab                = i_sflight.
          FORM FIELDCAT_INIT                                        *
    -->  L_FIELDCAT                                               *
    FORM fieldcat_init USING l_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname = 'SEATSOCC'.
    *The field is not displayed in the initial output, can be interactively
    chosen for display
      ls_fieldcat-no_out    = 'X'.
    *This field is assigned to a special group with tech. key 'A' and can be
    *displayed using the special group buttons
      ls_fieldcat-sp_group  = 'A'.
    *The field cannot be summed irrespective of its data type
      ls_fieldcat-no_sum    = 'X'.
      APPEND ls_fieldcat TO l_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname = 'SEATSMAX'.
      ls_fieldcat-no_out    = 'X'.
      ls_fieldcat-sp_group  = 'A'.
      APPEND ls_fieldcat TO l_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname = 'PRICE'.
      ls_fieldcat-no_out    = 'X'.
      ls_fieldcat-sp_group  = 'B'.
      APPEND ls_fieldcat TO l_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname    = 'CARRID'.
      ls_fieldcat-outputlen    = 7.
      APPEND ls_fieldcat TO l_fieldcat.
    ENDFORM.
          FORM DATA_ADD                                             *
    --> L_SFLIGHT
    FORM data_add TABLES l_sflight STRUCTURE i_sflight.
      LOOP AT l_sflight.
        IF sy-tabix > 10.
          l_sflight-box  = 'X'.
          l_sflight-lights = '3'.
        ELSE.
          IF sy-tabix = 1.
            l_sflight-lights = '2'.
          ELSE.
            l_sflight-lights = '1'.
          ENDIF.
        ENDIF.
        MODIFY l_sflight.
      ENDLOOP.
    ENDFORM.
          FORM EVENTTAB_BUILD                                       *
    -->  l_EVENTS                                                 *
    FORM eventtab_build USING l_events TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type = 0
           IMPORTING
                et_events   = l_events.
      READ TABLE l_events WITH KEY name = slis_ev_top_of_page INTO ls_event.
      IF sy-subrc = 0.
        MOVE c_formname_top_of_page TO ls_event-form.
        APPEND ls_event TO l_events.
      ENDIF.
    ENDFORM.
          FORM COMMENT_BUILD                                        *
    -->  L_TOP_OF_PAGE                                            *
    FORM comment_build USING l_top_of_page TYPE slis_t_listheader.
      DATA: ls_line TYPE slis_listheader.
    ***Header
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    LS_LINE-KEY: not used for this type
      ls_line-info = 'Heading list'.
      APPEND ls_line TO l_top_of_page.
    ***Selection
      CLEAR ls_line.
      ls_line-typ  = 'S'.
      ls_line-key  = 'Key 1'.
      ls_line-info = 'Information'.
      APPEND ls_line TO l_top_of_page.
      ls_line-key  = 'Key 2'.
      APPEND ls_line TO l_top_of_page.
    ***Action
      CLEAR ls_line.
      ls_line-typ  = 'A'.
    LS_LINE-KEY: not used for this type
      Ls_line-info = 'Status list'.
      APPEND ls_line TO l_top_of_page.
    ENDFORM.
          FORM LAYOUT_BUILD                                         *
    <->  LS_LAYOUT                                                 *
    FORM layout_build USING ls_layout TYPE slis_layout_alv.
      ls_layout-f2code            = w_f2code.
      ls_layout-zebra             = p_zebra.
      ls_layout-colwidth_optimize = p_colopt.
      IF p_chkbox = 'X'.
    *Fieldname for check box on the report output
        ls_layout-box_fieldname     = w_boxnam.
      ELSE.
        ls_layout-box_fieldname     = space.
      ENDIF.
      ls_layout-no_input          = p_noinpt.
      ls_layout-no_vline          = p_novlin.
      ls_layout-no_colhead        = p_nocolh.
      IF p_lights = 'X' OR p_lightc = 'X'.
    **Fieldname for lights on the report output
        ls_layout-lights_fieldname = w_lignam.
      ELSE.
        CLEAR ls_layout-lights_fieldname.
      ENDIF.
      ls_layout-lights_condense   = p_lightc.
      ls_layout-totals_text       = p_totext.
      ls_layout-subtotals_text    = p_sttext.
      ls_layout-totals_only       = p_totonl.
      ls_layout-key_hotspot       = p_keyhot.
      ls_layout-detail_popup      = p_detpop.
      ls_layout-group_change_edit = p_groups.
    E05_LS_LAYOUT-GROUP_BUTTONS     = P_GROUPB.
    ls_layout-group_buttons     = 'X'.
    ENDFORM.
          FORM SP_GROUP_BUILD                                       *
    -->  L_SP_GROUP                                               *
    FORM sp_group_build USING l_sp_group TYPE slis_t_sp_group_alv.
      DATA: ls_sp_group TYPE slis_sp_group_alv.
    *Fields are assigned to the special group
      CLEAR ls_sp_group.
      ls_sp_group-sp_group = 'A'.
      ls_sp_group-text     = 'Reservation status'.
      APPEND ls_sp_group TO l_sp_group.
      CLEAR ls_sp_group.
      ls_sp_group-sp_group = 'B'.
      ls_sp_group-text     = 'Flight charges'.
      APPEND ls_sp_group TO l_sp_group.
    ENDFORM.
          FORM SELECTION                                                *
    FORM selection.
      SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE i_sflight
               UP TO p_maxrow ROWS WHERE carrid IN s_carrid
               AND connid IN s_connid AND fldate IN s_fldate.
      PERFORM data_add TABLES i_sflight.
    ENDFORM.
          FORM TOP_OF_PAGE                                              *
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                i_logo             = 'ENJOYSAP_LOGO'
                it_list_commentary = i_list_top_of_page.
    ENDFORM.
          FORM F4_FOR_VARIANT                                           *
    FORM f4_for_variant.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant          = i_variant
                i_save              = w_save
              it_default_fieldcat =
           IMPORTING
                e_exit              = w_exit
                es_variant          = i_variant1
           EXCEPTIONS
                not_found = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        IF w_exit = space.
          p_varnt = i_variant1-variant.
        ENDIF.
      ENDIF.
    ENDFORM.
    *&      Form  PAI_OF_SELECTION_SCREEN
          to check whether right variant is entered on the selection scr
    FORM pai_of_selection_screen.
      IF NOT p_varnt IS INITIAL.
        MOVE i_variant TO i_variant1.
        MOVE p_varnt TO i_variant1-variant.
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
             EXPORTING
                  i_save     = w_save
             CHANGING
                  cs_variant = i_variant1.
        i_variant = i_variant1.
      ELSE.
        PERFORM variant_init.
      ENDIF.
    ENDFORM.                               " PAI_OF_SELECTION_SCREEN
    *&      Form  VARIANT_INIT
    FORM variant_init.
      CLEAR i_variant.
      i_variant-report = w_repid.
    ENDFORM.                               " VARIANT_INIT
          FORM PRINT_BUILD                                          *
    FORM print_build USING l_print TYPE slis_print_alv.
      l_print-print              = p_print.
      l_print-no_print_selinfos  = p_nosinf.
      l_print-no_coverpage       = p_nocove.
      l_print-no_new_page        = p_nonewp.
      l_print-no_print_listinfos = p_nolinf.
      l_print-reserve_lines      = p_reserv.
      l_print-print              = p_print.
    ENDFORM.
          FORM T_SORT_BUILD                                         *
    FORM t_sort_build USING l_sort TYPE slis_t_sortinfo_alv.
      DATA: ls_sort TYPE slis_sortinfo_alv.
      ls_sort-fieldname = 'CARRID'.
      ls_sort-spos      = 1.
      ls_sort-up        = 'X'.
      ls_sort-subtot    = 'X'.
      APPEND ls_sort TO l_sort.
    ps : reward points for helpful answers and mark the post as closed..

  • Web Dynpro ALV grid format

    Hi,
    I have a web dynpro alv table that has many columns (about 20) I would like it to be displayed so that the user does not have to scroll right to see all the data.
    at the moment columns:
    col1 col2 col3 ......col19 col20
    i would like the second half of the table under the 1sta half:
    col1 col2 col3...col9 col10
    col11 col12...col19 col20
    Is there any way that i can get the table to be split into two or some other nice way to display without scrolling?

    You won't be able to do this with a single ALV.  I suppose you could have two ALVs and bind them both to the same context.  You wouldn't be able to sync the veritcal scrolling between the the two ALVs however.  I'm also not sure how usage this design is from a UI design pattern.  I would think the acceptible approach would be to use horizontal scrolling within the ALV.  You don't have to make the ALV display all columns at once as this can make your entire page very wide and require using the browser scrolling.  Instead consider using the set_scrollable_col_count method.

  • Need option to count the no. of pernrs based on org unit in ALV Grid Format

    Hi ,
    Do we have any option to count the no. of pernrs in an org. unit to be printed with subtotals in the pernrs column itself.
    Do we have any option for counter in SLIS itself.
    Thanks in advance,
    Sarika

    Hi Sarika,
    Create an additional column in your output for integer field and populate the same with value 1 fro each row.
    Then, SORT the internal table by Org. Unit and Job and perform sum operation on the column for integer field.
    You can SORT by adding fields to the IT_SORT parameter in REUSE_ALV_GRID_DISPLAY and mark the DO_SUM in the new integer column fieldcatalog entry.
    Cheers,
    Aditya
    Edited by: Aditya Laud on Feb 14, 2008 2:25 AM

  • Vendor open items wise ALV Grid Display (FBL1N) report to Excel Sheet

    Hi All,
    I need vendor wise open items and cleared items in ALV Grid format in excel sheet.
    I'm Trying that in T Code FBL1N, After the execution. I had select ALV Grid format like this From the menu bar->Settings-> Switch list.
    After that i get ALV  Grid format, Then i'm doing export the data to excel sheet. like this From the Menu bar->List->Export->Spread sheet.
    That time i'm getting Error Message no. 0K064, Filter criteria, sorting, totals and subtotals are not taken into account.
    I want vendor wise sorting totals and subtotals,
    How can i over come this Error please let me now.
    Thanks,
    Amar

    Hi Amar,
    Please check the KBA 2083705.
    https://websmp230.sap-ag.de/sap(bD1odSZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3230383337303526
    Regards,
    Monika

  • Pls help me this is an urgent  requirement on  ALV GRID

    Hi all
      Here i am sendig my requirement pls help me on coding ..
    Report Assignment For ELTPs:
    Selection criteria :
    Circle id : Select option without interval and mandatory
    SPR Id :  Select option without interval
    Project Status :  Parameter
    Output required in ALV Grid format with the below structure :
    cProjects ID     SPR ID     Project Name     Circle ID     Circle Description     Delegation Status     No. of CU Projects     CU-PO Share     FLCB     FLCB
    NAME     FLCL ID     FLCL Name     FLCL Email ID
    1232007
         1230
              ABCD          No     0                              
    1242007
         1240
              ABCD          Partial     2                              
    1112007
         1241
              XYZ                                             
    2222007
         1242
              WXY                                             
    1252007
         1250
              EFGH          Full     1                              
    3332007
         1251
              DEF                                             
    Requirement : 
    1.     The report should list all the CFU projects and the corresponding CU projects circle wise based on the circles entered on the selection screen and which have the SPR ids and Project status on the selection screen.
    2.     If SPR id or Project status is not entered then all the projects to be considered for the given circle/s.
    3.     It should display the details of the CFU project first. The corresponding CU projects should be listed below that CFU project in the successive rows.
    4.     For example, project 1232007 is a CFU project which does not have any CU under it. Hence, another CFU project 1242007 is displayed in the second row. It has 2 CU projects under it. The details of those two CU projects are displayed in the 3rd and 4th rows.
    5.     Total share given to the CU circle (by adding different PO shares to that circle in that project) by the CFU project should be displayed in the field ‘CU-PO Share’.
    6.     For CU projects, the fields ‘Delegation Status’, ‘No. of CU projects’ and ‘CU-PO share’ should be space.
    7.     FLCB, FLCL ID, FLCL name and FLCL email  need to given for all the projects in all the rows.
    Tables to be referred: ZSCP_PROJECT, ZSCP_CIRCLE_M, ZSCP_PJ_CL_PO_MP, ZSCP_PRJ_LINK, USR21,
    ADR6, BUT000,CGPL_TEXT.
    [<b>b]Here i done the coding the but the error showing that field catolog is not found..
    pls check this and kindly send the code .....</b></b>
    REPORT  Z_64328_TEST .
    TYPE-POOLS : SLIS.
    TABLES : ZSCP_PROJECT,ZSCP_CIRCLE_M,ZSCP_PJ_CL_PO_MP,ZSCP_PRJ_LINK,
             USR21,ADR6, BUT000.
    SELECT-OPTIONS : S_CIRID FOR ZSCP_CIRCLE_M-CIRCLE_ID NO INTERVALS.
    SELECT-OPTIONS : S_SPR_ID    FOR ZSCP_PROJECT-SPR_PROJECT_ID NO INTERVALS.
    PARAMETERS     : P_STAT  LIKE ZSCP_PROJECT-PRJ_STAT.
          DATA : GS_LAYOUT1 TYPE SLIS_LAYOUT_ALV,
                 CT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
                 G_REPID   TYPE  SY-REPID,
                 TEMP_CAT1  TYPE SLIS_FIELDCAT_ALV,
                 HEADER_ALV1 TYPE SLIS_T_LISTHEADER,
                 HEADER_ALV_WA1  TYPE SLIS_LISTHEADER,
                 GT_SORT  TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
                 GS_KEYINFO  TYPE SLIS_KEYINFO_ALV.
    DATA : SPRID  TYPE ZSPR_PROJECT_ID.
    DATA : CID    TYPE ZCIRCLE_ID.
    DATA : ITAB  TYPE TABLE OF ZSCP_PROJECT.
    DATA : WA    TYPE ZSCP_PROJECT.
    DATA : ITAB1 TYPE TABLE OF ZSCP_CIRCLE_M.
    DATA : WA1   TYPE ZSCP_CIRCLE_M.
    SELECT * FROM ZSCP_CIRCLE_M INTO TABLE ITAB1.
    SELECT * FROM ZSCP_PROJECT INTO TABLE ITAB WHERE SPR_PROJECT_ID IN S_SPR_ID OR CIRCLE_ID IN S_CIRID.
    LOOP AT ITAB INTO WA.
    READ TABLE ITAB1 INTO WA1 WITH KEY CIRCLE_ID = WA-CIRCLE_ID.
    WRITE : WA1-CIRCLE_DESC.
    WRITE : WA-CIRCLE_ID,
            WA-PROJECT_ID,
            WA-DELEG_STAT,
            WA-PRJ_STAT,
            WA-FLCB,
            WA-FLCL.
    ENDLOOP.
    *PERFORM FIELD_CATALOG1.
    PERFORM alv_display1.
    FORM FIELD_CATALOG1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'CIRCLE_ID'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CIRCLEID'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'SPR_PROJECT_ID'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CPROJECTID'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'CIRCLE_DESC'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CIRCLEDESC'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'DELEG_STAT'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'DELGSTAT'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'PRJ_STAT'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'PROJSTAT'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'FLCB'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'FLCB1'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'FLCL'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'FLCL1'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND  TEMP_CAT1 TO CT_FIELDCAT1.
    ENDFORM.   "END CATALOG1.
    FORM ALV_DISPLAY1.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                 = G_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE             = 'TOP-OF-PAGE1 '
      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                          = GS_LAYOUT1
       IT_FIELDCAT                        = CT_FIELDCAT1
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                            = GT_SORT[]
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                             = 'A '
      TABLES
        T_OUTTAB                          = ITAB
    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.
    Thanks and regards
    Nagendra Kumar

    hi nagendra,
             go through this code.
    TYPE-POOLS : SLIS.
    TABLES : ZSCP_PROJECT,ZSCP_CIRCLE_M,ZSCP_PJ_CL_PO_MP,ZSCP_PRJ_LINK,
    USR21,ADR6, BUT000.
    SELECT-OPTIONS : S_CIRID FOR ZSCP_CIRCLE_M-CIRCLE_ID NO INTERVALS.
    SELECT-OPTIONS : S_SPR_ID FOR ZSCP_PROJECT-SPR_PROJECT_ID NO INTERVALS.
    PARAMETERS : P_STAT LIKE ZSCP_PROJECT-PRJ_STAT.
    DATA : GS_LAYOUT1 TYPE SLIS_LAYOUT_ALV,
    CT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
    G_REPID TYPE SY-REPID,
    TEMP_CAT1 TYPE SLIS_FIELDCAT_ALV,
    HEADER_ALV1 TYPE SLIS_T_LISTHEADER,
    HEADER_ALV_WA1 TYPE SLIS_LISTHEADER,
    GT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,
    GS_KEYINFO TYPE SLIS_KEYINFO_ALV.
    DATA : SPRID TYPE ZSPR_PROJECT_ID.
    DATA : CID TYPE ZCIRCLE_ID.
    DATA : ITAB TYPE TABLE OF ZSCP_PROJECT.
    DATA : WA TYPE ZSCP_PROJECT.
    DATA : ITAB1 TYPE TABLE OF ZSCP_CIRCLE_M.
    DATA : WA1 TYPE ZSCP_CIRCLE_M.
    SELECT * FROM ZSCP_CIRCLE_M INTO TABLE ITAB1.
    SELECT * FROM ZSCP_PROJECT INTO TABLE ITAB WHERE SPR_PROJECT_ID IN S_SPR_ID OR CIRCLE_ID IN S_CIRID.
    LOOP AT ITAB INTO WA.
    READ TABLE ITAB1 INTO WA1 WITH KEY CIRCLE_ID = WA-CIRCLE_ID.
    WRITE : WA1-CIRCLE_DESC.
    WRITE : WA-CIRCLE_ID,
    WA-PROJECT_ID,
    WA-DELEG_STAT,
    WA-PRJ_STAT,
    WA-FLCB,
    WA-FLCL.
    ENDLOOP.
    PERFORM FIELD_CATALOG1.
    PERFORM alv_display1.
    FORM FIELD_CATALOG1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'CIRCLE_ID'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CIRCLEID'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'SPR_PROJECT_ID'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CPROJECTID'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'CIRCLE_DESC'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'CIRCLEDESC'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'DELEG_STAT'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'DELGSTAT'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'PRJ_STAT'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'PROJSTAT'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'FLCB'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'FLCB1'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    CLEAR TEMP_CAT1.
    TEMP_CAT1-TABNAME = 'ITAB'.
    TEMP_CAT1-FIELDNAME = 'FLCL'.
    TEMP_CAT1-KEY = 'X'.
    TEMP_CAT1-SELTEXT_M = 'FLCL1'.
    TEMP_CAT1-OUTPUTLEN = 10.
    APPEND TEMP_CAT1 TO CT_FIELDCAT1.
    ENDFORM. "END CATALOG1.
    FORM ALV_DISPLAY1.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = G_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE1 '
    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 = GS_LAYOUT1
    IT_FIELDCAT = CT_FIELDCAT1
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT = GT_SORT[]
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = 'A '
    TABLES
    T_OUTTAB = ITAB
    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.
    <b>please reward points if helpfull.</b>
    with regards,
    radhika kolluru.

  • Microsoft Excel Icon in ALV Grid Report

    Hi all,
    We have a customized report. When we execute that reports, it open in ALV Grid format. When we choose "Microsoft Excel" Icon to change layout to Excel, it then shows the report in excel without any data.
    Can any one please tell me that why there is no data? should i need to do any settings in excel for this?
    Please respond.
    Best Regards,
    AI

    Hi,
    Refer these:
    Microsoft Excel Icon in ALV Grid Report
    Re: Not able display the Excel Icon in ALV List Display
    Hope it helps
    Regards
    Mansi

  • How to add radiobuttons in ALV Grid

    Hi,
    I refered the threads in SDN but i am not able to get proper solution for my requirement.
    I am displaying output in ALV Grid format. After displaying the output i mean in the output screen i need few buttons and radio buttons . when user selects the record and clicks the radio button accordingly my logic should work. Anybody can tell me how to add the radiobuttons in the output of the screen. Please find the below output format for the requirement is
    Push button1 Pushbutton2  Radiobutton1 Radio button2
    MY program output in Grid format.
    Anybody can suggest me how to approach.
    Regards,
    Maheedhar

    Check if this link helps..
    http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-RadioButtonsinALVGRIDREPORT

  • How to Enable Export button on toolbar of alv grid??

    Hi guys,
    I display my data in Alv grid format,
    The problem is that in the standard toolbar of the alv i can't find the standard button for Exporting in spreadsheet & when i try
    to get it from the menu it's disabled along with all the Export functionalities..how can i solve this problem?
    Thanks in advance,
    Regards,

    Yes sure there it is:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
          i_callback_top_of_page   = 'TOP_OF_PAGE'
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = G_REPID
         I_CALLBACK_PF_STATUS_SET          = 'STANDARD_FULLSCREEN'
        I_CALLBACK_USER_COMMAND           = ' '
        I_CALLBACK_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                         =
         IT_FIELDCAT                       = it_fieldcat
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
        IT_SORT                           =
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = 'A'
        IS_VARIANT                        =
        IT_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_HYPERLINK                      =
        IT_ADD_FIELDCAT                   =
        IT_EXCEPT_QINFO                   =
        I_HTML_HEIGHT_TOP                 =
        I_HTML_HEIGHT_END                 =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = itab
      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.
    P.S: I tried copying standard status of program saplkkbl into my program then specified its name which is 'STANDARD_FULLSCREEN' inside my function call parameters ..but the toolbar now is completely disabled with no standard
    icons whatsoever!.what shall i do?
    Thanks

  • ABAP Query - ALV Grid Calculation

    Can anybody tell me whether in ABAP Query when you execute the Query in SQ01 its shows the report in ALV Grid format. In ALV Grid format there are some standard calculation are available like
    TOtal
    Mean value
    Minmum
    Maximum
    Count
    The above calculation can be done for each column.
    My Query is it possible to put our own simple calculation
    through some coding for overall summation fields instead of this std. calculation.
    Example : Unrestricted moved Qty Summation divided by INspection lot qty summation * 100
    The output of this calculation is called First pass yield.
    This calculation i done for each line item by creating a Additional field with ABAP coding.The overall meanvalue calcualtion of this addtional fields column is not suits the customer expectation.They want the calculation to be done by the system like what i had explained in the example.

    Hi,
    Here is a code for a single grid.
    In the screen layout,make a custom container (Icon with C ) and name it in Capital letters as CONTAINER.The code below in bold letters is what exactly you want.I ve given a small example on how to use ALV:
    REPORT SAMPLE.
    DATA: alv type ref to cl_gui_alv_GRID,
    cont type ref to cl_gui_custom_container,
    itab_spfli type table of spfli.
    START-OF-SELECTION.
    select * from spfli into table itab_spfli.
    call screen 100.
    END-OF-SELECTION.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    seT PF-STATUS 'GUI'.
    SET TITLEBAR 'xxx'.
    if cont is initial.
    CREATE OBJECT cont
    EXPORTING
    CONTAINER_NAME = 'CONTAINER'.
    CREATE OBJECT ALV
    EXPORTING
    I_PARENT = CONT.
    CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_STRUCTURE_NAME = 'SPFLI'
    CHANGING
    IT_OUTTAB = itab_spfli
    Now for your requirement,you can create two custom containers in the screen layout and two different alv grid instances.ie:
    DATA: alv1 type ref to cl_gui_alv_GRID,
    cont1 type ref to cl_gui_custom_container
    alv2 type ref to cl_gui_alv_GRID,
    cont2 type ref to cl_gui_custom_container.
    To select data from first grid,you can use events on double_click and fetch information and then display it in the second grid.
    <b>SOME MATERIAL REGARDING ALV:</b>
    www.abap4.it/download/ALV.pdf <b>(very useful)</b>
    http://www.sapdevelopment.co.uk/reporting/alvhome.htm
    <b>-->download the PDF from following link.</b>
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm
    <b>SAMPLE PROGRAMS IN ALV:</b>http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid
    <b>DEMO PROGRAMS IN ALV:</b>BCALV*
    Regards,
    Beejal
    **Reward if this helps

  • Can we scroll to the last page of an alv grid?

    I am dispalying a report in ALV grid format - REUSE_ALV_GRID_DISPLAY.
    As soon as the execute button is clicked it should show the last page with the totals.
    User will then scroll upwards to see the details.
    How to scroll to the end of the ALV grid?
    (It is like goign to the last page of course)
    Thanks,
    Ven

    Hi,
    Yes..You can do it using the OO ALV...You can use the method set_current_cell_via_id ..to show the last record.
    Check this example.
    * Declarations.
    DATA: l_lines TYPE int4,
          l_row_no TYPE lvc_s_roid.
    DATA: ok_code LIKE sy-ucomm,
          g_container TYPE scrfname VALUE 'CONTAINER1',
          g_grid  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          gs_layout TYPE lvc_s_layo.
    DATA: gt_outtab TYPE TABLE OF t001w.
    DATA: v_count TYPE i.
    *       MAIN                                                          *
    CALL SCREEN 100.
    *       MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'TEST'.
      SET TITLEBAR 'MAIN100'.
    * Create the grid.
      IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
          EXPORTING
            container_name = g_container.
        CREATE OBJECT g_grid
          EXPORTING
            i_parent = g_custom_container.
    * Get the data.
        SELECT * FROM t001w INTO TABLE gt_outtab.
        CALL METHOD g_grid->set_table_for_first_display
          EXPORTING
            i_structure_name = 'T001W'
            is_layout        = gs_layout
          CHANGING
            it_outtab        = gt_outtab.
        DESCRIBE TABLE gt_outtab LINES l_lines.
    * Go to the last row.
        l_row_no-row_id =  l_lines.
        CALL METHOD g_grid->set_current_cell_via_id
          EXPORTING
            is_row_no = l_row_no.
      ENDIF.
    ENDMODULE.                    "pbo OUTPUT
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      CASE sy-ucomm.
        WHEN 'EXIT' OR 'BACK'.
          PERFORM exit_program.
      ENDCASE.
    ENDMODULE.                    "pai INPUT
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      LEAVE PROGRAM.
    ENDFORM.                    "exit_program
    Thanks
    Naren

  • How does the SORT function in ALV grid work?

    Hi,
    I have a report for which the o/p is displayed in ALV grid format.There is one column in the O/p strcuture which is "No of days".Based on certain conditions,i need to display the value for some of the days as Negative e.g. " - 45".Becasuse of this,I have declared the field for the "No of days" of the type "CHAR".
    Now when i sort(using ALV grid SORT function) the list on basis of this column,it doesnt give me the correct o/p.
    CAN anyone tell me how do i handle this?I want the list to be sorted correctly on basis of the "No of days" column.
    Thanks!

    This is your Fourth Cross Posting in last three days on same issue!!
    CHAR type column doesnt work for SORT function in ALV grid!
    How to sort a column of type CHAR
    I dont,ve link for your Fourth Thread on same,though i'm short memory loss.

Maybe you are looking for