Re : ALV Output Display

hi
i'm doing an ALV Report. In the output  i'm double clicking on the Document field using user-command
it is taking me to a particular Transaction and my requirement is if i change any field for ex : Description
in that transaction and come back again to the output display the Changed Description should appear
when i refresh the Output.how to get it?
Regards

1. create one icon on allication toolbar which is REFRESH icon, and give some function for it.
2. write the code like:
    CASE SY_UCOMM.
      when 'FCODE'.
          refresh itab.
          perform get_data.
          perform_displaydata.
it is nothing but u need to put the same code which u used earlier to show the data in output gaian after clicking on function code.
Regards,
Rajesh.

Similar Messages

  • Strange behaviour in alv output display for a date column!

    hi friends,
    my alv output list display contains a column for budat (posting date), if this field has no value, then it displays a blank cell (space) in the output in my user login...but when the same report is run in another user login, even though the value of the column is null, it displays 00000000 (8 zeroes) rather than displaying a blank cell...i have set the field catalog property NO_ZERO = 'X'; is this property has anything to do with authorization to achieve its funcionality? am not sure...this is strange, as it is the same report, same field catalog that is being used..need some inputs on this
    thanks in advance
    Sathish

    There are 2 solutions for an adhoc solution you can change the field to a char10 field, this will solve your immediate problem of the 0 display. For a permanent solution you can check the user profile setting for the date for you as well as the concerned user. 
    Hope That Helps
    Anirban M.

  • To Display Calender in F4 help in ALV Output Display.

    Hello Experts.
    I have one requirement. I have an ALV output. In this one date field is editable. Here User wants F4 Help. I have provided the F4 help, F4 help is coming but for F4 help i want the Factory Calendar type display. Currently the F4 help is coming like a normal F4 help.
    Thanks.
    Swati.

    hi Swati,
    I hope you have checked standard program 'bcalv_edit_08'.
    in this program, if the type of field we are taking in that perticuler column is 'DATS' then it should display the calender.
    Regards,
    Ani

  • Initial ALV output display

    Hello,
    I have one query witl regards to ALV output. After entering data in the selection screnn my ALV output gets displayed and there is no issue with it. The ALV is in display mode and if i click on the change button the ALV becomes editable. So fat it is fine.
    The area  of concern is the initial ALV output even though it is  in display mode  looks as if it is editable ALV.  On click of the change button, then the ALV is shown in display mode and it is easily identifiable.
    The user feels the initial ALV output is confusing and that he is not able to recognize whether it is display/editbale ALV. How can we fix it so that client can identify it?
    Also, how do we get all the standard ALV buttons that we get in SE38 output in webdynpro? Please help.
    Regards,
    Vaishnavi

    Hi,
    init your ALV settings with:
    DATA lr_alv_cfg TYPE ref to cl_salv_wd_config_table.
    lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_alv_table( ).
    lr_alv_cfg = lo_interfacecontroller->get_model( ).
    lr_alv_cfg->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_true ).
    If you click change button do this:
    is_read_only = lr_alv_cfg->IF_SALV_WD_TABLE_SETTINGS~GET_READ_ONLY( ).
    if lv_is_read_only = abap_true.
        lr_alv_cfg->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_false ).
    else.
        lr_alv_cfg->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_true ).
    endif.

  • Refreshing ALV output display

    Hi,
    I have a report with ALV .In the output success or error message gets displayed in a column based on certain conditions.The errors can be manually corrected.I
    f the errors are corrected and 'Refresh' button is pressed in my output,the error message displayed in the output  should disappear.
    As of now,this happens if the report is run again but i want this to happen just by clicking of refresh button.i.e. the entire report should be run again with the existing inputs entered in selection screen.
    If i try to call the same program using 'submit' spool gets created,but i want the output in the same page.
    Can you please tell me how this can be achieved.
    Regards,
    S.Subasree

    Hi Subasree,
    The following method call is used to refresh the data displayed within an ALV object grid:
         CALL method gd_tree->REFRESH_TABLE_DISPLAY.
    CALL METHOD gd_tree->set_table_for_first_display
        EXPORTING
          is_layout       = gd_layout
        CHANGING
          it_fieldcatalog = gd_fieldcat
          it_sort         = it_sortcat
          it_outtab       = it_report.
    CALL method gd_tree->REFRESH_TABLE_DISPLAY.
    CALL METHOD cl_gui_cfw=>flush.
    Hope this helps.
    Reward if helpful.
    Regards,
    Sipra

  • Align ALV Output Display to fit window resolution using cl_gui_custom_conta

    hi,
    my ALV Display is not fitting to the window screen for different resolutions.
    big monitor the screen display is too small and small monitor its fitting.
    I want to have DYNAMIC screen fit using   cl_gui_custom_container...
    is it possible??
    ags.

    Thanks Pawan,
    the link you provided had my exact solution.
    this is a very rare feature to know i believe since most of the people havnt faced it i guess.
    I will have to say the same thing as you said in the
    "Thanks Pawan, that explains everything.. sometime I just overlook the things..Thnaks again!!"
    ags.

  • Total is not getting displayed in the ALV output.

    Hi,
    Total is not getting displayed in the ALV output.
    I m using :REUSE_ALV_BLOCK_LIST_APPEND & REUSE_ALV_BLOCK_LIST_DISPLAY
    Are  there any issues with it as the same settings are working fine with REUSE_ALV_LIST_DISPLAY
    source code:
    DATA: layout TYPE slis_layout_alv,
          IT_eventS  TYPE slis_t_event,
          fcat   TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          rec_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    TYPES: BEGIN OF ty_tab,
          belnr TYPE dberchz-belnr,
          belzart TYPE dberchz-belzart,
          net TYPE dberchz-nettobtr,
          END OF ty_tab.
    DATA: lt_tab TYPE STANDARD TABLE OF ty_tab.
    SELECT belnr belzart nettobtr
      FROM dberchz
      INTO TABLE lt_tab[]
    WHERE belnr eq '000000000001'.
      if sy-subrc ne 0.
      ENDIF.
    *  defining layout
    layout-colwidth_optimize = 'X'.
    layout-def_status = 'X'.
    *defning event
    *event
    *defining field catalog
    fcat-col_pos = 1.
    fcat-fieldname = 'BELNR'.
    fcat-tabname  = 'LT_TAB'.
    APPEND fcat.
    fcat-col_pos = 2.
    fcat-fieldname = 'BELZART'.
    fcat-tabname  = 'LT_TAB'.
    APPEND fcat.
    fcat-col_pos = 3.
    fcat-fieldname = 'NET'.
    fcat-tabname  = 'LT_TAB'.
    fcat-do_sum = 'X'.
    APPEND fcat.
    *calling alv
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program             = 'YZ_PLR'
    *   I_CALLBACK_PF_STATUS_SET       = ' '
    *   I_CALLBACK_USER_COMMAND        = ' '
    *   IT_EXCLUDING                   =
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = layout
        it_fieldcat                      = fcat[]
        i_tabname                        = 'LT_TAB'
        it_events                        = IT_EVENTS[]
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      tables
        t_outtab                         = lt_tab[]
    * EXCEPTIONS
    *   PROGRAM_ERROR                    = 1
    *   MAXIMUM_OF_APPENDS_REACHED       = 2
    *   OTHERS                           = 3
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    Thanks,
    Gaurav

    Hi
    No I don't think, this is my code (based on your code) and it works fine:
    TYPE-POOLS SLIS.
    DATA: BEGIN OF LT_TAB OCCURS 0,
           BELNR LIKE BSEG-BELNR,
           GJAHR LIKE BSEG-GJAHR,
           WRBTR LIKE BSEG-WRBTR,
           WAERS LIKE BKPF-WAERS,
          END OF LT_TAB.
    DATA: LAYOUT     TYPE SLIS_LAYOUT_ALV,
          IT_EVENTS  TYPE SLIS_T_EVENT,
          FCAT       TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          REC_FCAT   TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    START-OF-SELECTION.
      FCAT-COL_POS       = 1.
      FCAT-FIELDNAME     = 'BELNR'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-REF_FIELDNAME = 'BELNR'.
      FCAT-REF_TABNAME   = 'BSEG'.
      APPEND FCAT.
      FCAT-COL_POS       = 2.
      FCAT-FIELDNAME     = 'GJAHR'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-REF_FIELDNAME = 'GJAHR'.
      FCAT-REF_TABNAME   = 'BSEG'.
      APPEND FCAT.
      FCAT-COL_POS       = 3.
      FCAT-FIELDNAME     = 'WRBTR'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-CFIELDNAME    = 'WAERS'.
      FCAT-REF_FIELDNAME = 'WRBTR'.
      FCAT-REF_TABNAME   = 'BSEG'.
      FCAT-DO_SUM        = 'X'.
      APPEND FCAT.
      FCAT-COL_POS       = 4.
      FCAT-FIELDNAME     = 'WAERS'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-REF_FIELDNAME = 'WAERS'.
      FCAT-REF_TABNAME   = 'BKPF'.
      FCAT-DO_SUM        = SPACE.
      APPEND FCAT.
      SELECT * FROM BSEG INTO CORRESPONDING FIELDS OF TABLE LT_TAB
        WHERE BUKRS = 'MAAB'
          AND BELNR = '0000000001'.
      LT_TAB-WAERS = 'EUR'.
      MODIFY LT_TAB FROM LT_TAB TRANSPORTING WAERS WHERE WAERS = SPACE.
    *CALLING ALV
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          I_CALLBACK_PROGRAM = 'ZPROVAMAX5'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IS_LAYOUT   = LAYOUT
          IT_FIELDCAT = FCAT[]
          I_TABNAME   = 'LT_TAB'
          IT_EVENTS   = IT_EVENTS[]
        TABLES
          T_OUTTAB    = LT_TAB[].
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
    I've also inserted a currency field
    Max

  • Newly added field not getting displayed in ALV output

    Hi All,
       I'm adding one more field/column to be displayed in an old existing program that uses REUSE_ALV_FIELDCATALOG_MERGE to generate the ALV fieldcat.
    DATA: BEGIN OF it_salary OCCURS 0,
            pernr LIKE pa0000-pernr,
            ename LIKE pa0001-ename,
            rtext like lv_rtext, -
    added field
            waers LIKE pa0008-waers
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = driver
          i_internal_tabname     = 'IT_SALARY'
          i_client_never_display = 'X'
          i_inclname             = driver
        CHANGING
          ct_fieldcat            = lv_fieldcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = driver
          it_fieldcat             = lv_fieldcat[]
          i_default               = 'X'
          i_save                  = 'A'
          is_variant              = lv_tmplt
          is_layout               = lv_ls_layout
         i_callback_user_command = 'USER_COMMAND'
        TABLES
          t_outtab                = it_salary
        EXCEPTIONS
          program_error           = 1
          OTHERS                  = 2.
    The newly added field is not getting populated in the lv_fieldcat table. Tried running programs BALVBUFDEL,
    BCALV_BUFFER_DEL_SHARED then logging off and logging in but of no help.
    Please provide suggestion for this issue.
    Regards,
    Sridevi S

    Hi,
    Fieldcat is buffered - so use
    I_BYPASSING_BUFFER = 'X'
    Since a while CL_GUI_ALV_GRID is available which does NOT need any fieldcat (is determined internally using RTTI). It is worth playing around whith this class if you have some time. This class is recommended for ALV Output by SAP (but no edit is possible - was never supported officially).
    A simple use would be:
    data: gt_output type standard table of (adjust!).
    *simple ALV output
    data go_alv type ref to cl_salv_table.
    data go_functions type ref to cl_salv_functions_list.
    data go_columns type ref to cl_salv_columns_table.
    data go_column type ref to cl_salv_column_table.
    *Exceprion handlig
    data: go_exception  type ref to cx_root,
          gv_errortext   type string.
    ** fill table gt_output ...
    ** ALV output
    if not gt_output is initial.
        try.
            call method cl_salv_table=>factory
              importing
                r_salv_table = go_alv
              changing
                t_table      = gt_output.
          catch cx_salv_msg into go_exception.
            gv_errortext = go_exception->get_text( ).
            message gv_errortext type 'A'.
        endtry.
    * enable all standard ALV functions
        go_functions =  go_alv->get_functions( ).
        go_functions->set_all( ).
    * hide MANDT
        go_columns = go_alv->get_columns( ).
        go_column ?=  go_columns->get_column( columnname = 'MANDT' ).
        go_column->set_technical( ).
        go_alv->display( ).
    Kind regards,
    Holger

  • ICON display in ALV output

    Hi,
      I need to create a column that will have an icon ICON_DOCUMENT displayed in the column. Now, when i clik on this icon it should check for the existance of any links existing for a material , if so, then display those links . Basically this icon should dispaly the link to material drawings . How do i include the icon in the output column in ALV?
    Thanks,
    Sindhu.

    hi,
    Sample code is ::
    report  zalvexer2  message-id zz                       .
    *& TABLES DECLARATION                                                  *
    tables: vbak.
    *& TYPE POOLS DECLARATION                                              *
    type-pools: slis.
    *& INTERNAL TABLE DECLARATION                                          *
    data: begin of itab occurs 0,
           icon type icon-id,
           vbeln like vbak-vbeln,
           audat like vbak-audat,
           vbtyp like vbak-vbtyp,
           auart like vbak-auart,
           augru like vbak-augru,
           netwr like vbak-netwr,
           waerk like vbak-waerk,
        end of itab.
    *INTERNAL TABLE FOR FIELD CATALOG
    data: wa_fieldcat type slis_fieldcat_alv,
        it_fieldcat type slis_t_fieldcat_alv.
    IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
               WITH HEADER LINE,
    *INTERNAL TABLE FOR EVENTS
    data:    it_event type slis_t_event,
          wa_event type slis_alv_event,
    *INTERNAL TABLE FOR SORTING
          it_sort type slis_t_sortinfo_alv,
          wa_sort type slis_sortinfo_alv,
    *INTERNAL TABLE FOR LAYOUT
          wa_layout type slis_layout_alv.
    *& VARIABLE DECLARATION                                                *
    data : v_repid type sy-repid,
           v_pagno(4) type n,
           v_date(8)  type c.
    *& CONSTANTS                                                           *
    constants: c_x type c value 'X'.
    *& SELECTION SCREEN                                                    *
    selection-screen: begin of block b1 with frame title text-001.
    select-options: s_vbeln for vbak-vbeln,
                    s_vbtyp for vbak-vbtyp default 'C'.
    selection-screen: end of block b1.
    selection-screen: begin of block b2 with frame title text-002.
    selection-screen : begin of line.
    selection-screen  comment 1(20) text-003.
    parameters: p_list radiobutton group rad1 default 'X'.
    selection-screen : end of line.
    selection-screen : begin of line.
    selection-screen comment 1(20) text-004.
    parameters: p_grid radiobutton group rad1.
    selection-screen : end of line.
    selection-screen: end of block b2.
    at selection-screen.
      perform validate_screen.
    *& START OF SELECTION                                               *
    start-of-selection.
      clear: itab, itab[].
    V_REPID = SY-REPID.
      perform get_data.
      perform display_data.
    *& END OF SELECTION                                                    *
    end-of-selection.
    *--DO ALV Process
      v_repid = sy-repid.
    *--Sort the Output Fields
      perform sort_fields.
    *--Build Field catalog for the Output fields
    PERFORM BUILD_FIELDCAT.
    *--Set the Layout for ALV
      perform set_layout.
    *&      Form  GET_DATA
          text
    TO GET THE DATA FROM TABLES INTO ITAB
    form get_data .
      select vbeln
             audat
             vbtyp
             auart
             augru
             netwr
             waerk
             into corresponding fields of table itab
             from vbak
             where vbeln in s_vbeln and
             audat > '04.04.2005'
             and netwr > 0.
      <b>loop at itab.
        if itab-netwr < 10000.
          itab-icon = '@08@'.
        elseif itab-netwr > 10000 and itab-netwr < 100000.
          itab-icon = '@09@'.
        elseif itab-netwr > 100000.
          itab-icon = '@0A@'.
        endif.
        modify itab index sy-tabix.
      endloop.</b>
    endform.                    " GET_DATA
    *&      Form  sort_fields
    form sort_fields .
      clear wa_sort.
      wa_sort-fieldname = 'VBTYP'.
      wa_sort-spos = '1'.
      wa_sort-up = 'X'.
      append wa_sort to it_sort.
      clear wa_sort.
      wa_sort-fieldname = 'NETWR'.
      wa_sort-spos = '2'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      append wa_sort to it_sort.
    endform.                    " sort_fields
    *&      Form  set_layout
    form set_layout .
      if p_list = c_x .
        wa_layout-window_titlebar = 'LIST DISPLAY'(016).
        wa_layout-zebra = 'X'.
    *-- ALV LIST DISPLAY
        perform list_display tables itab.
    *-- ALV GRID DISPLAY
      elseif p_grid = c_x.
        wa_layout-window_titlebar = 'GRID DISPLAY'(017).
        wa_layout-zebra = 'X'.
        perform grid_display tables itab.
      endif.
    endform.                    " set_layout
    *&      Form  list_display
    form list_display  tables   p_itab .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = v_repid
          is_layout          = wa_layout
          it_fieldcat        = it_fieldcat[]
          it_sort            = it_sort[]
          i_save             = 'U'
        tables
          t_outtab           = itab
        exceptions
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " list_display
    *&      Form  GRID_DISPLAY
    form grid_display  tables   p_itab .
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program = v_repid
          is_layout          = wa_layout
          it_fieldcat        = it_fieldcat[]
          it_sort            = it_sort[]
          it_events          = it_event
        tables
          t_outtab           = itab
        exceptions
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " GRID_DISPLAY
    *&      Form  VALIDATE_SCREEN
          text
    -->  p1        text
    <--  p2        text
    form validate_screen .
      data: lv_vbeln like vbak-vbeln.
      if not s_vbeln is initial.
        select vbeln
        into lv_vbeln
        up to 1 rows
        from vbak
        where vbeln in s_vbeln.
        endselect.
        if sy-subrc <> 0.
          message e000 with 'INVALID SALES DOC'.
        endif.
      endif.
    endform.                    " VALIDATE_SCREEN
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    form display_data .
      define m_fieldcat.
        add 1 to wa_fieldcat-col_pos.
        wa_fieldcat-fieldname   = &1.
        wa_fieldcat-ref_tabname = 'VBAK'.
        wa_fieldcat-do_sum      = &2.
        wa_fieldcat-cfieldname  = &3.
        append wa_fieldcat to it_fieldcat.
      end-of-definition.
    data:
        ls_fieldcat type slis_fieldcat_alv,
        lt_fieldcat type slis_t_fieldcat_alv.
      m_fieldcat 'ICON' ''  ''.
      m_fieldcat 'VBELN' ''  ''.
      m_fieldcat 'AUDAT' ''  ''.
      m_fieldcat 'VBTYP' ''  ''.
      m_fieldcat 'AUART' ''  ''.
      m_fieldcat 'AUGRU' ''  ''.
      m_fieldcat 'NETWR' 'C' 'WAERK'.
      m_fieldcat 'WAERK' ''  ''.
    endform.                    " display_data[/code]
    Message was edited by: Ashok Parupalli
    Message was edited by: Ashok Parupalli

  • ALV list display in a Background job - Spool output

    Hi,
    We are currently working on a report scheduled to be run in the background job, and the ALV list is displayed in the spool output.
    ALV list in the spool does not look the same as front run job, the column headers are all crowded together, and there is no grid in-between different columns or rows. It's hard to read.
    Is there a way to add grid for this kind of output?
    Thanks!

    Hi Deepak:
    I expanded your report into two rows display, and the grid in the spool display simply gone!
    report zzscratch line-size 120 no standard page heading.
    type-pools slis.
    tables pa0001.
    data : li_field type standard table of slis_fieldcat_alv,
    gi_events type standard table of slis_alv_event,
    gr_layout_bck type slis_layout_alv,
    gr_save like disvariant,
    gr_events type slis_alv_event.
    types : begin of gtt_emp,
    pernr type persno,
    ename  like pa0001-ename,
    uname  like pa0001-UNAME,
    end of gtt_emp.
    data : lr_field type slis_fieldcat_alv.
    data : lc_rep like syst-repid.
    data : li_emp type standard table of gtt_emp,
    lr_emp type gtt_emp.
    data : gv_ref_table type lvc_rtname.
    gv_ref_table = 'CATSDB'.
    lr_field-fieldname = 'PERNR'.
    lr_field-ref_tabname = gv_ref_table.
    lr_field-inttype = 'N'.
    lr_field-outputlen = 8.
    lr_field-seltext_l = 'EMPLOYEE Number'.
    append lr_field to li_field.
    lr_field-fieldname = 'ENAME'.
    lr_field-ref_tabname = 'PA0001'.
    lr_field-inttype = 'C'.
    lr_field-outputlen = 40.
    lr_field-seltext_l = 'EMPLOYEE Name'.
    append lr_field to li_field.
    lr_field-fieldname = 'UNAME'.
    lr_field-ref_tabname = 'PA0001'.
    lr_field-inttype = 'C'.
    lr_field-outputlen = 12.
    lr_field-seltext_l = 'User Name'.
    lr_field-row_pos = 2.
    lr_field-col_pos = 1.
    append lr_field to li_field.
    lc_rep = sy-repid.
    gr_layout_bck-edit_mode = 'D'.
    gr_save-report = sy-repid.
    lr_emp-pernr = '00000001'.
    lr_emp-ename = 'abc'.
    lr_emp-uname = 'testus'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000002'.
    lr_emp-ename = 'def'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000003'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000004'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000005'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000006'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000007'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000008'.
    append lr_emp to li_emp.
    end-of-selection.
    Function module for ALV grid display
      call function 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_buffer_active    = 'X'
                i_callback_program = lc_rep
                is_layout          = gr_layout_bck
                it_fieldcat        = li_field
                i_save             = 'A'
                is_variant         = gr_save
                it_events          = gi_events
           TABLES
                t_outtab           = li_emp[]
           EXCEPTIONS
                program_error      = 1
                others             = 2.
      if sy-subrc <> 0.
    clear gr_messages.
    message e023 into gr_messages.
    append gr_messages to gi_messages.
      endif.

  • ALV output problem in displaying the field lengths.( LONG_DES1 & LONG DES)

    I have  declared itab of ALV output like below...
    Internal table for ALV report generation***********
    DATA : Begin of pdet_otab_alv occurs 0,
            bukrs LIKE bsid-bukrs, "Company code
            postm(4),              "Posting month (YYMM format)
            xblnr LIKE bsid-xblnr, "Reference document number
            kunnr LIKE bsid-kunnr, "Customer (Supplier Billing Customer)
            name1 LIKE kna1-name1,                              "Name 1
            buzei like bsid-buzei,
            gjahr like bsid-gjahr,
            filkd like bsid-filkd, "Rep Number
            rname like kna1-name1, "Rep Name
            belnr LIKE bsid-belnr, "Document number (invoice number)
            blart LIKE bsid-blart, "Document type
            zfbdt LIKE bsid-zfbdt, "Baseline date
            zterm LIKE knb1-zterm, "Terms
            netdt LIKE bsega-netdt,"Due date
            sgtxt LIKE bsid-sgtxt, "Text
            agerg TYPE t_agerg,    "Age range of invoice
            wrbtr LIKE bsid-wrbtr, "Original invoice amount
            due   LIKE bsid-wrbtr, "Amount outstanding on invoice
           long_des(250) type c,   " Long description
    <b>            long_des  TYPE string,
                long_des1 TYPE string,</b>      
          date_s(10) type c,  " Date
            short_des(20) type c,  " Short Description
            counter type i,
           End of pdet_otab_alv.
    And after filling the internal table fields ( fields 'LONG_DES1' & 'LONG_DES'  from FM READ_TEXT 's longtext, which are  of 265 chars each )
    <b>'LONG_DES1' & 'LONG_DES' are trimmed  in ALV out put  WHY ?</b>
      w_fieldcat-fieldname = 'LONG_DES1'.
      w_fieldcat-tabname   = 'PDEL_OTAB_ALV'.
    w_fieldcat-ref_fieldname = 'SCRTEXT_L'.
    w_fieldcat-ref_tabname   = 'DD03P'.
      w_fieldcat-seltext_l = 'Original Note'.
      w_fieldcat-col_pos   = 17.
      APPEND w_fieldcat TO fieldcat.
      CLEAR w_fieldcat.
      w_fieldcat-fieldname = 'LONG_DES'.
      w_fieldcat-tabname   =  'PDEL_OTAB_ALV'.
    w_fieldcat-ref_fieldname = 'SCRTEXT_L'.
    w_fieldcat-ref_tabname   = 'DD03P'.
      w_fieldcat-seltext_l = 'Latest Note'.
      w_fieldcat-col_pos   = 18.
      APPEND w_fieldcat TO fieldcat.
      CLEAR w_fieldcat.
    <b>next part i.e.,   before passing fieldcat.... I have filled s_layout like below.</b>
    <b>  s_layout-max_linesize = 1000.
      s_layout-colwidth_optimize = 'X'.</b>
    Call the following function to display output in ALV form
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program = 'ZFRSBOI0'
                is_layout          = s_layout
                it_fieldcat        = fieldcat
                it_events          = p_events[]
               it_sort            = p_it_sort[]
                i_save             = 'A'
           TABLES
                t_outtab           = pdet_otab_alv1
           EXCEPTIONS
                program_error      = 1
                OTHERS             = 2.
    If the function call is not successful, raise error message
    and come out from the program
      IF sy-subrc <> 0.
        message e000(00) with
                          'Unable to display report'(e01).
        exit.
      ENDIF.

    some body suggested me....we can display full length of text by below coding ?
    Is that not correct - just asking....
    s_layout-max_linesize = 1000.
    s_layout-colwidth_optimize = 'X'.
    Call the following function to display output in ALV form
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = 'ZFRSBOI0'
    is_layout = s_layout
    it_fieldcat = fieldcat
    it_events = p_events[]
    it_sort = p_it_sort[]
    i_save = 'A'
    TABLES
    t_outtab = pdet_otab_alv1
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    If the function call is not successful, raise error message
    and come out from the program
    IF sy-subrc <> 0.
    message e000(00) with
    'Unable to display report'(e01).
    exit.
    ENDIF.

  • How to display Long text in alv output

    Hi,
    I have developed an ALV report.It is displaying the output.
    There is another requirment for alv output text field as below
    From the long text fields show only the first 20 characters and afterwards the long text icon. If the icon is clicked open the long text display screen.
    Please give your suggestion how to work on this requirement.
    Thanks in advance

    Hi,
    Create a hotspot for the long text column of ALV.
    When user clicks on the hotspot, handle the event to display long text screen.
    You may refer sample program of hotspot ALV :
    Goto SE38
    Type BCALV*
    Click F4
    search for HOTSPOT or EVENTS & you will get a sample program.
    Best regards,
    Prashant

  • How to display the fields in ALV Output without using Field catalog?

    How to display the fields in ALV Output without using Field catalog?
    Could you pls tell me the coding?
    Akshitha.

    Hi,
    u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
    data: itab type table of mara.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_structure_name = itab
    CHANGING
    ct_fieldcat = lt_fieldcat[]
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    *Pass that field catalog into the fillowing FM
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_grid_title            = 'REPORTING'
                is_layout              = gt_layout
                it_fieldcat             = lt_fieldcat[]
           tables
                t_outtab                = itab.

  • Help on ALV GRID display outputting format for 2 internal tables

    Hi,
        I have requirement in ALV GRID where I need to display the data from 2 internal tables. The first internal table has the content of Delivery due list data and second the internal table has the corresponding stock transfer data of the Delivery Due list. I have a checbox on my selection screen, when unchecked it should output the 1st internal table data, i.e for Delivery due list. When it is checked then it should output 1st Internal table data + 2nd internal table data of stock transfer. For example, 1 document delivery due list data and 2nd line for that document should show the stock transfer data. You can also check the transaction code VL10E for that will show a delivery due list...and for stock tranfer,you need to check with Purchase order in in the USer Role tabstrip. Pls suggest.
    Regards,
    Mira

    Hi,
    U can try out this code
    REPORT zzz_test NO STANDARD PAGE HEADING
                           MESSAGE-ID zz.
    The Data Declarations
    INCLUDE zzm_test_alv_data.
    The Selection Screen Definition
    INCLUDE zzm_test_alv_selscrn.
    The definition and implementation of the event reciever class
    INCLUDE zzm_test_alv_class.
    START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM f1000_load_itabs.
    END-OF-SELECTION
    END-OF-SELECTION.
      IF NOT cb_disp IS INITIAL.
        CALL SCREEN 9001.
      ENDIF.
    Include for getting data
      INCLUDE zzm_test_alv_forms.
    Include for PAI and PBO of screen
      INCLUDE zzm_test_alv_screen.
      INCLUDE ZZM_TEST_ALV_DATA                                          *
    This include has all the data declaration defined
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    Table Declarations:
    TABLES: mara,
            makt.
    Internal Tables:
    The following structure type must be defined in the data dictionary
    DATA:  i_fieldcat  TYPE lvc_t_fcat,
           i_fieldcat1 TYPE lvc_t_fcat,
           i_output1   TYPE STANDARD TABLE OF mara,
           i_output2   TYPE STANDARD TABLE OF makt,
    Work Areas:
           w_output1   TYPE STANDARD TABLE OF mara,
           w_output2   TYPE STANDARD TABLE OF makt.
    Variable:
    DATA: lv_repid    LIKE sy-repid.
    lv_repid = sy-repid.
      INCLUDE ZZM_TEST_ALV_SELSCRN                                       *
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    SELECTION-SCREEN BEGIN OF BLOCK b_main WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS: cb_disp AS CHECKBOX.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN END OF BLOCK b_main.
      INCLUDE ZZM_TEST_ALV_CLASS                                         *
    This include has all the data declaration defined for ALV
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    INCLUDE <icon>.
    Predefine a local class for event handling to allow the
    declaration of a reference variable before the class is defined.
    DATA : o_alvgrid1 TYPE REF TO cl_gui_alv_grid ,
           o_alvgrid2 TYPE REF TO cl_gui_alv_grid ,
           cont_for_cognos1   TYPE scrfname VALUE 'BCALC_GRID_01_9100',
           cont_for_cognos2   TYPE scrfname VALUE 'BCALC_GRID_01_9200',
           custom_container1 TYPE REF TO cl_gui_custom_container,
           custom_container2 TYPE REF TO cl_gui_custom_container,
          Work Area
           w_layout TYPE lvc_s_layo ,
           w_variant TYPE disvariant.
          Constants
    CONSTANTS : c_lay(1) TYPE c VALUE 'A' .                  " All Layouts
    CONSTANTS: BEGIN OF c_main_tab,
               tab1 LIKE sy-ucomm VALUE 'MAIN_TAB_FC1',   "
               tab2 LIKE sy-ucomm VALUE 'MAIN_TAB_FC2',   "
               END OF c_main_tab.
      INCLUDE ZZM_TEST_ALV_FORMS                                         *
    This Include has the various forms used in the program
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    *&      Form  f9001_build_field_cat
          To Build Field Catalog
         -->P_I_FIELDCAT  text
         -->P_0021   text
    FORM f9001_build_field_cat TABLES   p_fieldcat STRUCTURE lvc_s_fcat
                          USING value(p_structure).
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name       = p_structure
           CHANGING
                ct_fieldcat            = p_fieldcat[]
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE i005 WITH 'Error in ALV field catalogue creation'.
                                                                " text-e05.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " f9001_build_field_cat
    *&      Form  f9000_objects_create
          For creating Custom Containers
    -->  p1        text
    <--  p2        text
    FORM f9000_objects_create.
      CREATE OBJECT custom_container1
          EXPORTING
              container_name = cont_for_cognos1
          EXCEPTIONS
              cntl_error = 1
              cntl_system_error = 2
              create_error = 3
              lifetime_error = 4
              lifetime_dynpro_dynpro_link = 5.
      CREATE OBJECT custom_container2
          EXPORTING
              container_name = cont_for_cognos2
          EXCEPTIONS
              cntl_error = 1
              cntl_system_error = 2
              create_error = 3
              lifetime_error = 4
              lifetime_dynpro_dynpro_link = 5.
      IF sy-subrc NE 0.
    add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = lv_repid
                  txt2  = sy-subrc
                  txt1  = 'The control could not be created'(510).
      ENDIF.
      CREATE OBJECT o_alvgrid1
           EXPORTING i_parent = custom_container1.
      CREATE OBJECT o_alvgrid2
           EXPORTING i_parent = custom_container2.
    ENDFORM.                    " f9000_objects_create
    *&      Form  f9003_layout
          To define the layout
         -->P_SY_TITLE  text
         -->P_0030   text
         -->P_0031   text
         -->P_0032   text
    FORM f9003_layout USING  value(ptitle)
                             value(pzebra)
                             value(pmode)
                             value(pwidth).
      w_layout-grid_title  = ptitle.
      w_layout-zebra       = pzebra.
      w_layout-sel_mode    = pmode.
      w_layout-cwidth_opt  = pwidth.
      w_variant-report     = sy-repid.
    ENDFORM.                    " f9003_layout
    *&      Form  f9006_error_handle
         To handle event
         -->P_PTEXT  text
    FORM f9006_error_handle USING value(ptext).
      IF sy-subrc NE 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = text-e03 " Error Note
                  txt2  = sy-subrc
                  txt1  = ptext.
      ENDIF.
    ENDFORM.                    " f9006_error_handle
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      CALL METHOD custom_container1->free.
      CALL METHOD custom_container2->free.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc NE 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = lv_repid
                  txt2  = sy-subrc
                  txt1  = 'Error in FLush'(500).
      ENDIF.
    ENDFORM.
    *&      Form  f1000_load_itabs
          Select from Database
    -->  p1        text
    <--  p2        text
    form f1000_load_itabs.
      SELECT * FROM mara
               INTO TABLE i_output1
               UP TO 50 rows.
      SELECT * FROM makt
               INTO TABLE i_output2
               UP TO 50 rows.
    endform.                    " f1000_load_itabs
      INCLUDE ZZM_TEST_ALV_SCREEN                                        *
    2/ Description / Include functions
    This include contains PBO and PAI events for the screen of report
    ZZZJJ_TEST_ALV
    3/ Responsibility
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    DATA FOR TABSTRIP 'MAIN_TAB'
    CONTROLS:  main_tab TYPE TABSTRIP.
    DATA:      BEGIN OF i_main_tab,
                 subscreen   LIKE sy-dynnr,
                 prog        LIKE sy-repid VALUE
                                  'ZZZ_TEST',
                 pressed_tab LIKE sy-ucomm VALUE c_main_tab-tab1,
               END OF i_main_tab.
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE status_9001 OUTPUT.
    IF custom_container1 IS INITIAL.
      SET PF-STATUS 'ZSTATUS'.
      SET TITLEBAR 'ZTITLE'.
      Creating Object
        PERFORM f9000_objects_create.
      Building the field catalog
        PERFORM f9001_build_field_cat TABLES i_fieldcat
                                USING 'MARA'.
        PERFORM f9001_build_field_cat TABLES i_fieldcat1
                                USING 'MAKT'.
      Modifying the field catalog
       PERFORM f9002_modify_field_cat TABLES i_fieldcat.
      For Layout
        PERFORM f9003_layout USING sy-title 'X' 'B' 'X'.
    ENDIF.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  MAIN_TAB_ACTIVE_TAB_SET  OUTPUT
          Call method to display in the output grid
    MODULE main_tab_active_tab_set OUTPUT.
      main_tab-activetab = i_main_tab-pressed_tab.
      CASE i_main_tab-pressed_tab.
        WHEN c_main_tab-tab1.
      To display report
         i_main_tab-subscreen = '9100'.
          CALL METHOD o_alvgrid1->set_table_for_first_display
          EXPORTING
             is_variant                    = w_variant
             i_save                        = c_lay
             is_layout                     = w_layout
          CHANGING
             it_outtab                     = i_output1[]
             it_fieldcatalog               = i_fieldcat[]
          EXCEPTIONS
             invalid_parameter_combination = 1
             program_error                 = 2
             too_many_lines                = 3
             OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH text-e06."Error in ALV report display
        LEAVE LIST-PROCESSING.
      ENDIF.
        WHEN c_main_tab-tab2.
      To display report
          i_main_tab-subscreen = '9200'.
          CALL METHOD o_alvgrid2->set_table_for_first_display
          EXPORTING
             is_variant                    = w_variant
             i_save                        = c_lay
             is_layout                     = w_layout
          CHANGING
             it_outtab                     = i_output2[]
             it_fieldcatalog               = i_fieldcat1[]
          EXCEPTIONS
             invalid_parameter_combination = 1
             program_error                 = 2
             too_many_lines                = 3
             OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE i005 WITH text-e06."Error in ALV report display
        LEAVE LIST-PROCESSING.
      ENDIF.
    WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 “MAIN_TAB_ACTIVE_TAB_SET OUTPUT
    *&      Module MAIN_TAB_ACTIVE_TAB_GET INPUT
          Check & Process the selected Tab
    MODULE main_tab_active_tab_get INPUT.
      CASE sy-ucomm.
        WHEN c_main_tab-tab1.
          i_main_tab-pressed_tab = c_main_tab-tab1.
        WHEN c_main_tab-tab2.
          i_main_tab-pressed_tab = c_main_tab-tab2.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 “MAIN_TAB_ACTIVE_TAB_GET INPUT
    *&      Module USER_COMMAND_9001 INPUT
          User Command
    MODULE user_command_9001 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          PERFORM exit_program.
          SET SCREEN '0'.
        WHEN 'EXIT' OR  'CANC'.
          PERFORM exit_program.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 “USER_COMMAND_9000 INPUT
    *&      Module MAIN_TAB_ACTIVE_TAB_SET INPUT
          Set sunscreen
    MODULE main_tab_active_tab_set INPUT.
      main_tab-activetab = i_main_tab-pressed_tab.
      CASE i_main_tab-pressed_tab.
        WHEN c_main_tab-tab1.
            i_main_tab-subscreen = '9100'.
        WHEN c_main_tab-tab2.
            i_main_tab-subscreen = '9200'.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 “MAIN_TAB_ACTIVE_TAB_SET INPUT
    Thanks & Regards,
    Judith.

  • ALV grid display the subtotal not getting for one column at the output

    Hi,
    I am working one report ALV grid display and subtotal is not getting for one paricular coulumn.
    Eventhough that column has some values.
    So can anyone give the proper solution.
    Waiting quick response.
    Best Regards,
    Bansi

    Hi
    see this link .
    https://wiki.sdn.sap.com/wiki/display/ABAP/SUBTOTALinALV
    or try this program.
    REPORT zalv.
    DATA:
    t_sflight TYPE TABLE OF sflight,
    fs_sflight TYPE sflight.
    DATA:
    r_container TYPE REF TO cl_gui_custom_container,
    r_grid TYPE REF TO cl_gui_alv_grid.
    *FIELD CATALOG
    DATA:
    t_fcat TYPE lvc_t_fcat,
    fs_fcat TYPE lvc_s_fcat.
    *SORTING THE BASIC LIST
    DATA:
    t_sort TYPE lvc_t_sort,
    fs_sort TYPE lvc_s_sort.
    fs_fcat-fieldname = 'PRICE'.
    fs_fcat-do_sum = 'X'.
    APPEND fs_fcat TO t_fcat.
    fs_sort-spos ='1'.
    fs_sort-fieldname = 'CARRID'.
    fs_sort-down = 'X'.
    fs_sort-group = '*'.
    fs_sort-subtot = 'X'.
    APPEND fs_sort TO t_sort.
    SELECT * FROM sflight INTO TABLE t_sflight.
    CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'SCREEN1'.
    SET TITLEBAR 'TITLE1'.ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    **& Module HANDLER OUTPUT
    MODULE list OUTPUT.
    CREATE OBJECT r_container
    EXPORTING
    container_name = 'CONTAINER'.
    CREATE OBJECT r_grid
    EXPORTING
    i_parent = r_container.
    CALL METHOD r_grid->set_table_for_first_display
    EXPORTING
    i_structure_name = 'SFLIGHT'
    CHANGING
    it_fieldcatalog = t_fcat
    it_outtab = t_sflight
    it_sort = t_sort.
    ENDMODULE. "list OUTPUT
    Regards
    Hareesh Menon

Maybe you are looking for

  • Help frame is not opening to user, but displayed on the windows status bar.

    Hi All, In my application help frame is displaying on the windows status bar. But when i click on the icon it is not displayed on the desktop. This is not happening again to reproduce it. If you have faced this problem anytime, please let me know. Ma

  • [CS2][JS] Search text & replace with inline Image

    I am working with a large layout with many entries. There is a text "placeholder" that I need to search for and replace with an inline image in that exact spot. I need to apply an Object Style to that image. There is a loop above this for each find/r

  • Question about Java apps structure

    Hello guys, I'm a professional C++ programmer and I would like to start learning Java. I'm reading about Java from here and there and would like to ask you about how a java program is structured compared to C++. So in C++, I have main.cpp (or any oth

  • Recognize CSS on Local Machine

    I use adbove dreamweaver CS6. Our header file is a .inc include. The .inc file contains the link to the css. How do I point to the css file I want to use for design purposes. The css file is text2.css I want dreamweaver to see it in local mode BUT I

  • RE: GUI System LookAndFeel question about table headers

    Hi I have created a GUI I have set the LookAndFeel to be the systems LookAndFeel. However I do not want the background color of the table header to be the same color as the system look and feel. Is there anyway of overiding it. Heres the code that se