ALV list heade problem

Hi all,
I have created list heade r using FM commentary_wirite.
the parameter slis_listheader-info has length of only 60 characters.
So my header is getting truncated .
Plase suggest me on how to increase the length.
Regards,
Naveen

hey u need to consider slis_t_listheader
typ(1) type c,   " H = Header, S = Selection, A = Action
key(20) type c,
seggregate u r text and give some text in header and some other in selection ..and some other in action
i hope this may help u......
reward points if helpful

Similar Messages

  • Alv list header problem

    Hai Friends,
    In my ALV List header..i am writing date , time and my program name.
    but all are coming on left side.
    can i get date on left side, program name on centered and time on write side.
    my code is like this.
    FORM list_headers.
          lists-typ = 'H'.
          lists-info = text-010.
          APPEND lists.
          CLEAR lists.
          lists-typ = 'S'.
          lists-key = text-011.
          CONCATENATE sy-datum+6(2) '/'
                      sy-datum+4(2) '/'
                      sy-datum+0(4) INTO lists-info.
          APPEND lists.
          CLEAR lists.
          lists-typ = 'S'.
          lists-key = text-012.
          CONCATENATE sy-uzeit+0(2) ':'
                      sy-uzeit+2(2) ':'
                      sy-uzeit+4(2) INTO lists-info.
          APPEND lists.
          CLEAR lists.
    ENDFORM.

    Hi again,
    1. first of all how are u writing / displaying
       the alv header ?
    2. using documentary write ?
       then also, u can use one variable of
      length 100 and use this concept.
    3. If u are using top_of_page
      event,
      in this event, WE CAN use WRITE.
      (i have used it, and it
      works fantastic)
                  (not in case of alv grid)
    4. My point is, what ever u are using,
       use on variable of length 100.
      WRITE value INTO variable.
      using offset
      and then proceed further.
    regards,
    amit m.

  • Traffic lights in ALV list header

    how do i display traffic lights as icons in ALV list header. for example, in the code below, i want to display a green icon at the end of closed items and a red icon at the end of the open items:
                closed : 4 [green-icon]
                open   : 2  [red-icon]
    CLEAR header_alv_wa-info.
      header_alv_wa-key  = 'closed:'.
      header_alv_wa-info = gv_closed.
      header_alv_wa-typ  = 'S'.
      APPEND header_alv_wa TO headeralv.
      CLEAR header_alv_wa-info.
      header_alv_wa-typ  = 'S'.
      header_alv_wa-key  = 'open:'.
      header_alv_wa-info = gv_open.
      APPEND header_alv_wa TO headeralv.

    Hi,
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    the above links will give u the code for the same..
    Regards,
    Aparna

  • Writing selections in  alv list header

    Hi,
    in alv list header i have to show the values entered in selection screen.
    ex.
    Current year    : 2008
    current period  : 03
    report ID          : R_123
    company code : I BT  AA to BB
                            I BT  CC to DD
                            I EQ  FF
    in the above example first three are parameters and  company code is select-option, for parameters i can display what i want, but for company code( which is select option) it is showing only first line and not showing other lines.
    at the time of filling list header table for select-option, i am looping the select-option, first i am filling with  typ, key and info and for other i am filling only info, if i fill typ, key also for other recoreds also it is showing the  company code in all lines  as below ....
    company code  : I BT  AA to BB
    company code : I BT  CC to DD
    company code : I EQ  FF
    can any one suggest to get the list header as shown at the begining....
    thanks,
    bhushan

    Hi,
    Check this sample code. Here plant and date are selection screen paramters.
    Plant
      lwa_header-typ  = 'S'.
      lwa_header-key  = text-t47.
    If the select option for plant is 'EQ'
      LOOP AT s_werks.                                       "#EC *
        IF s_werks-option = 'EQ'.
          lwa_plant-werks = s_werks-low.
          APPEND lwa_plant TO lt_plant.
          CLEAR lwa_plant.
    If the select option for plant is 'BT'
        ELSEIF s_werks-option = 'BT'.
          CONCATENATE s_werks-low
                      text-t50
                      s_werks-high
            INTO lf_plant.
          lwa_header-info = lf_plant.
          APPEND lwa_header TO gt_header.
          CLEAR lwa_header.
        ENDIF.
      ENDLOOP.
      IF s_werks-option = 'EQ'.
        READ TABLE lt_plant INTO lwa_plant INDEX 1.
        lwa_header-info = lwa_plant-werks.
        APPEND lwa_header TO gt_header.
        CLEAR lwa_header.
        LOOP AT lt_plant INTO lwa_plant FROM 2.
          lwa_header-typ   = 'S'.
          lwa_header-key   = ''.
          lwa_header-info  =  lwa_plant-werks.
          APPEND lwa_header TO gt_header.
          CLEAR: lwa_header.
        ENDLOOP.
      ENDIF.
    Post date Range
      lwa_header-typ   = 'S'.
      lwa_header-key   = text-t33.
    If the select option for post date is 'EQ'
      LOOP AT s_budat.                                      "#EC *
        IF s_budat-option = 'EQ'.
          CONCATENATE s_budat-low+6(2) '.'
                      s_budat-low+4(2) '.'
                      s_budat-low(4) INTO lf_range.
        For multiple values
          IF lf_date_tmp IS INITIAL.
            lwa_date-date = lf_range.
            APPEND lwa_date TO lt_date.
          ELSE.
            lwa_date-date = lf_range.
            APPEND lwa_date TO lt_date.
          ENDIF.
      If the select option for post date is 'BT'
        ELSEIF s_budat-option = 'BT'.
          CONCATENATE s_budat-low+6(2) '.'
                      s_budat-low+4(2) '.'
                      s_budat-low(4) text-t49
                      s_budat-high+6(2) '.'
                      s_budat-high+4(2) '.'
                      s_budat-high(4) INTO lf_range .
          lwa_header-info  =  lf_range.
          CLEAR lf_range.
        ENDIF.
      ENDLOOP.
      IF s_budat-option = 'EQ'.
        READ TABLE lt_date INTO lwa_date INDEX 1.
        lwa_header-info  =  lwa_date-date.
        APPEND lwa_header TO gt_header.
        CLEAR: lwa_header.
        LOOP AT lt_date INTO lwa_date FROM 2.
          lwa_header-typ   = 'S'.
          lwa_header-key   = ''.
          lwa_header-info  =  lwa_date-date.
          APPEND lwa_header TO gt_header.
          CLEAR: lwa_header.
        ENDLOOP.
      ENDIF.
    Appending work area to the header table
      APPEND lwa_header TO gt_header.
      CLEAR lwa_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_header.
    <REMOVED BY MODERATOR>
    Regards,
    Ramya
    Edited by: Alvaro Tejada Galindo on Apr 8, 2008 4:30 PM

  • Number formatting in ALV list header

    Hi,
    I am using an ALV with a list header. Code is as follows:
    FORM ALV_SHOW.
       DATA G_CALLBACK_PROG LIKE SY-REPID.
       G_CALLBACK_PROG = SY-REPID.
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
             I_CALLBACK_PROGRAM      = G_CALLBACK_PROG
             I_SAVE                  = 'U'
             IT_FIELDCAT             = ITAB_FIELDCATALOG
             IS_LAYOUT               = GS_LAYOUT
             I_CALLBACK_TOP_OF_PAGE  = 'TOP-OF-PAGE'
          TABLES
             T_OUTTAB               = ITAB_SUB_SEARCH.
    ENDFORM.  "alv_show.
    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.
       DATA: SHHLDR_INFO LIKE ZSH_SHHLDR.
    Title
       WA_HEADER-TYP  = 'H'.
       WA_HEADER-INFO = 'Some Title'.
       APPEND WA_HEADER TO T_HEADER.
       CLEAR WA_HEADER.
       CLEAR SHHLDR_INFO.
       READ TABLE ITAB_SUB_SEARCH INDEX 1.
       SELECT SINGLE * FROM ZSH_SHHLDR INTO SHHLDR_INFO WHERE FOLIO EQ
          ITAB_SUB_SEARCH-FOLIO.
       WA_HEADER-TYP = 'S'.
       WA_HEADER-KEY = 'Holding '.
       WA_HEADER-INFO = SHHLDR_INFO-SHHOL.
       APPEND WA_HEADER TO T_HEADER.
       CLEAR: WA_HEADER.
       CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
             IT_LIST_COMMENTARY = T_HEADER.
    ENDFORM.   " top-of-page
    The problem is that the number for 'Holding' is displayed in the ALV header without any formatting, i.e.
    SOME TITLE
    Holding 2375385
    I want it to be displayed like:
    SOME TITLE
    Holding 2,375,385
    Is there any way to achieve this? Help is appreciated, thanks.
    Regards

    Hi
    Use WRITE statament
    WA_HEADER-TYP = 'S'.
    WA_HEADER-KEY = 'Holding '.
    *WA_HEADER-INFO = SHHLDR_INFO-SHHOL.
    WRITE SHHLDR_INFO-SHHOL TO WA_HEADER-INFO.
    APPEND WA_HEADER TO T_HEADER.
    If SHHLDR_INFO-SHHOL is amout, it would be better you used CURRENCY option
    WA_HEADER-TYP = 'S'.
    WA_HEADER-KEY = 'Holding '.
    *WA_HEADER-INFO = SHHLDR_INFO-SHHOL.
    WRITE SHHLDR_INFO-SHHOL CURRENCY <currency> TO WA_HEADER-INFO.
    APPEND WA_HEADER TO T_HEADER.
    Max

  • Reg: Adding spaces between texts in ALV list header

    Hi All,
    I was implementing a client requirement for ALV. The list header should contain something of this format.
    Pgm Id:               ZZZ01
    After this list header it is ALV display.
    I did this using the concatenate statement.
    ex: Concatenate 'PgmID' sy-repid into listheader seperated by space.
    But this is not showing spaces between text in ALV display. See I want a tabspace between the texts in headr. Any idea on how to mak it?
    Rakesh

    Depending on Fontsize the space might be so narrow that you believe its not there.
    check in the debugger if there is really a space in the string, the clause "separated by space" will insert one for sure.
    May be you'reshowing the ALV before you are modifying the listheader?
    Another approach is using strings, blanks at the end of a string are not deleted
    concatenate 'ABC ' 'XYZ' into s.
    and
    concatenate `ABC ` `XYZ` into s.
    will give different results, be aware of the difference in the quots in both cases. Using the second example you can insert as many blanks as you want.

  • Company Logo in ALV List Header

    Hi,
    I have created an ALV list and would like to put our company logo in the header. How can I do this?
    Thanks,
    Shah.

    Hi,
    In the transaction OAOR, you should be able to insert your company Logo.
    GOTO - OAOR (Business Document Navigator)
    Give Class Name - PICTURES Class Type - OT..... then Execute
    It will show you the list, then select ENJOYSAP_LOGO.
    On that list, you will find one control with a "create" tab.
    Click std. doc types.
    Select SCREEN and double-click.
    It will push FILE selection screen.
    Select your company logo (.gif) and press OK.
    It will ask for a description- for instance: "company logo".
    It will let you know your doc has been stored successfully.
    You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
    Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
    Reward points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • Display Logo in ALV LIST header

    Hi Experts!!
    I need the logo to be displayed in the header of ALV LIST but not the grid display. I searched for this, and got the results for ALV grid display. Kindly let me know if there's any way of printing the logo in the ALV List display. I hope that's possible with oops.
    Please help me out.
    Thanks and Regards,
    Seenu

    hello srinivas,
    Check the Examples in LIBS trxn,
    see the example One-Line List with Top of Page
    regards,
    Shweta

  • Alv list header alignment

    hi frnd's,
    I am using an alv list viewer,in top of page i am displaying some text i want to align the text sy-datum to right corner of the page.

    Hi Suganya, alignment in ALV header is only possible if you are using ALV LIST, in that case you can use the write statement in the event TOP_OF_PAGE; but if you are using ALV GRID, then this is not posibble since ALV GRID's header has fixed positions according to the text tipe (H, S) or the logo.
    Hope it helps
    Jesus

  • ALV list Header details scattered

    Hi All,
    I have a ALV-LIST report output but the header details displayed are scattered in output. Can you suggest how to align all deatils properly aligned.

    Hi again,
    1. first of all how are u writing / displaying
       the alv header ?
    2. using documentary write ?
       then also, u can use one variable of
      length 100 and use this concept.
    3. If u are using top_of_page
      event,
      in this event, WE CAN use WRITE.
      (i have used it, and it
      works fantastic)
                  (not in case of alv grid)
    4. My point is, what ever u are using,
       use on variable of length 100.
      WRITE value INTO variable.
      using offset
      and then proceed further.
    regards,
    amit m.

  • Alv list report-problems while printing

    hai,
    i get following dump error when tryign to print a alv list report.
    'Illegal interruption of the event LOAD-OF-PROGRAM.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "SAPLSZA12" had to be terminated because it has
        come across a statement that unfortunately cannot be executed.
    Error analysis
        During the flow of the event LOAD-OF-PROGRAM (event for the
        initialization of an ABAP program), a condition occurred under which
        the event was to be left early. This is not permitted as it would
        result in an inconsistent status in the ABAP program.'
    the problem resolves for a particular output(when i restrict the list to lesser rows) by changing FORMAT from
    X_65_255 to X_90_120 in the print dialog properties option..
    however this restricts the coloumn width..
    anycase i will have to print the output for all conditions.
    the problem seems to be centred around number of rows in the list output..

    is somethign wrong with the values in this internal table gt_comtypes_tab...
    this is where the dump is pointing..at LAOD OF PROGRAM EVENT
    1     FUNCTION addr_get_conversion_table.
    2     *"----
    3     ""Lokale Schnittstelle:
    4     *"  EXPORTING
    5     *"     VALUE(COMTYPES_TAB) TYPE  ADCOMTYPES_TAB
    6     *"  EXCEPTIONS
    7     *"      INTERNAL_ERROR
    8     *"----
    9
    10       comtypes_tab = gt_comtypes_tab.
    11
    12     ENDFUNCTION.
    values of gt_comtypes_tab.
    2     TEL     ADTEL
    3     FAX     ADFAX
    4     TTX     ADTTX
    5     TLX     ADTLX
    6     INT     ADSMTP
    7     RML     ADRML
    8     X40     ADX400
    9     RFC     ADRFC
    10     PRT     ADPRT
    11     SSF     ADSSF
    12     URI     ADURI
    13     PAG     ADPAG

  • Reg:ALV list Background Problem

    Dear All,
    I created a ALV LIST report. While i am running in that program in foreground i am getting timeout error. While running in background i am getting the output in improper way. While i am seeing that report in spool request and pressing the spool  output display in maximum width i am getting the output list fields  in improper position. What should i have to do for this issue?
    Thanks,
    Sankar M

    When you execute the report in background, u require to provide the width of the output it will be some thing like X_65_255.Try increasing the width.
    One more alternative is go to SPAD -> In settings Menu option -> Select Spool System -> go to others tab -> select the check box number of columns for list display format.
    Hope this inputs will help you.
    Regards,
    Shafivullah Mohammad

  • ALV Grid Header Problem.

    Hi All,
    I want to display the header of the ALV Grid as:
    Material                          111/11823
    Plant/Usage/Alt               2845/3/5
    Description                      ABI CAB
    Base Qty.                        23.000
    The values are to be taken from variables
    Please suggest how to do this.
    Thanks

    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report with grand total                *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    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,
    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.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform display_alv_report.
    perform top-of-page.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = '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.
      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-do_sum      = 'X'.        "Display column total
      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
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
               IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
               is_variant              = z_template
           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  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    Form  TOP-OF-PAGE                                                 *
    ALV Report Header                                                 *
    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             = 'ideas'.
    endform.

  • ALV List header shifting to next coloumn when transfer to excel sheet

    Hi,
      When i am transferring the data to excel sheet like
    After Executing click LOCAL FILE then click on spreadsheet RADIO BUTTON. My header is shifting one right colomn.
    I tried with COL_len but my issued is not resolved
    REPORT  ZTEST_AMIT  no standard page heading line-size 350.                             .
    TYPE-POOLS: SLIS.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT type slis_layout_alv,
          x_events type slis_alv_event,
          it_events type SLIS_T_EVENT.
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          POSNR LIKE VBAP-POSNR,
          MALE(40) type c,
          female(20) type c,
         END OF ITAB.
    SELECT VBELN
           POSNR
           FROM VBAP
           UP TO 20 ROWS
           INTO TABLE ITAB.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-SELTEXT_L = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'MALE'.
    X_FIELDCAT-SELTEXT_L = 'MALE'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 3.
    x_fieldcat-outputlen = 10.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'FEMALE'.
    X_FIELDCAT-SELTEXT_L = 'FEMALE'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 4.
    x_fieldcat-just = 'C'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
      x_events-NAME = SLIS_EV_TOP_OF_PAGE.
      x_events-FORM = 'TOP_OF_PAGE'.
      APPEND x_events  TO iT_EVENTS.
      CLEAR x_events .
      L_LAYOUT-NO_COLHEAD = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_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        = ' '
      I_STRUCTURE_NAME               =
       IS_LAYOUT                      = l_layout
       IT_FIELDCAT                    = it_fieldcat
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
       I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
       IT_EVENTS                      = 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
    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.
    FORM TOP_OF_PAGE.
    *-To display the headers for main list
        FORMAT COLOR COL_HEADING.
            WRITE: / SY-ULINE(45).
        WRITE: /   SY-VLINE,
              (8) ' ' ,
                   SY-VLINE,
              (8)  ' ' ,
                   SY-VLINE,
              (19) '***'(015) centered,
                   sy-vline.
        WRITE: /   SY-VLINE,
    (8)        'VBELN' ,
                   SY-VLINE,
    (8) 'POSNR'(014) ,
                   SY-VLINE,
              (8) 'MALE'(020) ,
                   sy-vline,
               (8)  'FMALE'(015) ,
                   sy-vline.
        FORMAT COLOR OFF.
    ENDFORM.
    Message was edited by: amit teja
    Message was edited by: amit teja
    Message was edited by: amit teja
    Message was edited by: amit teja

    for sorting
    for the para meter: IT_SORT in FM
    take that type as: SLIS_SORTINFO_ALV
    and for the fileds give d valus as per ur requirement...
    fileds r:  SPOS
               FIELDNAME
               TABNAME
               UP
               DOWN
               GROUP
               SUBTOT
               COMP
               EXPA
               OBLIGATORY
    ramesh.

  • Change color in alv list header

    hi experts,
    how can i change the color in a alv header... for example...
    number         docum     year  
    001              13245      2006
    002              13245      2007
    the header.. number, docum and year appears in light blue (all the cell) , how can i do that it appears without a color like the regular rows.
    thx in  advance

    Hi Carlos,
    FORM HEADING.
      FORMAT INTENSIFIED OFF.              " Remove any INTENSIFIED
      ULINE AT (WIDTH).                    " Upper frame border
      FORMAT COLOR COL_HEADING INTENSIFIED." Title color
      WRITE: / SY-VLINE.                   " Left border
      WRITE: 'No |Colour        |intensified    |intensified off|',
             'inverse' NO-GAP.
      WRITE: AT WIDTH SY-VLINE.            " Right border
      ULINE AT (WIDTH).                    " Line below titles
      FORMAT COLOR OFF.
    ENDFORM.
    regards,
    Prabhudas

Maybe you are looking for