Field Length in Alv Grid out put

hi,
How to increase the length of the filed in the output of alv grid,
Actually i am getting one blank field in the alv grid out put, my requirement is to increase the length through out the column how to do that
can anyone guide me plz
SIRI

in your fieldcat of the field
wfieldcat-fieldname = '<your fieldname in caps>'
wfieldcat-outputlen = 10 (or the length you want for the field)
<you can define any other property also for that field>
append wfieldcat to ifieldcat.
now pass it in fm.
regards
shiba dutta

Similar Messages

  • ALV GRID out put issue

    hi,
    how to increase the font size of the output of alv grid...
    Actually my list is printing nearly 50 lins in one page how to control it to 20 and how to increase the font size in the alv grid output
    can anyone guide me its bit urgent  plzzzzzz
    SIRI

    Ya Rich,
    Actually... While i am taking all the records on the paper i got all the records on one page so if they wanted to enter some more data in the last filed which i provided blank they were telling that its too small font and its not so easy to enter
    so they were asking me to do the above job
    how to do that can u guide me plz
    SIRI

  • Validation I/P Enabled field in the ALV grid

    Hi all,
    Which method is used for validating a value entered in a reprot output field of an ALV Grid OO report.
    can some one please throw some light on this.
    with a few example programs where it has been implemented.
    Regrds

    Hi sushi,
      check this Program :  BCALV_EDIT_04
      to check out, Execute it , select the checkbox , and give any non numeric amount in the amount field , it will display an error

  • How to make a field manadatory within ALV Grid using methods and classes

    Hi,
    I am using ALV Grid using set_table_for_first_display
    inside my dialog programming. I have a field called project number inside my grid which has to be made as mandatory field.
    I have defined a method called catch_data_changed inside my class lcl_event_receiver. This method captures the changes made to one of the fields inside my ALV grid and displays all the default values of the other fields from the grid.
    Now, i have to make project number which is one of my fields inside my ALV grid as mandatory. At the field catalog level i did not find any such option for making a field as required field.
    Is there any other way, i can accomplish this within the ALV grid?

    from my understanding from ur question, i understood that u want the editable field inside alvgrid to be mandatory.
    i dont know anthing in fieldcat, but u can try the following logic.
    FORM DATA_CHANGED  USING P_ER_DATA_CHANGED TYPE REF TO
    CL_ALV_CHANGED_DATA_PROTOCOL .
      DATA: L_VALUE TYPE LVC_VALUE,
        ls_mod_cell type lvc_s_modi.
      READ TABLE P_ER_DATA_CHANGED->MT_MOD_CELLS INTO LS_MOD_CELL.
    if sy-subrc = 0.
        CALL METHOD P_ER_DATA_CHANGED->GET_CELL_VALUE
          EXPORTING
            I_ROW_ID    = LS_MOD_CELL-row_id
            I_FIELDNAME = LS_MOD_CELL-fieldname
          IMPORTING
            E_VALUE     = L_VALUE.
    IF LS_MOD_CELL-FIELDNAME <> 'fieldname what u want'
    MESSAGE 'ENTER VALUE INTO (fieldname u want) ' TYPE 'I'.
    ENDIF.
    ELSE.
    MESSAGE 'ENTER VALUE INTO (fieldname u want) ' TYPE 'I'.
    ENDIF.

  • Regardig Field Length in ALV

    I am trying to set the field length in ALV
    so i wrote
    <fs_fcat>-outputlen                      = 15.
    and in layout...
    wa_layout-colwidth_optimize  = space .      tried by commenting this statment also
    But it doesnt show any effect
    " in fact field length is depend on field lable and on its content..."
    so plz help me some buddy.....
    Edited by: anurodh_t on Sep 29, 2010 3:58 PM

    Hello,
    Try updating the description fields of the Fieldcat records prior to defining the outputlen field. Depending on the way you are implementing your ALV, try updating the following fields:
    scrtext_l
    scrtext_m
    scrtext_s
    or
    seltext_l
    seltext_m
    seltext_s
    Best regards,
      Mário Espinheira

  • Reduce out put field length of alv output in back ground

    Hi all,
    Is there a way to reduce the output length of the field in back groundfor ALV out put
    Its back ground
    I have thsi things in my field catalog
    wa_fieldcat-outputlen = 10.
    wa_fieldcat-ddic_outputlen = 10.
    If the field has value of length 10 characters its ok
    but when the field has lenth of more than 10 characters
    (say 20 char). in fore ground it displays 10 characters and then we can move the column to see full thing , but in back ground it displays 20 char.
    In fact that is what i have to see because in background you cannot drag the column to see entire thing , but i want to cut short to 12 char even if i don't see the remaining thing its ok
    Thanks

    Hi Vasu,
    WHAT EXACTLY SY-BATCH DOES .
    I tried reducing wa_fieldcat-outputlen = 10. and then i tried
    wa_fieldcat-outputlen = 5., but it doesnot really changed anything in back ground but it did in fore ground . I haven't used any called sy-batch
    Let me know
    This is how my field catalog looks for mATNR
    clear wa_fieldcat.
      wa_fieldcat-fieldname = 'MATNR'.
      wa_fieldcat-seltext_l = ' Material #'.
      wa_fieldcat-seltext_m = 'Material #'.
      wa_fieldcat-seltext_s = ' Material #'.
      wa_fieldcat-reptext_ddic   = 'Material #'.
      wa_fieldcat-ddictxt   = 'L'.
      wa_fieldcat-col_pos   = 4.
      wa_fieldcat-outputlen = 18.
      wa_fieldcat-intlen    = 18.
      wa_fieldcat-ddic_outputlen = 18.
      wa_fieldcat-tabname   = '1'.
      append wa_fieldcat to fieldcat.
    NEXT TIME I COMMENTED THIS AND HAD
    wa_fieldcat-fieldname = 'MATNR'.
      wa_fieldcat-seltext_l = ' Material #'.
      wa_fieldcat-seltext_m = 'Material #'.
      wa_fieldcat-seltext_s = ' Material #'.
      wa_fieldcat-reptext_ddic   = 'Material #'.
      wa_fieldcat-ddictxt   = 'L'.
      wa_fieldcat-col_pos   = 4.
      wa_fieldcat-outputlen = 10.
      wa_fieldcat-intlen    = 10.
      wa_fieldcat-ddic_outputlen = 10.
      wa_fieldcat-tabname   = '1'.
      append wa_fieldcat to fieldcat.
    BUT I DID SEE DIFFERENCE IN FOREBROUND BUT NOT IN BACK GROUND
    Let me know
    Thanks

  • How to display field of 250 character length using ALV Grid display

    Hello Experts,
    Currently I'm using 4.6 version.
    I got to insert a new field of length 250 characters into an existing ALV grid display.
    I passed a value of length 250 chars into the field and assigned it to the itab passing to the fn module
    'REUSE_ALV_GRID_DISPLAY'.
    But in the ALV display I am able to view only 132 chars only. I increased the line-size of the report also accordingly. But I'm unable to view all the 250 chars.
    Kindly help me out in fixing this issue.

    you just can't do that
    I suggest that you put the first characters in cell and allow user to double-click on cell in order to view the full value in a popup window

  • How to display a field that has more than 136 char length in ALV GRID

    Hi Experts,
    I have an issue and need to solve ASAP.
    I want to display a text of length 400 character in a particular column in ALV GRID DISPLAY. After executing the report it is displaying only 136 length char in the output and when I download the report to an excel it is showing only 255 characters, but my field length is almost 400 char and want to display in the report output.
    I checked in SDN and didnt get any answers which will solve this.
    Please help me to complete this issue.
    Thanks
    Retheesh

    Currently I'm in a same problem with you.
    And this is what I found
    Size of data fields: While the list-based ALVList can display only tables of up to 90 columns, the control-based *ALVGrid and ALVFullscreen have a limitation of 128 characters per data cell.*
    So it means that maximum for alv grid is only 128.
    Please refer to this documentation
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4544e790-0201-0010-c29c-e46c389f5a96]
    you can find the statement above in page 5.
    Please let me know if you have another solution, because I would like to see it too.
    Thanks
    Regards
    Hadi

  • Field Catolgue in alv grid display

    Hi Abapers,
    I need to display the percentage rows with decimals and other rows without decimal . Is their any option in field catalog to do like this. Or tell me any other alternative to achieve this.
    sno  total     col1      col2      col3
    1      220       100        20       100
    2      320      120         50        150
    tot    540       220        70         250
    per               40.74     1.87  and so on
    or ,
    I have two different internal tables how can i put it in one field catalog to pass it to alv grid display.
    Regards,
    Priya

    Don't   do  total  by your  self  in the Pogram.
    in the   Fieldcatalog  there is an Attribute which will do total  &  Average .
    Enable it so that  from one  internal  table   data   it self it will do  good.
    example program
    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                 .
    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
    gowri
    Message was edited by:
            Gowri Krishna

  • FIeld headings in ALV Grid by label

    Hi
    I want disply the headings in alv grid display like this format.
    I want write my own label in the output. (not in Normal LIST DISPLAY)
    Sno |      Sname |    Marks
        |           |     M1 |  M2  | M3
    How it is possible?
    Edited by: Krishna Bommisetty on Sep 11, 2008 10:55 AM

    Hi,
      Check the below code.
    WA_FCAT-SELTEXT_M   = TEXT-073.
      WA_FCAT-DDICTXT      = 'M'.
    We can define the name of the field label as mentioned above, where texto073 is nothing but the field label you want to give to the particular field.
      DDICTXT you have to mention the length as small 'S', medium 'M' and large as 'L'.

  • Error in field catalog in ALV grid display using classes at do_sum = "X'.

    Hi,
    I'm using classes in ALV Grid display.
    the code for the field catalog is going to dump because of the statement in the field catalog for field 'netwr',do_sum = 'X'.
    that do_sum = 'X' is not working and going to dump when executed.with out that do_sum it is working fine. the error in dump analysys is showing sap standard incude LSLVCF01.
        assign component
               <ls_fieldcat>-fieldname of structure rt_data to <g_field>.
        if sy-subrc ne 0.
          message x000(0k).
        endif.
    sy-subrc is 4 when the program is being executed.
    CODE:
    FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      ls_fcat-fieldname = 'VBELN1'.
      ls_fcat-ref_field = 'VBELN'.
      ls_fcat-ref_table = 'VBRK'.
      ls_fcat-coltext = 'Invoice No'.
      ls_fcat-seltext = 'Invoice No'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'BUDAT'.
      ls_fcat-ref_table = 'BKPF'.
      ls_fcat-coltext = 'Invoice Date'.
      ls_fcat-seltext = 'Invoice Date'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ls_fcat-fieldname = 'NETWR'.
      ls_fcat-ref_field = 'NETWR'.
      ls_fcat-ref_table = 'VBRK'.
      ls_fcat-coltext = 'Value of Invoice'.
      ls_fcat-seltext = 'Value of Invoice'.
      ls_fcat-datatype = 'CURR'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ENDFORM.
    can u please look in the code and rectify the error,
    would appeciate ur response.
    regards,
    veera.

    Hi,
    try this..
    ls_fcat-fieldname = 'NETWR'.
    ls_fcat-ref_field = 'NETWR'.
    ls_fcat-ref_table = 'VBRK'.
    ls_fcat-coltext = 'Value of Invoice'.
    ls_fcat-seltext = 'Value of Invoice'.
    ls_fcat-datatype = 'CURR'.
    ls_fcat-do_sum = 'X'.
    <b>ls_fcat-cfieldname = 'WAERS'.</b>
    APPEND ls_fcat TO pt_fieldcat.
    CLEAR ls_fcat.
    Regards
    vijay

  • How change standard field lable in alv grid display

    Hi Experts,
        How are you doing! I am having some doubts in the alv grid display, I am new to this concepts.
    I want to display field  lable manually, actually its taking from table field discription but I want to display one field name manually.
    example code.
    ls_fldcat-fieldname = 'BPKIND'.
      ls_fldcat-ref_tabname = 'BUT000'.
      ls_fldcat-ref_fieldname = 'BPKIND'.
      APPEND ls_fldcat TO lt_fldcat.
      ls_fldcat-fieldname = 'PARTNER2'.
      ls_fldcat-ref_tabname = 'BUT051'.
      ls_fldcat-ref_fieldname = 'PARTNER2'.
    Here I dont want to display 'PARTNER2' I need 'KEY ACCOUNT MANAGER'.
    Please send me how to do this.
    Surya Ramireddy.

    Hi
      Please check out this program.
    Type-pools: slis.
    Tables: likp.
    Data: Begin of i_likp occurs 0,
            vbeln like likp-vbeln,
            ernam like likp-ernam,
            erzet like likp-erzet,
            erdat like likp-erdat,
          End of i_likp.
    Data: it_fieldcat type slis_t_fieldcat_alv,
          wa_fieldcat type SLIS_FIELDCAT_ALV,
          it_events type slis_t_event.
    Selection-screen: Begin of block b1 with frame title text-001.
      select-options: s_vbeln for likp-vbeln.
    Selection-screen: End of block b1.
    start-of-selection.
    perform get_sales_header_data.
    end-of-selection.
    perform field_catalogue.
    perform modify_field_catalogue.
    perform display_alv_grid_display.
    *&      Form  get_sales_header_data
          text
    -->  p1        text
    <--  p2        text
    form get_sales_header_data .
    select vbeln
           ernam
           erzet
           erdat
           into table i_likp
           from likp
           where vbeln in s_vbeln.
    endform.                    " get_sales_header_data
    *&      Form  field_catalogue
          text
    -->  p1        text
    <--  p2        text
    form field_catalogue .
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = sy-repid
       I_INTERNAL_TABNAME           = 'I_LIKP'
       I_INCLNAME                   = sy-repid
      CHANGING
        ct_fieldcat                  = it_fieldcat
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
    endform.                    " field_catalogue
    *&      Form  modify_field_catalogue
          text
    -->  p1        text
    <--  p2        text
    form modify_field_catalogue .
    loop at it_fieldcat into wa_fieldcat.
    case wa_fieldcat-fieldname.
      when 'VBELN'.
       wa_fieldcat-col_pos = 1.
       wa_fieldcat-seltext_l = 'Sales Doc Header No'.
       wa_fieldcat-emphasize = 'C100'.
      when 'ERNAM'.
       wa_fieldcat-col_pos = 2.
       wa_fieldcat-seltext_l = 'Created By'.
       wa_fieldcat-emphasize = 'C200'.
      when 'ERZET'.
       wa_fieldcat-col_pos = 3.
       wa_fieldcat-seltext_l = 'Entry Time'.
       wa_fieldcat-emphasize = 'C300'.
      when 'ERDAT'.
       wa_fieldcat-col_pos = 4.
       wa_fieldcat-seltext_l = 'Created On'.
       wa_fieldcat-emphasize = 'C400'.
      endcase.
      modify it_fieldcat from wa_fieldcat.
    endloop.
    endform.                    " modify_field_catalogue
    *&      Form  display_alv_grid_display
          text
    -->  p1        text
    <--  p2        text
    form display_alv_grid_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = sy-repid
       IT_FIELDCAT                       = IT_FIELDCAT
      TABLES
        t_outtab                          = i_likp
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    endform.                    " display_alv_grid_display
    Regards
    Haritha.

  • How to download only some fields(dynamically) from alv grid layouts

    I have ALV grid list.
    I have layouts for selecting sets of fields dynamically.
    If I select a particular layout, I want to download only those fields into an Excel sheet.
    If I select another layout, I want to download only fields of that layout , into an Excel sheet.
    Can u plz write examples.
    Narendra

    Hello ,
    Here it is.
      FIELD-SYMBOLS <FS> TYPE ANY.
      DATA: GR_ATTACHMENT TYPE Z48S3_ATTACHMENT,
            GT_ATTACHMENT TYPE Z48S3_ATTACHMENT_TAB,
            L_F_TITLE     TYPE SO_OBJ_DES,
            L_R_FIELDCAT  LIKE LINE OF GT_FIELDCAT,
            L_F_FIELD     LIKE L_R_FIELDCAT-FIELDNAME,
            L_F_EMAILID   TYPE Z48S3_RECEIVER,
            L_F_FIRST     TYPE C.
      IF SY-SYSID EQ G_C_DEV_SYSTEM OR
         SY-SYSID EQ G_C_QUA_SYSTEM.
        CONCATENATE SY-SYSID '/' SY-MANDT ':' INTO L_F_TITLE.
        CONDENSE L_F_TITLE.
        CONCATENATE L_F_TITLE SY-TITLE INTO L_F_TITLE SEPARATED BY SPACE.
      ELSE.
        L_F_TITLE = SY-TITLE.
      ENDIF.
      G_R_VARIANT-REPORT = SY-REPID.
      G_R_VARIANT-VARIANT = P_VARIAN.
      CALL FUNCTION 'REUSE_ALV_VARIANT_SELECT'
           EXPORTING
                I_DIALOG            = 'N'
                I_USER_SPECIFIC     = 'A'
                I_DEFAULT           = 'X'
                IT_DEFAULT_FIELDCAT = G_T_FIELDCAT
                I_LAYOUT            = GR_LAYOUT
           IMPORTING
                ET_FIELDCAT         = G_T_FIELDCAT
                ES_LAYOUT           = GR_LAYOUT
           CHANGING
                CS_VARIANT          = G_R_VARIANT
           EXCEPTIONS
                ERROR_MESSAGE       = 4
                OTHERS              = 4.
      SORT G_T_FIELDCAT BY COL_POS.
      PERFORM CREATE_EXCEL_ATTM_HEADING_ROW TABLES GT_ATTACHMENT
                                                   G_T_FIELDCAT.
      LOOP AT G_T_ALVLIST.
        L_F_FIRST = 'X'.
        LOOP AT G_T_FIELDCAT INTO L_R_FIELDCAT WHERE NO_OUT IS INITIAL.
          CLEAR GR_ATTACHMENT-XNEWLINE.
          IF NOT L_F_FIRST IS INITIAL.
            GR_ATTACHMENT-XNEWLINE = 'X'.
            CLEAR L_F_FIRST.
          ENDIF.
          CLEAR L_F_FIELD.
          CONCATENATE 'G_T_ALVLIST-' L_R_FIELDCAT-FIELDNAME
                 INTO L_F_FIELD.
          CONDENSE L_F_FIELD.
          ASSIGN (L_F_FIELD) TO <FS>.
          WRITE <FS> TO GR_ATTACHMENT-FIELDVALUE.
          UNASSIGN <FS>.
          APPEND GR_ATTACHMENT TO GT_ATTACHMENT.
        ENDLOOP.
      ENDLOOP.
    Regards,
    Vasanth

  • Fieldcontent in field catalog in ALV GRID with leading blanks to be display

    Hello,
    I want to display the result of a report in an ALV Grid.
    There are different columns in the ALV, one of them contains text, sometimes with leading blanks.
    The ALV does not display the blanks, cut them and moves the rest to the left.
    I have used LVC_S_FCAT-JUST with 'R' but this moves the content of the field only to the right (right justified), so that it looks like there is always a lot of blnks on the left side . 
    Is there any possibility to display blanks when they appear in the text field?
    e.g.
    TEXT1 (10)
      9991-A
    9950-B
          9090-T
    9675-N
    Do´t ask, why there are leading blanks. It is always your customer or manager who determines the results!
    Thank you very much for any hint that brings happiness into the face of  this customer / manager.
    Best regards
    Dirk

    Hi Sunil,
    unfortunately this did not help!
    But what can I expect, when the forum works the same.
    e.g.
    TEXT1 (10)
    9991-A
    9950-B
    9090-T
    9675-N
    should more look like:
    e.g.
    TEXT1 (10)
    9991-A
    _9950-B
    ___9090-T
    __9675-N
    but without all the '_'.  
    Regards
    Dirk

  • Increase edit length in ALV GRID

    Hi All,
    I am using wa_fieldcat-edit for editing the ALV outreport.
    But here by editing i am able to enter only 10 characters in that filed.
    How can i increase this length upto 40 characters.
    Please help me in this.
    Regard,
    Kalyan Varma

    Hi Kalyan.
    You can make any field of your alv editable by passing "X'in the edit parameter of the field catalog.Once you have made the field editable you can change its value.By deafult the width of that field with be equal to the size of the field of the internal table through which you are displaying the data in alv.If u want to increase or decrease the width by using the outputlen parameter of the field catalog as i have mentioned in my earlier post.
    I tried it on my code.Initially the matnr was of length 18 but i increased it length to 40.The code is as follows:
    DATA : OUT_LEN LIKE dd03p-outputlen VALUE '40'.
    DATA : I_FCAT TYPE SLIS_T_FIELDCAT_ALV,
           wa_fcat TYPE SLIS_FIELDCAT_ALV.
    DATA : C_CHECK TYPE C VALUE 'X'.
    LOOP AT I_FCAT INTO WA_FCAT.
      if ( wa_fcat-fieldname = 'MATNR' ).
      WA_FCAT-HOTSPOT = C_CHECK.
      WA_FCAT-EDIT = C_CHECK.
      WA_FCAT-outputlen = OUT_LEN.
      ENDIF.
      MODIFY i_fcat  FROM wa_fcat TRANSPORTING edit OUTPUTLEN.
      ENDLOOP. 
    In the end you have to pass the i_fact(field catalog) to the IT_FIELDCAT parameter of REUSE_ALV_GRID_DISPLAY like this.
    IT_FIELDCAT                       = i_fcat
    I think you would be able to solve it now.
    Thanks!!

Maybe you are looking for

  • How to move photos from one hard drive to another without losing data?

    I have lightroom latest version.  I have an in-computer hard drive full of photos.  It is clogging the machine and I am running out of storage space.  To make room, I would like to transfer most photos to an outboard portable hard drive.  How do I do

  • Urgent help needed: WEBAS server suddenly dead.. only SDM is working

    Hi Everyone, We have a WEBAS server installed on win 2003 mahcine. We wanted to install Visual composer and because there was no IIS on server, we installed it. But after installation i am not able to access my server. http://<server_name>:50000/inde

  • Can hear audio, but no video in bridge cs5

    Hi guys, please help. when i play the .mov format in primere PRO CS5,i can both hear and see the videos........ but when i try to browse in the bridge cs5, than i can only hear the audio, but i cannot see the video? By the way i am on win7 / 64bits p

  • Cannot add multiple filters on a single column on certain libraries

    On some of our lists/libraries, we can filter a single column to display a more than one selection. For example, column1 contains the following choices: Yes No Maybe I can add a filter to column1 and select Yes and Maybe. This works in some lists/lib

  • Eap-tls wireless machine authentication without AD

    Hi all, I'm having problems getting EAP-TLS to work when a client machine needs to connect to a WLAN (before logon) I can make the user get a cert from my CA, login as local & connect to WLAN through EAP-TLS without any problem. With admin account I