In alv report incerse the width of the coloum

in my report one coloum name is pourchase order text its length is 500character.when i execute program its coming only 130 character. any solution der frnds
warms regrd
patil

Hi Patil,
Declare a field of type below,
ws_layout TYPE slis_layout_alv.
Mark this option colwidth_optimsize as 'x'.
ws_layout-colwidth_optimize = 'X'.
Pass to grid display function module REUSE_ALV_GRID_DISPLAY ls_layout = ws_layout
in the export parameters.
This should work for you.
Sruthi

Similar Messages

  • ALV report using the field catalog

    which is the quickest way to generate an ALV report using the field catalog merge.  without needing to build the field catalog manually .
    is it easier to create a structure and passe it in the field catalog merge .  if yes can i have an example plzzzz

    hI
    Supports the creation of the field catalog for the ALV function modules
    based either on a structure or table defined in the ABAP Data
    Dictionary, or a program-internal table.
    The program-internal table must either be in a TOP Include or its
    Include must be specified explicitly in the interface.
    The variant based on a program-internal table should only be used for
    rapid prototyping since the following restrictions apply:
    o Performance is affected since the code of the table definition must
    always be read and interpreted at runtime.
    o Dictionary references are only considered if the keywords LIKE or
    INCLUDE STRUCTURE (not TYPE) are used.
    If the field catalog contains more than 90 fields, the first 90 fields
    are output in the list by default whereas the remaining fields are only
    available in the field selection.
    If the field catalog is passed with values, they are merged with the
    'automatically' found information.
    Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
    display it using the basic ALV grid functionality(including column total). The example details the main
    sections of coding required to implement the ALV grid functionality:
                             Data declaration
                             Data retrieval
                             Build fieldcatalog
                             Build layout setup
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& 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.
    *&      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

  • How to obtain the alv reports in the dilog programing.

    how to obtain the alv reports in the dialog programming, that is when the push button in the screen in clicked it must be directed to the report, where to write the code for the report.

    Hi
    Use LEAVE TO LIST PROCESSING and develop your normal ALV dispaly as usual. System automatically takes care of this.
    I tried for normal report but try above even in the case of ALV reports
    Cheerz
    Ram

  • Dump for the ALV report for the excel.

    HI,
    We are having a ALV report.
    We are using REUSE_ALV_FIELDCATALOG_MERGE and REUSE_ALV_GRID_DISPLAY.
    After we run the report we get the output on the screen properly.
    When we choose the "Local File" button it goes to the dump.
    The following messages comes.
    Runtime Errors " OBJECTS_NOT_CHARLIKE"
    "The current statement requires a character-type data object.".
    Could you pls advise where is the problem.
    Rohita

    change the TABNAME to uppercase
    ls_fcat-tabname = 'LTB_REPORT'.   "<------------ changed to upper case
    ls_fcat-fieldname = 'NAME_ORG1'.
    ls_fcat-seltext_s = 'Distributor Name'.
    ls_fcat-seltext_m = 'Distributor Name'.
    ls_fcat-seltext_l = 'Distributor Name'.
    ls_fcat-datatype = 'CHAR'.
    ls_fcat-outputlen = 30.
    APPEND ls_fcat TO ct_fcat.

  • Show normal report or alv report for the radiobutton that was selected

    Hello... i'm a begginer on Abap, so I hope to writly espose my question...
    I'm trying to modifie an report i have to, when the user choose the values for selection, he also can choose if the output is shown as a normal view or as an alv. I want to do it by using radiobuttons, but I don´t no how to organise my code for the selected radiobutton...
    Thanks

    Hi,
    Copy and paste this code. undestand the logic.
    TABLES: vbrp.
    TYPE-POOLS: slis.
    TYPES: BEGIN OF gs_vbrp,
           vbeln TYPE vbrp-vbeln,  "sales order
           matnr TYPE vbrp-matnr,  "material no
           arktx TYPE vbrp-arktx,  "material description
           ntgew TYPE vbrp-ntgew,  "quantity
           gewei TYPE vbrp-gewei,  "quantity unit
           netwr TYPE vbrp-netwr,  "currency
           werks TYPE vbrp-werks,  "plant
           END OF gs_vbrp.
    DATA: it_vbrp TYPE STANDARD TABLE OF gs_vbrp,
          wa_vbrp TYPE gs_vbrp.
    DATA: fcat TYPE slis_t_fieldcat_alv,
          wa_fcat TYPE slis_fieldcat_alv.
    DATA: lyout TYPE slis_layout_alv,
          event TYPE slis_t_event,
          wa_event TYPE slis_alv_event.
    select-options: s_vbeln for vbrp-vbeln.
    parameters: p_alv type c radiobutton group AA,
                P_NORMAL TYPE C RADIOBUTTON GROUP AA.
      SELECT vbeln
             matnr
             arktx
             ntgew
             gewei
             netwr
             werks
             FROM vbrp
             INTO TABLE it_vbrp
             FOR ALL ENTRIES IN IT_VBRP
             WHERE vbeln EQ IT_VBRP-VBELN.
    IF P_ALV = 'X'.
    define imacro.
    wa_fcat-fieldname   = &1.
    wa_fcat-tabname     = &2.
    wa_fcat-reptext_ddic = &3.
    wa_fcat-col_pos     = &4.
    append wa_fcat to fcat.
    clear wa_fcat.
    end-of-definition.
    imacro 'VBELN'   'it_vbrk' 'PO Document'   '1'.
    imacro 'MATNR'   'it_vbrk' 'material no.'       '2'.
    imacro 'ARKTX'   'it_vbrk' 'Mat. description'   '3'.
    imacro 'NTGEW'   'it_vbrk' 'quantity'        '4'.
    imacro 'GEWEI'   'it_vbrk' 'quantity unit'     '5'.
    imacro 'NETWR'   'it_vbrk' 'net price'   '6'.
    imacro 'WERKS'   'it_vbrk' 'plant'     '7'.
    ****************DEFINE LAYOUT
    lyout-zebra             = 'X'.
    lyout-colwidth_optimize = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = sy-cprog
      I_CALLBACK_PF_STATUS_SET          = ' '
       I_CALLBACK_USER_COMMAND           = 'USER'
      I_CALLBACK_TOP_OF_PAGE            = 'MY NAME'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = 'I M THAT'
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = lyout
       IT_FIELDCAT                       = fcat
      TABLES
        T_OUTTAB                          = IT_VBRP
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    ELSE.
    LOOP AT IT_VBRP INTO WA_VBRP.
    WRITE: /5 WA_VBRP-VBELN, WA_VBRP-MATNR.
    ENDLOOP.
    ENDIF.
    Cheers,
    Rudhir

  • How to truncate the decimals in the ALV report for the quantity field

    Hi All,
    I have to display a quantity field and units of measure in the ALV output. If the units of measure eq 'PC' i should not display the decimal places for quantity in the alv output, otherwise i have to display the decimals in the output. How to do this....any help would be highly rewarded. I knew that for this type of cases decimal_o will not work.

    Hi,
    Declare one more Internal table same as output table. In that intead of that quantity field, declare field_name(15) type c.
    data temp type i.
    Loop at itab.
    if field = 'PC'.
    temp = qunantity field.
    field_name =temp.
    else.
    field_name = quantity field.
    endif.
    endif.
    endloop.

  • Need to display data on the right side in the header area of alv report.

    hi experts,
                       I want to display data in the header area of alv report on the right side  . I have already used function for events on the header side data is getting displayed on the left side .but i want data to be displayed on the right side.
    regards,
    andrews.

    Hi,
    Hope this below code helps you.
    Take care,
    Çağatay.
    * build header for alv
    FORM top_of_page_split USING r_top TYPE REF TO cl_dd_document.
    DATA: s_tab TYPE sdydo_text_table,
          c_area TYPE REF TO cl_dd_area,
          text TYPE sdydo_text_element.
    TYPES: BEGIN OF tab_text,
    text TYPE sdydo_text_element,
    END OF tab_text.
    DATA: i_text TYPE TABLE OF tab_text.
    DATA: w_text TYPE tab_text.
    CALL METHOD r_top->initialize_document.
    CALL METHOD r_top->vertical_split
    EXPORTING
    split_area = r_top
    split_width = '70%'
    IMPORTING
    right_area = c_area.
    CONCATENATE sy-datum+4(2)
    sy-datum+6(2)
    sy-datum(4)
    INTO date1.
    CONCATENATE 'DATE'  date1
    INTO w_text-text
    SEPARATED BY ':'.
    APPEND w_text TO i_text.
    CONCATENATE 'time:' sy-uzeit INTO w_text .
    APPEND w_text TO i_text.
    CONCATENATE 'uesr:' sy-uname INTO w_text .
    APPEND w_text TO i_text.
    CONCATENATE 'local date:' sy-datlo INTO w_text .
    APPEND w_text TO i_text.
    CONCATENATE 'time zone:' sy-zonlo INTO w_text .
    APPEND w_text TO i_text.
    s_tab[] = i_text[].
    CALL METHOD c_area->add_text
    EXPORTING
    text_table = s_tab
    fix_lines = 'X'
    sap_fontsize = cl_dd_document=>medium
    sap_emphasis = cl_dd_document=>strong.
    CALL METHOD r_top->add_gap
    EXPORTING
    width = 60.
    text = 'THIS IS REPORT HEADING'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'STRONG'.
    CALL METHOD r_top->new_line.
    CALL METHOD r_top->add_gap
    EXPORTING
    width = 70.
    text = 'THIS IS REPORT HEADING1'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'STRONG'.
    CALL METHOD r_top->new_line.
    CALL METHOD r_top->add_gap
    EXPORTING
    width = 80.
    text = 'THIS IS REPORT HEADING2'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'STRONG'.
    CALL METHOD r_top->new_line.
    text = 'Report Subheading1'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'NORMAL'.
    CALL METHOD r_top->new_line.
    text = 'Report Subheading2'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'NORMAL'.
    CALL METHOD r_top->new_line.
    text = 'Report Subheading3'.
    CALL METHOD r_top->add_text
    EXPORTING
    text = text
    sap_emphasis = 'NORMAL'.
    CALL METHOD r_top->new_line.
    ENDFORM. "TOP_OF_PAGE_SPLIT

  • How to get  the actual data in ALV report

    I am doing some upgradation work   in that i am using Submit  & And return and  also i am using some function modules like LIST FROM MEMORY , LIST TO TXT wnd WRITE LIST , it gives output in normal list format , But i need to print in ALV report .
    With the use of set table for 1st display i got the  ALV report   but not with actual data, (some junk value is showing) , So can any 1 suggest me how to get  the  actual data in ALV report, With the use of  Any Function Module or with Coding,
    with regards,

    Hi Saravana
    I am sure you must be getting the values in tables of table parameters from every FM.
    consolidate the values from tables of all FMs in one table and built ALV for that table only.
    I hope this way you can show the actual data in ALV.
    thanks
    Lalit

  • How to add 2 more field to the  Header of FBL5N ALV report output

    Hi All,
    I have copied and made some modification to the standard transaction FBL5N and added some fields to the ALV report line Items but how to add fields to the header part i.e if you execute the transaction FBL5n, you will get the ALV report, in the header part customer no, company code then I need to add the 2 more fields. can any one tell me that which structure or where I need to add these fields to be appear in ALV output screen.
    Thanks in advance.
    Swapna.

    Hi Mohamed,
    If you copied Z-FM successfully, then you have to go to subroutine TOP_OF_PAGE to add your field:
    *&      Form  TOP_OF_PAGE
    FORM top_of_page.
      DATA: b_suppress   LIKE boole-boole,
            opfi_text    LIKE eptext OCCURS 10 WITH HEADER LINE,
            n_color      TYPE i.
    *  IF     NOT it_items-bukrs IS INITIAL               "737295
    *     AND NOT it_items-konto IS INITIAL               "737295
    *     AND NOT it_items-koart IS INITIAL.              "737295
      gs_items = gt_alv.
    *  ENDIF.                                             "737295
    * skip first call at top of page:
      IF NOT gd_first_top IS INITIAL.
        CLEAR gd_first_top.
        EXIT.
      ENDIF.
      IF x_grid = c_x OR x_inet = c_x.                          "1012201
        PERFORM grid_top_of_page.
        EXIT.
      ENDIF.
    *... open FI: get header text.
    * first fill some RFXPO fields for general info:
      CLEAR: s_rfxpo, wa_kna1, wa_lfa1, wa_ska1.
      s_rfxpo-bukrs = gs_items-bukrs.
      s_rfxpo-kkber = gs_items-kkber.
      s_rfxpo-koart = gs_items-koart.
      s_rfxpo-konto = gs_items-konto.
      s_rfxpo-vrbez = gs_variant-variant.
      s_rfxpo-waers = gs_items-waers.
    * update master record:
      PERFORM fill_master_rec  USING gs_items-koart
                                     gs_items-konto
                                     gs_items-bukrs. " note 698396
      CALL FUNCTION 'OPEN_FI_PERFORM_00001640_E'
        EXPORTING
          i_rfxpo             = s_rfxpo
          i_kna1              = wa_kna1
          i_lfa1              = wa_lfa1
          i_ska1              = wa_ska1
        IMPORTING
          e_suppress_standard = b_suppress
        TABLES
          t_lines             = opfi_text.
    *... display open FI text:
      IF x_konto_sort = 'X'.
        LOOP AT opfi_text.
          CASE opfi_text-color.
            WHEN 1.
              FORMAT COLOR 1.
            WHEN 2.
              FORMAT COLOR 2.
            WHEN 3.
              FORMAT COLOR 3.
            WHEN 4.
              FORMAT COLOR 4.
            WHEN 5.
              FORMAT COLOR 5.
            WHEN 6.
              FORMAT COLOR 6.
            WHEN 7.
              FORMAT COLOR 7.
          ENDCASE.
          WRITE: / opfi_text-text.
        ENDLOOP.
        FORMAT RESET.
      ENDIF.
    *... display other header text:
      IF b_suppress NE 'X'.
        PERFORM display_custom_header.
        PERFORM display_ccard_lines.
      ENDIF.
    " Put your field somewhere...
    ENDFORM.                               " TOP_OF_PAGE
    Good luck,
    Thanks,

  • Eliminate page heading in the spool of ALV report

    Hi,
    We are running the ALV report in the background, and when we view the spool
    the page heading and the column heading is displayed for all the pages, Is there some way to
    eliminate this.
    The download from the on-line exec is fine,but the download from the spool includes the column
    headings for each page. Is there some way to check if the ALV report is run in the batch mode
    and to disable the heading from Page 2 to N.
    Appreciate any input.
    Thank you
    Lalitha

    Hi,
    I need to avoid the column headings also, I need the heading in the first page, but not on the subsequent pages.
    Is there any setting in the ALV function modules to prevent this ?
    So wanted to know if there is some setting to accomplish that.
    Thank you
    Lalitha

  • What's the coolest, slickest way to present multiple ALV reports?

    Greetings and good day, everyone.
    Okay, I'm working on an update program, and the users have identified at least three different reports they would like coming out of this thing.  One report is a list of transactions that fail internal logic checking, the second report is a list of transactions that pass internal logic checking but fail to update via a BAPI, and a third report is a list of transactions that pass checks and process correctly (i.e. update the database) via the BAPI.
    At first, still being a newbie, I was wondering how I was going to create multiple ALV reports.  I know I could do this using the WRITE statement, writing each report one after the other, but they have asked for the ALV report so they can do all the ad-hoc manipulating, sorting, etc. that ALV provides.
    I came up with these options:
    1.  Instead of filling my single screen with the container control for an ALV report, as I usually do, this time I could put three containers on the screen.  However, I know that cramps space, and I don't know if they'll be able to adjust or move things around other than scrolling.
    2.  Display a single ALV report on the screen, but have buttons somehow on the top that somehow take the user to other screens for the other reports.
    3.  First give the user a screen with all the buttons for the reports.  They choose one, and the ALV report displays.  They can click back to return to this screen, then choose a different report.
    Nobody else in the office has done anything like this yet using the ALV, so I've got a chance to break some new ground internally and do something slick.  Which option is best, and if so, do you have examples or general guidelines of how I do it?  I've not had dialog programming, although I do understand the concepts from VB/Delphi experience over 10 years ago.  I think I lean toward option 2, but I figured this couldn't be new ground in the SAP world and surely someone's done exactly this sort of thing.
    Please help!  ALL helpful responses, as always, are awarded points!  Thanks so much!
    Dave

    Dave,
    These are all good suggestions.  I would just remember to keep in mind when designing your report two different things.
    1.  Can your program be run in foreground or background?  If it has to be run in background due to data volumes you will lose all interactive capabilities of ALV.  You might also not be able to do three different ALVs on the screen in background.
    2.  I am not sure if I understand your option 3 but if you are talking about the user selecting the options before the load the data, they might have to attempt to load the data multiple times to get all of the report.
    My recommendation ( I think somebody already mentioned this) is to have a single ALV with a column on your report that the user can then sort or filter by.  This way you are not limited to a program that has to be run in foreground. 
    Chris

  • How to print the logo in top centre (alv report)

    Hi friends,
         I need to print the company logo in the centre top of the alv report.Using the reuse_alv_commentry_write the logo is coming in the right side corner of report.
    Thanks & Regards,
    vijay.

    Hi,
    Try this out
    Build report title
      PERFORM build_report_title USING gd_report_title gd_logo.
      DATA:  gd_logo             TYPE sdydo_value,
    *&      Form  BUILD_REPORT_TITLE
          Build table for ALVtree header
    <->  p1        Header details
    <->  p2        Logo value
    FORM build_report_title CHANGING
          pt_report_title  TYPE slis_t_listheader
          pa_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader,
            ld_date(10) TYPE c.
    List Heading Line(TYPE H)
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    ls_line-key     "Not Used For This Type(H)
      ls_line-info = 'User Message Service'.
      APPEND ls_line TO pt_report_title.
    Users name (Status Line- TYPE S)
      ls_line-typ  = 'S'.
      ls_line-key  = 'Name '.
      ls_line-info = gd_myname.
      APPEND ls_line TO pt_report_title.
    Status Line(TYPE S)
      ld_date(2) = sy-datum+6(2).
      ld_date+2(1) = '/'.
      ld_date3(2) = sy-datum4(2).
      ld_date+5(1) = '/'.
      ld_date+6(4) = sy-datum(4).
      ls_line-typ  = 'S'.
      ls_line-key  = 'Date'.
      ls_line-info = ld_date.
      APPEND ls_line TO pt_report_title.
    Action Line(TYPE A)
    CLEAR ls_line.
    ls_line-typ  = 'A'.
    CONCATENATE 'Report: ' sy-repid INTO ls_line-info  SEPARATED BY space
    APPEND ls_line TO pt_report_title.
    ENDFORM.                    "build_report_title
      CALL METHOD gd_userlist->set_table_for_first_display
         EXPORTING
                   is_hierarchy_header  = gd_hierarchy_header
                   it_list_commentary   = gd_report_title
    <b>              i_logo               = gd_logo</b>
                  i_background_id      = 'ALV_BACKGROUND'
                   i_save               = 'A'
                   is_variant            = gd_variant
         CHANGING
                   it_outtab            =  it_emptytab      "Must be empty
                   it_fieldcatalog      =  gd_fieldcat.

  • Setting the column labels in webdynpro abap alv report

    Hello,
    Right now I have programmed an ALV report. The selection criterion and the display of the report all work.
    However, there is an issue with the labels of columns in the ALV report. The report takes the field names of the structure I am using in the ALV report as the labels of the report. I have been trying to play around with the ALV class model to see if something will change the labels of the fields but to no avail. Would you guys know of some code or way to change the labels of the columns in the ALV report.
    Thank you for your help in advance.
    Sumit.
    Here is some of the code I tried but does no work in the wdInit() method. It does not change the label. Any suggestions???
    METHOD wddoinit .
    * instantiate used component from wizard
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
    IF lo_cmp_usage->has_active_component( ) IS INITIAL.
      lo_cmp_usage->create_component( ).
    ENDIF.
    * call a method in the used component from wizard
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
        DATA lo_value TYPE REF TO cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
    DATA: lr_field TYPE REF TO cl_salv_wd_field.
    lr_field = lo_value->if_salv_wd_field_settings~get_field( 'CUSTOMER_NUMBER' ).
    * change the label of the report.
    DATA: lr_CUSTOMER_NUMBER TYPE REF TO cl_salv_wd_column.
                CALL METHOD lo_value->if_salv_wd_column_settings~get_column
                  EXPORTING
                    id     = 'CUSTOMER_NUMBER'   receiving value  = LR_CUSTOMER_NUMBER.
    * SET THE LABEL OF THE COLUMN
    DATA: HR_CUSTOMER_NUMBER TYPE REF TO CL_SALV_WD_COLUMN_HEADER.
    CALL METHOD lr_customer_number->get_header
      receiving
        value  = HR_CUSTOMER_NUMBER.
    ***** set the text of the column
    CALL METHOD hr_customer_number->set_text
      EXPORTING
        value  = 'Customer1 Number1'.
    ENDMETHOD.

    You have to disable the DDic binding on the column before your override text will show up:
    data: l_ref_cmp_usage type ref to if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
      if l_ref_cmp_usage->has_active_component( ) is initial.
        l_ref_cmp_usage->create_component( ).
      endif.
      data l_salv_wd_table type ref to iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv( ).
      data l_table type ref to cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
      data l_column type ref to cl_salv_wd_column.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
      data l_header type ref to cl_salv_wd_column_header.
      l_header = l_column->get_header( ).
      l_header->set_prop_ddic_binding_field(
        property =  if_salv_wd_c_ddic_binding=>bind_prop_text
        value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
      l_header->set_text( `Posting Date` ).

  • How to Download the report from the workitem?

    Hi,
    I have one typical requirement that is to download the report from the Workitem by the manager?
    Would any body please give the solution and procedure?
    If you have any sample code for that give it tome?
    Early reply is appriciable.
    Regards,
    Chow.

    If it is an ALV report you don't have to do any coding. You don't say which report it is.
    If it is a report that uses write statements you can also export to a spreadsheet, but of course the cell matching is not quite as for ALV reports since the report creator decides the alignment. Use the menu item "System" => "List" => "Save" (the menu item names may be a little different since I have translated them from Norwegian).

  • Single row in alv report

    Hi experts...
    I want single row in alv report.
    I have use loop for fatch data into internal table using loop when i am passing data in alv report then the data comes according loop. i want onlu one data in alv row.
    how can i do such, plz help me.

    decleare two internal table.
    read table itab into  wa index  1.
    append wa to itab2.
    pass itab2 only one record display.

Maybe you are looking for