Alv grid column name display

alv grid column name could not be displayed fully.we manually want to drag the column,to see the column name fully.  for ex. if column name is 'COMPANYNAME'.it shows 'COMPA' alone.
how could i solve this problem....?

hI,
    Check the below code...
*& Report  ZALV_PROGRAAM
REPORT  ZALV_PROGRAAM.
TYPE-POOLS SLIS.
DATA : BEGIN OF WA_KNA1,
KUNNR TYPE KUNNR,
NAME1 TYPE NAME1,
END OF WA_KNA1,
IT_KNA1 LIKE TABLE OF WA_KNA1.
DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.
SELECT KUNNR NAME1 INTO TABLE IT_KNA1 FROM KNA1 UP TO 5 ROWS.
PERFORM FCAT USING '1' 'KUNNR' 'CUSTOMERNUMBER' '40'.
PERFORM FCAT USING '2' 'NAME1' 'CUSTOMERNAME' '40'.
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           = ' '
  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_FCAT
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  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
  I_HTML_HEIGHT_TOP                 = 0
  I_HTML_HEIGHT_END                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  IR_SALV_FULLSCREEN_ADAPTER        =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
  TABLES
    t_outtab                          = IT_KNA1
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  FCAT
      text
     -->P_0052   text
     -->P_0053   text
     -->P_0054   text
     -->P_0055   text
form FCAT  using    FP_COL_POS
                    FP_FIELDNAME
                    FP_SELTEXT_M
                    FP_OUTPUTLEN.
WA_FCAT-COL_POS = FP_COL_POS.
WA_FCAT-FIELDNAME = FP_FIELDNAME.
WA_FCAT-SELTEXT_M = FP_SELTEXT_M.
WA_FCAT-OUTPUTLEN = FP_OUTPUTLEN.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
endform.                    " FCAT
thanks,
Thiru. R

Similar Messages

  • ALV Grid Column name in multiple rows

    Hi,
    When ALV Grid is display columns are displayed horizontally in a single line.
    Is there ne way to display the column names in 2 rows
    e.g : Functional Location column should be shown as
         Functional 
          Location

    Hi,
    Actually it is not possible to disaply in multiple lines.
    ALV grid Multiple Header ... ?
    Re: Multiple lines in alv column headings
    This problem was discussed many times in this forum, u can search for more results.
    Message was edited by: Judith Jessie Selvi

  • Web Dynpro ALV grid column names

    Hi,
    I wish to specify the text that appears on the column names.  At present the name defaults to the field name within the structure.  Is there a way to specify the name that i wish to appear for each column?  Many thanks in advance
    Samir

    Hi,
    Use the following code
    * Instantiate the used component
      DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_usg_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
    * Get Model
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_interfacecontroller =   wd_this->wd_cpifc_usg_alv( ).
      DATA lo_value TYPE REF TO cl_salv_wd_config_table.
      lo_value = lo_interfacecontroller->get_model(
    *---------- ALV table settings.
      DATA: l_table_settings TYPE REF TO if_salv_wd_table_settings .
      l_table_settings ?= lo_value.
      wd_this->l_table =  l_table_settings .
    * Set the Editable property to true
      l_table_settings->set_read_only( abap_false ).
    * Set table header
      DATA: l_header TYPE REF TO cl_salv_wd_header.
      l_header = l_table_settings->get_header( ).
      l_header->set_text( 'Sales Orders' ).
    *---------- Column settings
      DATA: l_column_settings TYPE REF TO if_salv_wd_column_settings.
      l_column_settings ?= lo_value.
    * Get columns
      DATA: lt_columns TYPE salv_wd_t_column_ref ,
            ls_columns TYPE salv_wd_s_column_ref .
      DATA: l_column_header  TYPE REF TO cl_salv_wd_column_header .
      lt_columns = l_column_settings->get_columns( )              .
      LOOP AT lt_columns INTO ls_columns .
       CASE ls_columns-id   .                    
          WHEN 'VBELN'     .
            l_column_header = ls_columns-r_column->get_header( )  .
            l_column_header->set_ddic_binding_field(
               if_salv_wd_c_column_settings=>ddic_bind_none )     .
            l_column_header->set_text( 'Sales Order' ). " column header
           WHEN 'POSNR .
            l_column_header = ls_columns-r_column->get_header( )  .
            l_column_header->set_ddic_binding_field(
               if_salv_wd_c_column_settings=>ddic_bind_none )     .
            l_column_header->set_text( 'Item No' ) . "column header
          WHEN 'ZMENG'.
            l_column_header = ls_columns-r_column->get_header( )  .
            l_column_header->set_ddic_binding_field(
               if_salv_wd_c_column_settings=>ddic_bind_none )     .
            l_column_header->set_text( 'Qty' ). "column header
            WHEN OTHERS                                             .
            ls_columns-r_column->set_visible(
                               cl_wd_uielement=>e_visible-none )  .
        ENDCASE  .
      ENDLOOP.
    Regards,
    Radhika.

  • Display 80 characters of PO text in ALV grid column?

    Hi Guys,
                 I just want to display only 80 characters of PO Header text in the ALV grid column and  the rest should appear when we move the Mouse on to the each ALV grid'd POtext column. So how is it possible 1st tell me how to display 80 characters of PO text.?
      in ME23n u can see the PO  header text.
    Thanks ,
    Gopi.

    Hi Gopi,
    Are you displaying ALV in your custom report and you want to show just 80 char in output?
    If this is yes:
    You can set ALV column width as 80 CHAR while building field catalog.
    Column cell will have complete text but when ALV appears it will first show first 80 char.
    thnx,
    ags.

  • Export TO XXL from ALV Grid - Column order mismatch

    Hi All,
    The user is trying to download data from Option -> Export -> Spreadsheet which will create XXL.
    But while downloading there is mismatch in the order of columns displayed on the alv grid & columns downloaded.
    All character fields are displayed on left, then date fields then quantity fields are downloaded to XXL. but in ALV Grid user has chosen a layout in which date fields come first.
    Please help me to find solution

    Grid display using    'REUSE_ALV_GRID_DISPLAY'. From the alv grid output, user is trying to download data using export -> Excel . so for download there is no custom code.
    We have copied standard report and added few more fields to the custom report. strangely Standard report also has this issue.
    I searched for SAP notes also..no clue

  • ALV GRID AND LIST DISPLAY

    Hi experts, how are you.
    What is the difference between ALV Grid Display and ALV List Display?

    ALV LIST Can be coded using only FMs
    ALV GRID Can be coded using FMs and object oriented concepts
    ALV LIST Can be displayed hieraicharlly
    ALV GRID cannot be displayed hierarichally
    ALV grid uses ActiveX controls
    present on the Presentation Server.
    Hence, it consumes More Memory
    on the presentation server.
    ALV LIST is Display Only.
    Whereas
    ALV Grid Can Be made EDITABLE for entry purpose.
    In alv grid, these options are possible,
    but not in alv list.
    without horizontal lines
    without vertical lines
    without cell merging during sorts
    display total lines above the entries
    Thanks
    Seshu

  • ALV Grid - Columns Displays?

    Any way to display an ALV grid in different sections?
    Meaning, The top half of the report lines up columns differently then the bottom half of the report.
    For instance, The first two columns are always the same for all fields, but becuse the rest of the fields are not related to one another in any way the report breaks and displays te columns differently at a certain point in the output of the display?
                      Thank -You

    In the field catalog give the <b>emphasize</b>.
    For first 2 columns:
    ls_fcat-emphasize  = 'C310'.
    For all other columns:
      ls_fcat-emphasize  = 'C400'.
    These make the ALV columns in different colors.
    In case if u want to color a particular row or particular cell, do the below things:
    Assign  a variable celltab    TYPE lvc_t_styl, in the internal table which u dispaly the data.
    In the layout give,   wa_layout-stylefname = 'CELLTAB'.
    Modify the final internal table like this sample code:
      DATA : lt_celltab  TYPE lvc_t_styl,
             ls_celltab  TYPE lvc_s_styl.
      READ TABLE i_final_data INTO wa_final_data INDEX 1.
      ls_celltab-fieldname = 'LNG_TYPES'.
      ls_celltab-style = '00000060'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      ls_celltab-fieldname = 'LNG_QUANTITY'.
      ls_celltab-style = '00003060'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      ls_celltab-fieldname = 'NG_TYPES'.
      ls_celltab-style = '00000666'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      ls_celltab-fieldname = 'NG_QUANTITY'.
      ls_celltab-style = '00000066'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      wa_final_data-celltab[] = lt_celltab[].
      MODIFY i_final_data FROM wa_final_data INDEX 1.
      CLEAR: ls_celltab, lt_celltab, wa_final_data.
    Here   ls_celltab-style = '00003060' will make that particular cell in different color.
    Regards,
    Prakash.
    Message was edited by: Prakash Ramu

  • ALV grid is not displaying few fields of final internal table of type DMBTR

    hello frnds,
    i am displaying 10 fields in ALV grid using field catalog.
    among them five fields are currency fields on which i doing some arithematic operations. but all these fields are not getting displayed in alv grid.
    here is my code....
    declaring final strucutre to generate report
    TYPES:BEGIN OF ty_final,
              gjahr   TYPE gjahr,       " Year
              wwert   TYPE wwert_d,     " Traslation date
              bukrs   TYPE bukrs,       " company code
              hkont   TYPE hkont,       " General ledger account
              txt20   TYPE txt20_skat,  " Account name
              belnr   TYPE belnr_d,     " Purchase order number
              shkzg   TYPE shkzg,       " Dt/Cr indicator
              dmbtr1   TYPE dmbtr,       " Ammount in local currency
              v_alc   TYPE dmbtr,       " Ammount in local currency
              wrbtr   TYPE wrbtr,       " Ammount in foreign currency
              ebeln   TYPE ebeln,       " Purchase order number
              ebelp   TYPE ebelp,       " Item number
              matnr   TYPE matnr,       " Material number
              menge   TYPE menge_d,     " Qunatity
              meins   TYPE meins,       " Unit of measure
              stprs   TYPE stprs,       " Std material master
              v_iv    TYPE dmbtr,       " Invoice value
              pswsl   TYPE pswsl,       " Currency
              v_erc   TYPE dmbtr,       " Exchange rate calculated
              v_op    TYPE dmbtr,       " Order price
              v_uos   TYPE dmbtr,       " Unit order to stock
              v_io    TYPE dmbtr,       " Invoice to order
              v_uv    TYPE dmbtr,       " Unit value
              v_t     TYPE dmbtr,       " Total
              v_d     TYPE dmbtr,       " Differecne
              netpr   TYPE bprei,       " Net price in purchasing document
              v_total TYPE dmbtr,       " Total
              v_os    TYPE dmbtr,       " Order to stock
              v_ito   TYPE dmbtr,       " Invoice to order
              saknr   TYPE saknr,       " G/L account number
           END OF ty_final.
    FORM move_data.
      IF NOT i_bseg[] IS INITIAL.
        LOOP AT i_bseg INTO wa_bseg.
          wa_final-gjahr  = wa_bseg-gjahr.
          wa_final-bukrs  = wa_bseg-bukrs.
          wa_final-hkont  = wa_bseg-hkont.
          wa_final-belnr  = wa_bseg-belnr.
          wa_final-shkzg  = wa_bseg-shkzg.
          wa_final-wrbtr  = wa_bseg-wrbtr.
          wa_final-ebeln  = wa_bseg-ebeln.
          wa_final-ebelp  = wa_bseg-ebelp.
          wa_final-matnr  = wa_bseg-matnr.
          wa_final-menge  = wa_bseg-menge.
          wa_final-meins  = wa_bseg-meins.
          wa_final-pswsl  = wa_bseg-pswsl.
          wa_final-dmbtr1  = wa_bseg-dmbtr.
          wa_final-saknr  = wa_bseg-saknr.
          wa_final-v_total = wa_bseg-dmbtr.
          READ TABLE i_bkpf INTO wa_bkpf WITH KEY bukrs = wa_bseg-bukrs.
          IF sy-subrc = 0.
            wa_final-wwert = wa_bkpf-wwert.
          ENDIF.
         CLEAR wa_bkpf.
          READ TABLE i_mbew INTO wa_mbew WITH KEY matnr = wa_bseg-matnr.
          IF sy-subrc = 0.
            wa_final-stprs = wa_mbew-stprs.
          ENDIF.
         CLEAR wa_mbew.
          READ TABLE i_ekpo INTO wa_ekpo WITH KEY ebeln = wa_bseg-ebeln.
          IF sy-subrc = 0.
            wa_final-netpr = wa_ekpo-netpr.
          ENDIF.
         CLEAR wa_ekpo.
          READ TABLE i_skat INTO wa_skat WITH KEY saknr = wa_bseg-saknr.
          IF sy-subrc = 0.
            wa_final-txt20 = wa_skat-txt20.
          ENDIF.
    calculating output values
          IF wa_bseg-shkzg = 'H'.
            wa_final-v_alc = -1 * wa_bseg-dmbtr.
          ELSEIF wa_bseg-shkzg = 'S'.
            wa_final-v_alc = 1 * wa_bseg-dmbtr.
          ENDIF.
         DATA : l_c_v_alc TYPE p DECIMALS 2,
         l_c_v_iv TYPE p DECIMALS 2.
         l_c_v_alc = wa_final-v_alc.
          IF wa_bseg-menge NE 0.
            wa_final-v_iv = wa_bseg-dmbtr / wa_bseg-menge.
          ENDIF.
          IF wa_bseg-dmbtr NE 0.
            wa_final-v_erc  = wa_bseg-wrbtr   / wa_final-dmbtr1.
          ENDIF.
          IF wa_final-v_erc NE 0.
            wa_final-v_op   = wa_ekpo-netpr   / wa_final-v_erc.
          ENDIF.
          wa_final-v_uos  = wa_mbew-stprs   - wa_final-v_op.
          wa_final-v_io   = wa_final-v_iv   + wa_final-v_uos.
          wa_final-v_uv   = wa_final-v_uos  + wa_final-v_io.
          wa_final-v_t    = wa_final-v_uv   + wa_bseg-menge.
          wa_final-v_d    = wa_final-v_t    - wa_final-v_alc.
          wa_final-v_os   = wa_final-v_uos  * wa_bseg-menge.
          wa_final-v_ito  = wa_final-v_io   * wa_bseg-menge.
          CLEAR wa_bseg.
          APPEND wa_final TO i_final.
          CLEAR wa_final.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "data_retrieval
    *&      Form  build_fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcat.
      CLEAR wa_fieldcat.
    *  TYPES : v_alc TYPE dmbtr. "curr. " decimal 2.
    DATA: l_c_v_alc TYPE p DECIMALS 2,
    l_c_v_iv TYPE p DECIMALS 2 .
    l_c_v_alc = v_alc.
    l_c_v_iv = v_iv.
    Constant Declarations.
      CONSTANTS:
                l_c_gjahr(5)   TYPE c VALUE 'GJAHR',      " Year
                l_c_wwert(5)   TYPE c VALUE 'WWERT',      " Traslation date
                l_c_bukrs(5)   TYPE c VALUE 'BUKRS',      " company code
                l_c_hkont(5)   TYPE c VALUE 'HKONT',      " General ledger account
                l_c_txt20(10)  TYPE c VALUE 'TXT20',      " Account name
                l_c_belnr(5)   TYPE c VALUE 'BELNR',      " Doc number
                l_c_shkzg(5)   TYPE c VALUE 'SHKZG',      " Dt/Cr indicator
                l_c_dmbtr(5)   TYPE c VALUE 'DMBTR1',      " Ammount in local currency
               " l_c_v_alc      TYPE c VALUE 'V_ALC',      " Ammount in local currency
                l_c_wrbtr(5)   TYPE c VALUE 'WRBTR',      " Ammount in foreign currency
                l_c_ebeln(5)   TYPE c VALUE 'EBELN',      " Purchase order number
                l_c_ebelp(5)   TYPE c VALUE 'EBELP',      " Item number
                l_c_matnr(5)   TYPE c VALUE 'MATNR',      " Material number
                l_c_menge(7)   TYPE c VALUE 'MENGE',      " Qunatity
                l_c_meins(5)   TYPE c VALUE 'MEINS',      " Unit of measure
                l_c_stprs(5)   TYPE c VALUE 'STPRS',      " Std material master
               " l_c_v_iv(4)    TYPE c VALUE 'V_IV',           " Invoice value
                l_c_pswsl(5)   TYPE c VALUE 'PSWSL',      " Currency
                l_c_v_erc(5)   TYPE c VALUE 'V_ERC',      " Exchange rate calculated
                l_c_v_op(4)    TYPE c VALUE 'V_OP',       " Order price
                l_c_v_uos(5)   TYPE c VALUE 'V_UOS',      " Unit order to stock
                l_c_v_io(4)    TYPE c VALUE 'V_IO',       " Invoice to order
                l_c_v_uv(4)    TYPE c VALUE 'V_UV',       " Unit value
                l_c_v_t(3)     TYPE c VALUE 'V_T',        " Total
                l_c_v_d(3)     TYPE c VALUE 'V_D',        " Differecne
                l_c_netpr(5)   TYPE c VALUE 'NETPR',      " Net price in purchasing document
                l_c_v_total(7) TYPE c VALUE 'V_TOTAL',    " Total
                l_c_v_os(4)    TYPE c VALUE 'V_OS',      " Order to stock
                l_c_v_ito(5)   TYPE c VALUE 'V_ITO',      " Invoice to order
                l_c_saknr(5)   TYPE c VALUE 'SAKNR',      " G/L account number
                l_c_i_final(7) TYPE c VALUE 'I_FINAL'.    " Final internal table
    Fieldcat for fiscal year
      wa_fieldcat-col_pos   =  1.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_gjahr.
      wa_fieldcat-seltext_m = text-007.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Translation date
      wa_fieldcat-col_pos   =  2.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_wwert.
      wa_fieldcat-seltext_m = text-008.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Company code
      wa_fieldcat-col_pos   =  3.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_bukrs.
      wa_fieldcat-seltext_m = text-009.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for General ledger account
      wa_fieldcat-col_pos   =  4.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_hkont.
      wa_fieldcat-seltext_m = text-010.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Account name
      wa_fieldcat-col_pos   =  5.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_txt20.
      wa_fieldcat-seltext_m = text-011.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Doc number
      wa_fieldcat-col_pos   =  6.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_belnr.
      wa_fieldcat-seltext_m = text-012.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Dt/Cr indicator
      wa_fieldcat-col_pos   =  7.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_shkzg.
      wa_fieldcat-seltext_m = text-013.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Ammount in local currency
      wa_fieldcat-col_pos   =  8.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = 'DMBTR1'.
      wa_fieldcat-seltext_m = text-014.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Ammount in local currency
      wa_fieldcat-col_pos   =  9.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = 'V_ALC'.
      wa_fieldcat-seltext_m = text-015.
      wa_fieldcat-ref_fieldname = 'DMBTR'.
    wa_fieldcat-no_sign   = 'X'.
    wa_fieldcat-do_sum    =  c_x.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Ammount in foreign currency
      wa_fieldcat-col_pos   =  10.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_wrbtr.
      wa_fieldcat-seltext_m = text-016.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Purchse order number
      wa_fieldcat-col_pos   =  11.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_ebeln.
      wa_fieldcat-seltext_m = text-017.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Item No
      wa_fieldcat-col_pos   =  12.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_ebelp.
      wa_fieldcat-seltext_m = text-018.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Material number
      wa_fieldcat-col_pos   =  13.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_matnr.
      wa_fieldcat-seltext_m = text-019.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Qunatity
      wa_fieldcat-col_pos   =  14.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_menge.
      wa_fieldcat-seltext_m = text-020.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Unit of measure
      wa_fieldcat-col_pos   =  15.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_meins.
      wa_fieldcat-seltext_m = text-021.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Std material master
      wa_fieldcat-col_pos   =  16.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_stprs.
      wa_fieldcat-seltext_m = text-022.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Invoice value,
      wa_fieldcat-col_pos   =  17.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = 'V_IV'.
      wa_fieldcat-seltext_m = text-023.
      wa_fieldcat-ref_fieldname = 'DMBTR'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Currency
      wa_fieldcat-col_pos   =  18.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_pswsl.
      wa_fieldcat-seltext_m = text-024.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Exchange rate calculated
      wa_fieldcat-col_pos   =  19.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = 'V_ERC'.
      wa_fieldcat-seltext_m = text-025.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Order price
      wa_fieldcat-col_pos   =  20.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_op.
      wa_fieldcat-seltext_m = text-026.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Unit order to stock
      wa_fieldcat-col_pos   =  21.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_uos.
      wa_fieldcat-seltext_m = text-027.
      wa_fieldcat-do_sum    = c_x.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Invoice to order
      wa_fieldcat-col_pos   =  22.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_io.
      wa_fieldcat-seltext_m = text-028.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Unit value
      wa_fieldcat-col_pos   =  23.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_uv.
      wa_fieldcat-seltext_m = text-029.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Total
      wa_fieldcat-col_pos   =  24.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_t.
      wa_fieldcat-seltext_m = text-030.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Difference
      wa_fieldcat-col_pos   =  25.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_d.
      wa_fieldcat-seltext_m = text-031.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Net Price in Purchasing Document
      wa_fieldcat-col_pos   =  26.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_netpr.
      wa_fieldcat-seltext_m = text-032.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Total
      wa_fieldcat-col_pos   =  27.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_total.
      wa_fieldcat-seltext_m = text-033.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Order to stock
      wa_fieldcat-col_pos   =  28.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_os.
      wa_fieldcat-seltext_m = text-034.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Fieldcat for Invoice to order
      wa_fieldcat-col_pos   =  29.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_v_ito.
      wa_fieldcat-seltext_m = text-035.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    fieldcat for invoice to order
      wa_fieldcat-col_pos   =  30.
      wa_fieldcat-tabname   = l_c_i_final.
      wa_fieldcat-fieldname = l_c_saknr.
      wa_fieldcat-seltext_m = text-035.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    ENDFORM.                    "build_fieldcat

    Hi romanch,
    defining the field catalog you must reference all currency fields to the respective currency key field (type CUKY).
    <alv_fieldcat>-cfieldname         = 'HWAER'.
    This is sample for alv output of a currency field. The alv structure has a field HWAER which carries the currency key, e.g. USD or so.
    Obviously you do not provide a cutrrency key for your values. If they are initial (zero), ALV will not display them as 0,00 but leave the field empty if the reference too currency key is not established.
    If you define a DDIC structure for the ALV output this refernce is enforced. You can pass the DDIC structure name to the ALV and don not have to create the field catalog manually.
    Regards,
    Clemens

  • Editable ALV Grid column behavior under ITS standalone

    Hello experts,
    I have a straight forward implementation of an ALV Grid with 3 columns. Two columns are display only and the third is editable. My question only involves the editable column and its behavior in a web browser served by a standalone ITS server. The underlying data type is CURR. The enterable amounts are restricted to a format of 9.99. Even so, a web user can accidentally enter a non-numeric value such as 1.x0 .  We have coded a data changed event handler to check the input value for expected amounts. The event handler logic readily identifies the non-numeric value and handles the exception. Although we have full control of the internal table value, there are two problems encountered within the web browser interface:
    1) We cannot return the cursor to the problem cell to prevent the user from continuing before correcting the problem.
    2) We cannot reset/change to displayed value to the original internal table value (it will only refresh after a save or refresh action). So the user has no visual cue that they've entered a bad value unless they pay close attention.
    Running the transaction in SAPGUI, we can force the cursor back to the erroneously cell using  "CALL METHOD alv_grid->set_scroll_info_via_id" . This technique does not appear to affect the cursor within the web browser.
    After searching SDN forums and SAP documentation it appears that there is no way to programmatically control the ALV Grid active cell within the web browser interface. I'm wondering if the experts can confirm this issue? If that is the way it works within the browser interface could members please suggest "user friendly" approaches to notifying the user of a data entry problem? For example, is POPUP_TO_INFORM to only option? Perhaps there is a JavaScript routine that can enforce the edit format? Please keep in mind that the standard ALV Grid techniques that work in SAPGUI don't necessarily behave the same way in the web browser. I'm most interested in advice regarding the web browser using standalone ITS as it will be another year before we can leverage WebDynPro in this scenario.
    Thanks and best regards,
    Gary

    Hi Gary,
    can you please create a short report which recreates the issue and post the ABAP here. The goal is that webgui and SAPGUI behaves the same way. If they don't we will try to fix it.
    Best regards,
    Klaus

  • The Visible attribute on alv grid column is not changed after Change Layout

    Setup:
    I have a program that displays output in an ALV grid (using cl_salv_table).
    The ALV grid is displayed within a custom control on a subscreen.
    I have 4 subscreens being used on a tabstrip control.  So I have 4 ALV grids total (one on each subscreen).
    On each ALV grid, I have set the set_layout_change function to true so that the user can hide and unhide columns etc. on each grid via the button on the alv grid toolbar.
    I also allow the user to dowload the contents of all 4 grids to excel.  To do this I have a custom button that when clicked goes to each ALV grid - gets the column metadata (via cl_salv_columns_table-get() ) and checks the visibility to determine if the column should be downloaded or not (via cl_salv_column-is_visible() ) to excel.
    The Problem:
    As I said I have 4 grids being displayed via a tab control.  Let's say the user is on tab 1 and unhides some columns on the alv grid 1 via the Change Layout... button.  And then the user navigates to tab 2.  If they click the download button at that point - when the download code is run and it checks the visibility of the columns on alv grid 1 - the changes that were made via the Change Layout... button have not synchronized yet.  When I call is_visible() for a column that was unhid it still comes back as false. 
    The only way I have found to remedy this is to make the user click on a button on the alv grid's toolbar before navigating to a different tab to force the synchronization between the changes made and the backend column metadata.  However, this is not the best option and requires training for the user that they have to do this for the download to work correctly. 
    The Question:
    1) why is the Change Layout... button not automatically synchronizing the changes it made to the back end?  Is there a way to make it do this?
    2) OR, is there a way that I can force the synchronization within the code and not force the user to click a button on the alv grid?  If there is a way to force the synchronization - where do I put that code?  As far as I can tell, when I switch between tabs - I am unable to catch that action in my PAI events.
    Thanks in advance for any help.

    I was able to resolve this issue with a satisfactory solution.
    In my program I had a local class definition to handle the grids' events.  When the synchronization wasn't working I only had two events defined: for link_click and added_functions. 
    I created another definition for event after_salv_function:
                   on_after_salv_function for event after_salv_function of cl_salv_events importing e_salv_function
    There is no code in the method implementation - but adding this event handler now causes a synchronization to occur after the Change Layout is done.

  • ALV Grid Subscreen to Display Text

    Folks,
    I am really sorry I am creating a new thread for this because I can see it has been discussed a lot but I am finding it hard to clearly identify what needs to be done from all the posts.
    I have an ABAP with a selection screen, it runs and generates an ALV output, on that ALV output I have a column called COMMENT, in the column COMMENT there is a string of text which can be very large. Since I can not change the row height on the ALV grid I am going to implement a work-around where when the user double-clicks on the comment, it pops up a screen displaying the full text.
    I presume I need to call a subscreen to get this to happen but I can not see how to do this and any help would be greatly appreciated.
    Many Thanks,
    Colm
    P.S. Here is how I catch the double click.
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.           "#EC CALLED
      DATA: w_ans(1).
      CASE r_ucomm. "The users command
       WHEN '&IC1'.                       "Double Click
    *Doc drill down
          IF rs_selfield-fieldname = 'COMMENT'.
            READ TABLE gt_output INDEX rs_selfield-tabindex.
            IF sy-subrc = 0.
    *Call the screen here displaying the full note text
            ENDIF.

    I feel so foolish, I was trying to re-invent the wheel and didn't think before I asked. Apologies and Thanks.
    However, if for some reason I didn't want to use the POPUP_TEXT FM, is there a way I could have called the subscreen?
    Here is the code I used if anyone is interested:
    DATA: w_ans(1),
            lt_text TYPE TABLE OF trtab,
            ls_title TYPE c,
            crlf(2) TYPE c VALUE cl_abap_char_utilities=>cr_lf.
      CASE r_ucomm. "The users command
        WHEN '&IC1'.                       "Double Click
    *Doc drill down
          IF rs_selfield-fieldname = 'COMMENT'.
            READ TABLE gt_output INDEX rs_selfield-tabindex.
            IF sy-subrc = 0.
              SPLIT gt_output-comment AT crlf INTO TABLE lt_text.
              CALL FUNCTION 'LAW_SHOW_POPUP_WITH_TEXT'
                EXPORTING
                  titelbar                     = ls_title
                 line_size                    = 132
                TABLES
                  list_tab                     = lt_text.

  • Focus to a webdynpro alv grid column after report_element_t100_message

    Hi All,
    I have an alv grid on my view. When I click a button, I'm making some checks for editable cells and if necessary giving a message to the user by using  report_element_t100_message method. After the message, I'm setting focus to the alv grid cell . If I don't give a message, my  set_focus code works fine, but I must give  a message , so how can I achive this? Isn't it possible setting to a cell after a message?
    Followings are some parts from my source code .
    Thanks in advance,
    MERAL
    THESE CODES ARE IN MY VIEW -
    *-- GIVE MESSAGE
    CALL METHOD wd_assist->mesaj_ver
            EXPORTING
              in_api_controller = lo_api_controller
              in_el_context     = lo_el_context
              in_msgty          = 'E'
              in_msgno          = wd_assist->msg_boskalamaz
              in_msgv1          = cmsg
              in_msgv2          = 'Geçerlilik Başlama Tarihi'.
          strFocusColumn = 'GECERLIBASTARIH'.
    *-- SET FOCUS
    lr_salv_wd_table = wd_this->wd_cpifc_alv_molekul_selected( ).
        lr_salv_wd_table->set_focus(
          index  = itabix
          column = strFocusColumn ).
    THIS METHOD IS IN MY ASSISTANCE CLASS -
    method MESAJ_VER.
      data lo_message_manager    type ref to if_wd_message_manager.
      data message type SYMSG.
    *-- Get message manager
      CALL METHOD in_api_controller->GET_MESSAGE_MANAGER
        RECEIVING
          MESSAGE_MANAGER = lo_message_manager.
      message-MSGTY = IN_MSGTY.
      message-MSGID = 'Z_BYY_CLS_AYYA_MSG'.
      message-MSGNO = IN_MSGNO.
      message-MSGV1 = IN_MSGV1.
      message-MSGV2 = IN_MSGV2.
      message-MSGV3 = IN_MSGV3.
      message-MSGV4 = IN_MSGV4.
    report message
      CALL METHOD lo_message_manager->report_element_t100_message
        EXPORTING
          msg     = message
          element = in_el_context
          cancel_navigation = in_cancel_navigation.
    endmethod.

    Thank you for your reply Vishal, but I already read context before I give message. Please have a look at my code below.
    Do you say something different from this?
      DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA lo_api_controller TYPE REF TO if_wd_controller.
      DATA:
        lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      DATA:
        lo_nd_tab_molekul_selected TYPE REF TO if_wd_context_node,
        lt_tab_molekul_selected TYPE wd_this->elements_tab_molekul_selected,
        lo_el_tab_molekul_selected TYPE REF TO if_wd_context_element,
        wa_selected TYPE zbyys020,
        strfocuscolumn TYPE string,
        cmsg  TYPE symsgv,
        nsure(6) TYPE n   ,
        itabix TYPE sy-tabix .
      DATA: itmp TYPE i,
                isure TYPE i..
      CLEAR ret_ready .
      lo_nd_tab_molekul_selected = wd_context->get_child_node(
           name = wd_this->wdctx_tab_molekul_selected ).
      lo_nd_tab_molekul_selected->get_static_attributes_table(
    IMPORTING table =   lt_tab_molekul_selected ).
      lo_el_context = wd_context->get_element( ).
      lo_api_controller ?= wd_this->wd_get_api( ).
      CLEAR:  strfocuscolumn, itabix.
      LOOP AT lt_tab_molekul_selected INTO wa_selected
        WHERE changed IS NOT INITIAL.
        itabix = sy-tabix.
        IF wa_selected-gecerlibastarih IS INITIAL.
          CALL METHOD wd_assist->mesaj_ver
            EXPORTING
              in_api_controller = lo_api_controller
              in_el_context     = lo_el_context
              in_msgty          = 'E'
              in_msgno          = wd_assist->msg_boskalamaz
              in_msgv1          = 'Geçerlilik Başlama Tarihi'.
          strfocuscolumn = 'GECERLIBASTARIH'.
          EXIT.
        ENDIF.
        lo_el_tab_molekul_selected =
    lo_nd_tab_molekul_selected->get_element( index = sy-tabix ).
        lo_el_tab_molekul_selected->set_attribute(
          EXPORTING
          value = ' '
          name =  'CHANGED' ).
      ENDLOOP.
      IF  strfocuscolumn IS NOT INITIAL.
        lr_salv_wd_table = wd_this->wd_cpifc_alv_molekul_selected( ).
        lr_salv_wd_table->set_focus(
          index  = itabix
          column = strfocuscolumn ).
      ELSE.
        ret_ready =  'X'.
      ENDIF.

  • Web Dynpro ALV grid column width

    Hi,
    I have a web dynpro alv grid that has columns titles that are long.  What is the best way of displaying the data without taking up too much space with the titles? 
    For example is it possible to wrap the title into 2 or 3 rows
    Thanks,
    Samir

    Hi,
    DATA: lr_column type ref to cl_salv_wd_column,
    lr_colheader type ref to cl_salv_wd_column_header.
              CALL METHOD lrcolumn->get_header
                RECEIVING
                  value = lr_COLHEADER.
    lr_COLHEADER->set_ddic_binding_field( if_salv_wd_c_ddic_binding=>ddic_bind_short ).
    Refer this if_salv_wd_c_ddic_binding in se24 for more.
    Regards,
    Lekha.

  • Dynamic ALV Grid is not displaying !!

    Hi all,
      I am trying to create dynamic alv grids and upto five levels(five grids) out put is displaying fine without any problem. But when I try to display the 6th grid, the program is going into infinite loop and getting timed out. Even I tried to increse the height of the grid even though it is not displaying.
    Please correct me if any thing is wrong in below code.
    *1st Level grid
    IF <table1> IS ASSIGNED AND <table1> IS NOT INITIAL.
       CREATE OBJECT ob_split1
           EXPORTING
             parent      = ob_custom
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
        PERFORM set_split_height USING ob_split1  '20'.
        CREATE OBJECT ob_grid1
          EXPORTING
            i_parent = ob_split1->top_left_container.
    ELSE.
        CREATE OBJECT ob_split1
           EXPORTING
             parent      = ob_custom
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
        PERFORM set_split_height USING ob_split1  '0'.
    ENDIF.
    *2nd Level grid
    IF <table2> IS ASSIGNED AND <table2> IS NOT INITIAL.
       CREATE OBJECT ob_split2
           EXPORTING
             parent      = ob_split1->bottom_right_container
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
          PERFORM set_split_height USING ob_split2   '20'.
        CREATE OBJECT ob_grid2
          EXPORTING
            i_parent = ob_split2->top_left_container.
      ELSE.
         CREATE OBJECT ob_split2
            EXPORTING
              parent      = ob_split1->bottom_right_container
              orientation = cl_gui_easy_splitter_container=>orientation_vertical.
         PERFORM set_split_height USING ob_split2    '0'.
      ENDIF.
    (Created 3rd,4th,5th same like above).
    *6th Level grid
    IF <table6> IS ASSIGNED AND <table6> IS NOT INITIAL.
    CREATE OBJECT ob_split6
           EXPORTING
             parent      = ob_split5->bottom_right_container
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
         PERFORM set_split_height USING ob_split6  '20'.
         CREATE OBJECT ob_grid6
           EXPORTING
             i_parent = ob_split6->top_left_container.
      ELSE.
         CREATE OBJECT ob_split6
           EXPORTING
             parent      = ob_split5->bottom_right_container
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
         PERFORM set_split_height USING ob_split6  '0'.
      ENDIF.
    Appreciated your reply. Please let me know for additional info.
    Thanks,
    Ranjith.
    Edited by: Thomas Zloch on Dec 8, 2010 5:44 PM - please use code tags

    Hi romanch,
    defining the field catalog you must reference all currency fields to the respective currency key field (type CUKY).
    <alv_fieldcat>-cfieldname         = 'HWAER'.
    This is sample for alv output of a currency field. The alv structure has a field HWAER which carries the currency key, e.g. USD or so.
    Obviously you do not provide a cutrrency key for your values. If they are initial (zero), ALV will not display them as 0,00 but leave the field empty if the reference too currency key is not established.
    If you define a DDIC structure for the ALV output this refernce is enforced. You can pass the DDIC structure name to the ALV and don not have to create the field catalog manually.
    Regards,
    Clemens

  • ALV grid - column width doesn't get optimized

    Dear SAP friends,
    My program displays ALV grid in PBO:
      gs_layout-cwidth_opt = 'X'.   " optimize column width
    CALL METHOD grid1->set_table_for_first_display
        EXPORTING
        i_structure_name      = 'IT_REPORT_X'
          is_layout            = gs_layout
          is_print             = gs_print
          it_toolbar_excluding = it_exclude
        CHANGING
          it_outtab        = it_report_x
          it_fieldcatalog  = gt_fcat.
    I have a custom button in the standard toolbar which I use to repopulate the grid if a certain criteria is met. To repopulate the grid  I am using method:
       CALL METHOD grid1->refresh_table_display.
    So on initial display the grid has column width  optimized.
    But when I  do refresh  - the columns don't get optimized.
    What is wrong?
    Thank you,
    Tatyana

    Hello Tatyana
    It seems that you have to call method go_grid->set_frontend_layout a second time but please do not ask me when and where (PBO vs. PAI, before/after REFRESH_TABLE_DISPLAY).
    However, you are definitely on the safe side if you simply call the entire
    CALL METHOD grid1->set_table_for_first_display
        EXPORTING
        i_structure_name      = 'IT_REPORT_X'
          is_layout            = gs_layout
          is_print             = gs_print
          it_toolbar_excluding = it_exclude
        CHANGING
          it_outtab        = it_report_x
          it_fieldcatalog  = gt_fcat.
    again at PBO. Disadvantage: scroll positions get lost.
    Regards
      Uwe

Maybe you are looking for