Outputlen is not working in OO ALV

HI,
I need to optimize the alv grid column. But it displays the data element length. Kindly find below the code.
                ls_fieldcat-fieldname = 'MAKTX' .
                ls_fieldcat-scrtext_l = 'Material Description'.
                ls_fieldcat-scrtext_m = 'Material Description'.
                ls_fieldcat-scrtext_s = 'Material Description'.
                ls_fieldcat-col_pos = 2.
*                ls_fieldcat-outputlen = 35.
                ls_fieldcat-dd_outlen = 35.
*                ls_fieldcat-intlen = 35.
Here the MAKTX length is 40 chars, so the o/p is 40 chars but I need to display 35 chars
layout is:  gs_layout-excp_fname = 'LIGHT'.
Thanks with Regards,
Vallamuthu M

Hi Vallamuthu,
If you require any information on OO ALV you can please refer the document published on SCN, hope that helps
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907?QuickLink=index&…
Let me know in case any further inputs from my end are required on this.
BR/Thanks
Pranav Agrawal

Similar Messages

  • F3 function key not work in this ALV pgm

    Hi,
    How to make the F3 function key (go back to previous screen) work in this ALV program?
    Thanks,
    Helen
    REPORT  z_pgm.
    TYPE-POOLS : slis.
    INITIALIZATION.
      PERFORM sub_fieldcat_init CHANGING gi_fieldcat.
      PERFORM sub_eventtab_build USING gi_events[].
      PERFORM sub_event_exit_build CHANGING gi_event_exit.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = g_save
        CHANGING
          cs_variant = g_xvariant
        EXCEPTIONS
          not_found  = 2.
    *EVENT : AT SELECTION-SCREEN OUTPUT                                    *
    AT SELECTION-SCREEN OUTPUT.
               EVENT : START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM sub_comment_build  USING gi_list_top_of_page.
      PERFORM sub_get_data.
               EVENT : END-OF-SELECTION
    END-OF-SELECTION.
      IF l_error IS INITIAL.
        PERFORM sub_grid_display USING gi_adrc_disp.
      ENDIF.
    *&      Form  sub_fieldcat_init
    FORM sub_fieldcat_init CHANGING li_fieldcat LIKE gi_fieldcat[]."#EC *
      DATA : lw_fieldcat TYPE slis_fieldcat_alv.
      REFRESH gi_fieldcat[].
      CLEAR lw_fieldcat.
      lw_fieldcat-fieldname = 'SELKZ'.
      lw_fieldcat-tabname   = 'gi_adrc_disp'.
      lw_fieldcat-hotspot   = 'X'.
      lw_fieldcat-outputlen = '8'.
      APPEND lw_fieldcat TO li_fieldcat.
      CLEAR lw_fieldcat.
      lw_fieldcat-fieldname = 'LOCATION'.
      lw_fieldcat-tabname   = 'gi_adrc_disp'.
      lw_fieldcat-seltext_s = text-002.
      lw_fieldcat-seltext_m = text-002.
      lw_fieldcat-seltext_l = text-002.
      lw_fieldcat-outputlen = '20'.
      APPEND lw_fieldcat TO li_fieldcat.
    ENDFORM.                    " sub_fieldcat_init
    *&      Form  SUB_EVENTTAB_BUILD
    FORM sub_eventtab_build  USING    li_events TYPE slis_t_event.
      DATA: lw_event TYPE slis_alv_event.
    *to call top_of_page event
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = li_events.
      READ TABLE li_events WITH KEY name =  slis_ev_top_of_page
                               INTO lw_event.
      IF sy-subrc = 0.
        MOVE c_formname_top_of_page TO lw_event-form.
        APPEND lw_event TO li_events.
      ENDIF.
    ENDFORM.                    " SUB_EVENTTAB_BUILD
          FORM SUB_COMMENT_BUILD                                        *
    FORM sub_comment_build USING li_lt_top_of_page TYPE slis_t_listheader.
      DATA: lw_line TYPE slis_listheader.
    Listenüberschrift: Typ H
      CLEAR lw_line.
      lw_line-typ  = 'H'.
      lw_line-info = text-013.
      APPEND lw_line TO li_lt_top_of_page.
    Kopfinfo: Typ S
      CLEAR lw_line.
      lw_line-typ  = 'S'.
      lw_line-key  = text-014.
      lw_line-info = text-015.
      APPEND lw_line TO li_lt_top_of_page.
    ENDFORM.                    "SUB_COMMENT_BUILD
    *&      Form  sub_VARIANT_INIT
    FORM sub_variant_init .
      CLEAR g_variant.
      g_variant-report = g_repid.
    ENDFORM.                    " sub_VARIANT_INIT
    *&      Form  SUB_F4_FOR_VARIANT
          To get the existing variant
    FORM sub_f4_for_variant .
      g_variant-report = g_repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
             EXPORTING
                  is_variant          = g_variant
                  i_save              = g_save
                it_default_fieldcat =
             IMPORTING
                  e_exit              = g_exit
                  es_variant          = g_xvariant
             EXCEPTIONS
                  not_found = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
      ENDIF.
    ENDFORM.                    " SUB_F4_FOR_VARIANT
          FORM TOP_OF_PAGE
    FORM top_of_page.                                           "#EC CALLED
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gi_list_top_of_page.
    ENDFORM.                    "TOP_OF_PAGE
    FORM sub_grid_display USING li_final_disp LIKE gi_final_disp.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'                  "#EC *
          EXPORTING
            i_callback_pf_status_set = 'SET_PF_STATUS'
            i_callback_program       = g_repid
            i_callback_user_command  = 'SUB_CB_USER_COMMAND'
          i_grid_title       = l_title
            it_fieldcat              = gi_fieldcat
           is_layout          = gw_layout
            i_save                   = g_save
            is_variant               = g_variant
            it_events                = gi_events[]
            it_event_exit            = gi_event_exit[]
          IMPORTING
            e_exit_caused_by_caller  = g_exit_caused_by_caller
            es_exit_caused_by_user   = gs_exit_caused_by_user
          TABLES
            t_outtab                 = gi_adrc_disp
          EXCEPTIONS
            program_error            = 1
            OTHERS                   = 2.
    ENDFORM.                    " sub_grid_display
    *&      Form                                          *
    FORM sub_get_data .
      CLEAR l_error.
      IF NOT rb_loc IS INITIAL.
        IF p_loc EQ space.
          MESSAGE i100(zm01) WITH
                  'Please Enter Location Code and SET ID'.
          l_error = 'X'.
        ENDIF.
        SELECT addrnumber location name1 name2 building floor
                   name_co country street str_suppl1 str_suppl3 city1
                   city2 region post_code1 transpzone
                INTO TABLE gi_adrc_disp
                FROM adrc
                WHERE region = p_region
                  AND str_suppl3 = p_loc.
      ELSEIF NOT rb_all IS INITIAL.
        SELECT addrnumber location name1 name2 building floor
                   name_co country street str_suppl1 str_suppl3 city1
                   city2 region post_code1 transpzone
                INTO TABLE gi_adrc_disp
                FROM adrc
                WHERE transpzone NE space.
      ENDIF.
      IF sy-subrc NE 0.
        l_error = 'X'.
        MESSAGE i100(zm01) WITH
                  'No Record Exists for Input'.
        EXIT.
      ENDIF.
      lw_adrc-selkz = c_add.
      MODIFY gi_adrc_disp FROM lw_adrc TRANSPORTING selkz
            WHERE transpzone = space.
      lw_adrc-selkz = c_remove.
      MODIFY gi_adrc_disp FROM lw_adrc TRANSPORTING selkz
            WHERE transpzone NE space.
    ENDFORM.                    " sub_get_data
    *&      Form  sub_cb_user_command
    FORM sub_cb_user_command  USING r_ucomm LIKE sy-ucomm                               rs_selfield TYPE slis_selfield.
       l_index = rs_selfield-tabindex.
      ENDFORM.                        "sub_cb_user_command
    *&      Form  sub_cb_user_command
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'MAIN'.
    ENDFORM.                        "set_pf_status

    Hi,
    this is for setting the PF-status.
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'MAIN'.
    ENDFORM. "set_pf_status
    and double click on main and see what is the Function key and function code associated for BACK.
    FORM sub_cb_user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    case r_ucomm.
    when <b>'BACK'.</b>  <<<<i assumed Focde is BACK for BACK
    leave to screen 0.
    endform.
    Regards
    vijay

  • ** Filtering is not working correctly in ALV (REUSE_ALV_GRID_DISPLAY)

    Hi Friends,
    We have one Z report that output is displayed in ALV. We are using the standard FM 'REUSE_ALV_GRID_DISPLAY. 
    We have requirement to remove leading zeros for the field like Material Number (MATNR), Equipment Number (EQUNR) etc. We did the changes by applying the field catalog properties as below.
    lw_fieldcat-lzero = space.
    lw_fieldcat-no_zero = 'X'.
    After this, the MATNR and EQUNR is displayed correctly in the ALV. (Leading zeros are suppressed). But, when we do filter for these fields, in the filter window it displays all the values with leading zeros.
    1. We don't understand why it is showing in the Filter widow with all leading zeros. All it shows all the records instead of unique items.
    Later on, we removed the above fieldcat coding. Then, we have called the CONVERSION_EXIT routines (in the domain) for the fields to remove leading zeros.
    Now, the MATNR and EQUNR is displayed correctly (without leading zeros) in ALV. When we do filter, it is also doing filtering correctly. But, when we do filter which have EQUNR having long values (after zero suppression), it is not working correctly. i.e no items are displayed in the ALV.
    Not only for this items. If we filter character columns which have long text, it is not filtering correctly.
    2. It is not able to understand why the filtering is not working for long items. But in the standard report, the filtering is working correctly.
    We are using SAP ECC 6.0.
    Friends, can you clarify the about doubts. It is surprising for me.
    Kind regards,
    Jegathees P.
    Our customer is asked to remove the leading zeros for the numeric field

    Hi Clemens Li
    I agreed on your point. When we define the Internal table the type for element EQUNR & QUMNR , we are referring the SAP data element for EQUNR, QMNUM field.
    Our doubt is even though we refer the standard data element, in the ALV display, it shows with leading zeros and also it creates problems in the filtering and in the filter window all values instead of unique nos.
    Hi Abhii
    I have given below the fieldcat coding.
    Friends, can you kindly clarify the above said problems. Since we use SAP ECC 6.0 any notes or patches apply is required. ( this is the basic functionality in ALV, that is my doubt).
        wls_fieldcat-col_pos   = wpv_pos.
        wls_fieldcat-fieldname = wpv_champ.
        wls_fieldcat-tabname   = wlc_tabname.
      wls_fieldcat-seltext_s = wls_fieldcat-seltext_m
        wls_fieldcat-seltext_l = wpv_libelle.
        wls_fieldcat-ddictxt   = 'L'.
        wls_fieldcat-no_out    = wv_no_out.
        APPEND wls_fieldcat TO gt_fieldcat.
    Kind regards,
    Jegathees P.

  • Filter option is not working in Reuse alv grid

    Hi all,
    Filter option is not working in alv grid properly.
    if i choose one particular field for filter option .it is working .but another field it is not working though it contains different values.please give the answer.whether i have to pass filter option throuogh reuse_alv _grid or not.thanks in advance
    raj

    Hi raja,
    1. The search/filter is
       CASE SENSITIVE
    2. U can give *
       to search for pattern.
      (IN THAT CASE, it is NOT Case Sensitive)
    regards,
    amit m.

  • Appl tool buttons are not working in OO ALVs

    I am using ALV OOPs. I defined PF status. I am getting output. GRID buttons are working But the problem is Application tool bar buttons(i.e. Bcak, Exit, Cancel, ......etc) are appeared but not working. can anybody pls suggest  what
    is solution for this.
    Regards,
    Naseer.

    Hi,
    There is no problem with settings. Actually problem is not with the macros, but the problem is with buttons. when you try to press it, they are disabled. cannot be pressed.
    Hence macros that are written behind them, don't run at all.
    I am looking for version of excel 2007 version where buttons can be pressed.

  • Top_of_page is not working in ALV hierarchy?

    Hi,
          I have written following code for top_of_page using event but which is not working...This report is developed for interactive report.
    Note: passed the it_events into ALV hierarchy functional module.
    FORM build_event_tab .
       CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
         EXPORTING
           i_list_type = 1
         IMPORTING
           et_events   = it_events[].
       READ TABLE it_events INTO wa_events WITH KEY form = 'TOP_OF_PAGE'.
       IF sy-subrc = 0.
         wa_events-form = 'TOP_OF_PAGE'.
         APPEND wa_events TO it_events.
       ENDIF.
    ENDFORM. "Get_events
    FORM top_of_page USING document TYPE REF TO cl_dd_document.
       DATA: dl_text(255) TYPE c,
             lv_cutime TYPE sy-uzeit,
             lv_cudt(20) TYPE c.
       lv_cudt = sy-datum.
    *--Passing Date----*
       WRITE  lv_cudt TO dl_text.
       CONCATENATE 'Date : ' lv_cudt+6(2) '-'
                             lv_cudt+4(2) '-'
                             lv_cudt+0(4) INTO dl_text.
       CALL METHOD document->add_text
         EXPORTING
           text = dl_text.
       CLEAR : dl_text.
       CALL METHOD document->add_gap
         EXPORTING
           width = 50.
       WRITE 'Company Name' TO dl_text.
       CALL METHOD document->add_text
         EXPORTING
           text         = dl_text
           sap_emphasis = cl_dd_area=>heading
           sap_style    = cl_dd_area=>heading
           sap_color    = cl_dd_area=>list_total_inv.
       CLEAR : dl_text.
       CALL METHOD document->add_gap
         EXPORTING
           width = 150.
       lv_cutime = sy-uzeit.
       CONCATENATE 'Time : ' lv_cutime+0(2) ':'
                             lv_cutime+2(2) ':'
                             lv_cutime+4(2) INTO dl_text.
       CALL METHOD document->add_text
         EXPORTING
           text = dl_text.
       CALL METHOD document->add_gap
         EXPORTING
           width = 60.
       WRITE 'Title' TO dl_text.
       CALL METHOD document->add_text
         EXPORTING
           text         = dl_text
           sap_emphasis = cl_dd_area=>heading
           sap_style    = cl_dd_area=>heading
           sap_color    = cl_dd_area=>list_total_inv.
       CLEAR : dl_text.
       CALL METHOD document->add_gap
         EXPORTING
           width = 50.
    ENDFORM.                    "html_top_of_page
    Thanks
    Shree

    PERFORM build_fieldcat.
      PERFORM build_event_tab.
      PERFORM alv_display.
    *---Build fieldcat
    FORM build_fieldcat.
      wa_fieldcat-tabname = 'IT_VENDOR'.
      wa_fieldcat-fieldname = 'LIFNR'.
      wa_fieldcat-col_pos   = '2'.
      wa_fieldcat-seltext_l = 'SUPPLIER'.
      wa_fieldcat-outputlen = 20.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_VENDOR'.
      wa_fieldcat-fieldname = 'NAME1'.
      wa_fieldcat-col_pos   = '2'.
      wa_fieldcat-seltext_l = 'VENDOR NAME'.
      wa_fieldcat-outputlen = 40.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'WERKS'.
      wa_fieldcat-col_pos   = '1'.
      wa_fieldcat-seltext_l = 'Plant'.
      wa_fieldcat-outputlen = 5.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'AWKEY'.
      wa_fieldcat-col_pos   = '2'.
      wa_fieldcat-seltext_l = ' Document'.
      wa_fieldcat-hotspot = 'X'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'BELNR'.
      wa_fieldcat-col_pos   = '3'.
      wa_fieldcat-seltext_l = 'A/c Document'.
      wa_fieldcat-hotspot = 'X'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'BUDAT'.
      wa_fieldcat-col_pos   = '4'.
      wa_fieldcat-seltext_l = 'PJ Date'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'XBLNR'.
      wa_fieldcat-col_pos   = '5'.
      wa_fieldcat-seltext_l = 'Inv'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'BLDAT'.
      wa_fieldcat-col_pos   = '6'.
      wa_fieldcat-seltext_l = 'PJ Date'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'DMBTR'.
      wa_fieldcat-col_pos   = '7'.
      wa_fieldcat-seltext_l = 'Bill.Amount'.
      wa_fieldcat-outputlen = 19.
      wa_fieldcat-do_sum   = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'HKONT'.
      wa_fieldcat-col_pos   = '8'.
      wa_fieldcat-seltext_l = 'Cost Ctr'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ENDFORM.                    "Build_fieldcat
    *----ALV Display-----*
    FORM alv_display.
      key-header01 = 'LIFNR'.
      key-item01   = 'LIFNR'.
      DELETE ADJACENT DUPLICATES FROM it_vendor.
      DELETE ADJACENT DUPLICATES FROM it_final.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'PFSTATUS'
          it_fieldcat              = it_fieldcat[]
          i_tabname_header         = 'IT_VENDOR'
          i_tabname_item           = 'IT_FINAL'
          it_events                = it_events[]
          is_keyinfo               = key
        TABLES
          t_outtab_header          = it_vendor[]
          t_outtab_item            = it_final[].
    ENDFORM.                    "alv_display
    *----interactive method--
    FORM user_command USING r_ucomm TYPE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&IC1'.
          READ TABLE it_final INTO wa_final INDEX rs_selfield-tabindex.
          IF sy-subrc = 0.
            IF rs_selfield-fieldname = 'BELNR'.
              SET PARAMETER ID 'BLN' FIELD wa_final-belnr.
              SET PARAMETER ID 'BUK' FIELD pa_bukrs.
              SET PARAMETER ID 'GJA' FIELD pa_gjahr.
              CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
            ELSEIF rs_selfield-fieldname = 'AWKEY'.
              SET PARAMETER ID 'RBN' FIELD wa_final-awkey.
              SET PARAMETER ID 'GJR' FIELD pa_gjahr.
              CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
            ELSEIF rs_selfield-fieldname = 'LFBNR'.
              SET PARAMETER ID 'BLN' FIELD it_bsak-lfbnr.
              SET PARAMETER ID 'BUK' FIELD pa_bukrs.
              SET PARAMETER ID 'GJA' FIELD pa_gjahr.
              CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
            ELSEIF rs_selfield-fieldname = 'EBELN'.
              SELECT SINGLE
                     ebeln
                     INTO wk_ebeln
                     FROM ekko
                     WHERE ebeln = it_bsak-ebeln
                     AND bstyp = 'F'.
              IF sy-subrc EQ 0.
                SET PARAMETER ID 'BES' FIELD it_bsak-ebeln.
                CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
              ELSE.
                SET PARAMETER ID 'VRT' FIELD it_bsak-ebeln.
                CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
              ENDIF.
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "user_command
    FORM pfstatus USING ut_extab TYPE slis_t_extab.
      SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.
    ENDFORM.                    "pfstatus
    *---Authorization check---
    FORM bukrs_check.
      SELECT SINGLE
             butxt "Name of the Company Code / Company
             ort01 "City
             INTO (wk_company, wk_city) FROM t001
             WHERE  bukrs = pa_bukrs.
      IF sy-subrc <> 0.
        MESSAGE 'create your own message' TYPE 'I'.
      ENDIF.
    ENDFORM.                    " BUKRS_CHECK
    FORM build_event_tab.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = it_events[].
      READ TABLE it_events INTO wa_events
         WITH KEY name = 'SLIS_EV_TOP_OF_PAGE'.
      IF sy-subrc = 0.
        wa_events-form = 'TOP_OF_PAGE'.
        MODIFY it_events FROM wa_events INDEX sy-tabix.
      ENDIF.
      READ TABLE it_events INTO wa_events WITH KEY name =
                    'SLIS_EV_END_OF_PAGE'.
      IF sy-subrc = 0.
        wa_events-form = 'END_OF_PAGE'.
        MODIFY it_events FROM wa_events INDEX sy-tabix.
      ENDIF.
    ENDFORM. "Get_events
    FORM end_of_page.
      DATA: it_header TYPE slis_t_listheader,
            wa_header TYPE slis_listheader.
      wa_header-typ = 'S'.
      wa_header-key = 'MATERIAL'.
    *  wa_line-info = p1.
      APPEND wa_header TO it_header.
      CLEAR wa_header.
    *  READ TABLE it_maktx WITH KEY matnr = p1.
      wa_header-typ = 'S'.
      wa_header-key = 'DESCRIPTION'.
    *  wa_line-info = it_maktx-maktx.
      APPEND  wa_header TO it_header.
      CLEAR wa_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
         EXPORTING
    *      i_logo             = 'ENJOYSAP_LOGO'
           it_list_commentary = it_header.
    ENDFORM.                    "END_OF_PAGE
    FORM top_of_page USING document TYPE REF TO cl_dd_document.
      DATA: dl_text(255) TYPE c,
            lv_cutime TYPE sy-uzeit,
            lv_cudt(20) TYPE c.
      lv_cudt = sy-datum.
    *--Passing Date----*
      WRITE  lv_cudt TO dl_text.
      CONCATENATE 'Date : ' lv_cudt+6(2) '-'
                            lv_cudt+4(2) '-'
                            lv_cudt+0(4) INTO dl_text.
      CALL METHOD document->add_text
        EXPORTING
          text = dl_text.
      CLEAR : dl_text.
      CALL METHOD document->add_gap
        EXPORTING
          width = 50.
      WRITE 'INCAP CON MFG SER (P) LTD' TO dl_text.
      CALL METHOD document->add_text
        EXPORTING
          text         = dl_text
          sap_emphasis = cl_dd_area=>heading
          sap_style    = cl_dd_area=>heading
          sap_color    = cl_dd_area=>list_total_inv.
      CLEAR : dl_text.
      CALL METHOD document->add_gap
        EXPORTING
          width = 150.
      lv_cutime = sy-uzeit.
      CONCATENATE 'Time : ' lv_cutime+0(2) ':'
                            lv_cutime+2(2) ':'
                            lv_cutime+4(2) INTO dl_text.
      CALL METHOD document->add_text
        EXPORTING
          text = dl_text.
      CALL METHOD document->add_gap
        EXPORTING
          width = 60.
      WRITE 'Purchase Journal' TO dl_text.
      CALL METHOD document->add_text
        EXPORTING
          text         = dl_text
          sap_emphasis = cl_dd_area=>heading
          sap_style    = cl_dd_area=>heading
          sap_color    = cl_dd_area=>list_total_inv.
      CLEAR : dl_text.
      CALL METHOD document->add_gap
        EXPORTING
          width = 50.
    ENDFORM.                    "html_top_of_page

  • ALV Filter : Not working for a text field - Strange problem

    Dear All,
    I have a Z-program where the ALV filter is not working on a particular text field.
    The output on that text field is as below :
    ABCD
    JKLM
    YYZZ
    ABCD
    JKLM
    ABCD
    JKLM
    YYZZ
    YYZZ
    When we try to filter on YYZZ, it gives blank list. But for other options given abobe it works fine.
    I know it is because of the negative sign , but how can we over come this problem ?
    Thanks in advance,
    Sandip.

    Hi Sandip,
    Use 'LOWERCASE' in the fieldcatalog.
    For the particular text field when you are appending the Fieldcatalog structure to the Fieldcatalog Table
    ( Suppose LS_FIELDCAT)
    Then check the LOWERCASE field.
    (LS_FIELDCAT-LOWERCASE = 'X' )
    This will serve the purpose.
    Regards,
    Sourav

  • MiniSAP 6.20: ALV tree not working in background

    Good day!
    SAP provides a sample ALV tree program, BCALV_TREE_DEMO, which could be submitted in the background.
    However, it does not work in MiniSAP 6.20. It's kind of bizarre as it works in our Test system.
    Does anyone has any idea what's happening.

    Good day!
    The ALV tree report is submitted in the background.
    By right, it should produce an ALV tree report in the print spool.
    However, it does not seem to work. I checked the program and found there is a logic to check whether it's a background job or not. If it is, it would not create the container.
    It's bizarre that it does not work in MiniSAP 6.20 but it works in 6.10

  • Lead Selection does not work after setting filter for ALV.

    Hi, Can you please suggest on below scenario :
    I have a Node with a sub node in it .
    I am using the supply function on Sub Node to retrieve the date based on Parent Node.
    There are two ALV's to display parent and item data. The issue is when a filter(user defined filter) is done on Parent table, the supply function does not work. The value is that of the selected row before setting the filter. Even after removing the filter, the item data is stuck and does not change on Lead Selection.
    One thing I noticed is if the child table is a table UI, there is no issue. The only problem is when the second table is ALV
    Thanks In Advance

    Hi Prashanthi,
    Your issue can be resolved as below
    Create an event handler method 'set_alv_data'  for the event 'ON_LEAD_SELECT' of parent alv
    Write the below code inside the event handler method
    METHOD set_alv_data.
      DATA lo_node TYPE REF TO if_wd_context_node.
      DATA lv_path TYPE string.
      DATA lv_index TYPE string.
      lv_index = r_param->index.
      CONDENSE lv_index.
      CONCATENATE wd_this->wdctx_my_parent_node
      lv_index
      wd_this->wdctx_my_child_node
      INTO lv_path SEPARATED BY '.'.
      lo_node = wd_context->path_get_node(
          path                          = lv_path
      DATA lo_interface TYPE REF TO iwci_salv_wd_table.
      lo_interface = wd_this->wd_cpifc_alv_child( ). "get the ref of alv comp of child
      lo_interface->set_data(
        EXPORTING
    *    only_if_new_descr =
          r_node_data       = lo_node
    ENDMETHOD.
    The above code sets the data node of child alv based on lead selection of parent alv data.
    Note: Replace 'parent_node', 'child_node'  with your nodes & 'alv_child' with your alv component name of child alv.
    If you want to control the data of child alv on filter function, you can use the event ON_STD_FUNCTION_AFTE and once you define the filter you get the r_param->id = 'SALV_WD_FILTER_DEFINE'  & now you can clear data of child alv.
    Hope this helps you.
    Regards,
    Rama

  • In Editable ALV the BACK/CANCEL/EXIT buttons are not working?

    Hello,
    I wrote a editable FM based ALV, working fine that when user changes the data and press SAVE button, values are transfering into prog. But, i need to put a validation that, if user changes the values and press BACK/CANCEL/EXIT button, i need to popup the message that "Do you want to save changes", my PF-STATUS is good(because, SAVE is working).
    But, its not working that when user done changes and press BACK button (forgot to press SAVE button), system taking me to selection screen/screen 0!! I my code is as below,
    FORM pick USING v_ucomm     TYPE syucomm
                                         it_selfield TYPE slis_selfield.
      DATA: v_answer TYPE char1.
      READ TABLE it_z_tbl  INDEX it_selfield-tabindex
       INTO w_z_tbl.
      CASE v_ucomm.
        WHEN '&IC1'.
            " working fine this functionality
          ELSE.
            MESSAGE i000 WITH 'Double click on key field'.
          ENDIF.
        WHEN 'SAVE'.
            " working fine this functionality
        WHEN BACK' " OR 'CANCEL' OR 'EXIT'.
          PERFORM popup_for_user_decision CHANGING v_answer.
          CHECK v_answer = '1'.
          PERFORM now_update.
      ENDCASE.
    ENDFORM.     
    when i put the break point on the first line of this piece of code, its not stopping on pressing BACK/CANCEL/EXIT buttons!! (its stoppig for SAVE press or double click)
    Its stopping at this point,
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'.
    EXPORTING
    i_callback_user_command  = 'PICK'
    IMPORTING
    EXCEPTIONS
    IF sy-subrc <> 0 =================> its stopping at this point!
    ENDIF.           
    Pls. let me know why system is not recognising that i hv a PICK form (SAVE and Double clicks are working fine)?
    Thank you

    Hi,
    Actually BACK is standard user command so it is not stopping and going to selection screen.
    Give some other use command like 'BCK' and try....

  • Output of a "report_attribute_error_message" in a sorted ALV does not work!

    Hi all/SAP,
    in my thread editable ALV - how to throw an error message for a specific line & field I figured out, that the output of a "report_attribute_error_message" in the ON_DATA_CHECK event of an editable ALV does not work, if sorting is active for a column.
    Thanks to The specified item was not found. for reproducing this problem.
    A similar problem exists, using an aggregation of a column. This will lead to a runtime exception.
    I've found no fix in the OSS to this problem.
    So is there a way to use sorting together with the output of a "report_attribute_error_message"
    or if this is a bug, can/will this be fixed in the (near) future?
    Thanks,
    Andreas

    Hi,
    Yes, it doesnot work with those (RB,CB) UI elements...Have you checked for any note..I have also tried but no luck..
    Regards,
    Lekha.

  • ALV GRID Tool bar options not working

    Hello Experts,
    I copied the standard tool bar into my program with the name 'ZSALV_STANDARD' and displaying the output in the grid format in a container with the method set_table_for_first_display
    When I execute the program the standard buttong in the tool bar are not working... Can anyone guide where am I going wrong...
    Here is my code
    DATA :    gr_event_handler TYPE REF TO lcl_event_handler .
      DATA:  threed TYPE i VALUE 1.
      SET PF-STATUS  'ZSALV_STANDARD'.
    * Creating an instance for the event handler
      CREATE OBJECT gr_event_handler .
      TRY.
          CREATE DATA i_table TYPE TABLE OF (viewname).
          ASSIGN i_table->* TO <i_itab>.
          CREATE DATA wa_all LIKE LINE OF <i_itab>.
          ASSIGN wa_all->* TO <wa_tab>.
    *     Selecting data dynamically
          SELECT * FROM (viewname) INTO TABLE <i_itab>.
    *     Building the fieldcatelog
          CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
            EXPORTING
              i_structure_name       = viewname
            CHANGING
              ct_fieldcat            = li_fieldcat
            EXCEPTIONS
              inconsistent_interface = 1
              program_error          = 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.
    *     Making fields editable except key fields
          IF sy-ucomm = 'UPD' OR  sy-ucomm = 'CHANGE'.
            LOOP AT li_fieldcat INTO lwa_fieldcat.
              IF lwa_fieldcat-key = space.
                lwa_fieldcat-edit = 'X'.
                MODIFY li_fieldcat FROM lwa_fieldcat.
              ENDIF.
            ENDLOOP.
          ENDIF.
    *     Making fields editable
          IF sy-ucomm = 'NEW'.
            LOOP AT li_fieldcat INTO lwa_fieldcat.
              lwa_fieldcat-edit = 'X'.
              MODIFY li_fieldcat FROM lwa_fieldcat.
            ENDLOOP.
            lh_flag = 'X'.
            CLEAR : <i_itab>.
            DO 100 TIMES.
              APPEND <wa_tab> TO <i_itab>.
            ENDDO.
          ENDIF.
    *     Exclude buttons
          PERFORM exclude_tb_functions CHANGING i_exclude.
          IF g_custom_container IS INITIAL.
            CREATE OBJECT g_custom_container
              EXPORTING
                container_name = g_container.
            CREATE OBJECT grid1
              EXPORTING
                i_parent = g_custom_container.
          ENDIF.
    *     Making all fields non-editable if display mode
          IF sy-ucomm = 'SHOW'.
            LOOP AT li_fieldcat INTO lwa_fieldcat.
              lwa_fieldcat-edit = ' '.
              MODIFY li_fieldcat FROM lwa_fieldcat.
            ENDLOOP.
          ENDIF.
          IF sy-ucomm = 'SAVE'.
            LOOP AT li_fieldcat INTO lwa_fieldcat.
              IF lwa_fieldcat-key NE space.
                lwa_fieldcat-edit = space.
                MODIFY li_fieldcat FROM lwa_fieldcat.
              ENDIF.
            ENDLOOP.
          ENDIF.
    *     Displaying ALV Grid
          i_layout-NO_TOOLBAR = 'X'.
          i_layout-edit = 'X'.
          CALL METHOD grid1->set_table_for_first_display
            EXPORTING
              i_structure_name              = viewname
              it_toolbar_excluding          = i_exclude
              i_default                     = 'X'
              is_layout                     = i_layout
            CHANGING
              it_outtab                     = <i_itab>
              it_fieldcatalog               = li_fieldcat
            EXCEPTIONS
              invalid_parameter_combination = 1
              program_error                 = 2
              too_many_lines                = 3.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
    *      Getting the changed data
          SET HANDLER gr_event_handler->handle_data_changed FOR grid1 .
        CATCH cx_sy_create_data_error.
      ENDTRY.
    Thanks alot in advance.
    Sri

    Hello ,
    try
        call method g_grid%->set_table_for_first_display
          exporting
            i_save               = p_save_layout%
            i_default            = 'X'
            is_layout            = ps_layout%
            is_variant           = ps_variant%
            it_toolbar_excluding = pt_exclude%
          changing
            it_outtab            = pt_alv_tab1[]
            it_fieldcatalog      = pt_fieldcat%[].
        call method g_grid%->set_toolbar_interactive.
    regards
    Prabhu

  • Scrollup and down icons not working in ALV. Please help!

    Hi Experts,
           I have a ALV webdynpro ABAP report. I have to show only fixed no of rows.
           But the scrollup and scroll down icons in the ALV (^) not working when I use subtotal (aggregation).
           Interestingly scrolling works perfectly if I remove my subtotal code.  
           My subtotal code is like this:
    *...Sort PRODUCT and group it for subtotal
    *lr_field_settings ?= l_value.
    *lr_field = lr_field_settings->get_field( 'PRODUCT' ).
    *lr_field->if_salv_wd_sort~set_group_aggregation_allowed( ABAP_TRUE ).
    *lr_field->if_salv_wd_sort~create_sort_rule( ).
    *l_sortrule = lr_field->if_salv_wd_sort~GET_SORT_RULE(  ).
    *l_sortrule->set_sort_order( if_salv_wd_c_sort=>sort_order_ascending ).
    *l_sortrule->set_group_aggregation( ABAP_TRUE ).
    **...Aggregate Field QTY
    *lr_field = lr_field_settings->get_field( 'QTY' ).
    *lr_field->if_salv_wd_aggr~create_aggr_rule( ).
    *lr_aggr_rule = lr_field->if_salv_wd_aggr~get_aggr_rule(  ).
    *lr_aggr_rule->set_aggregation_type( if_salv_wd_c_aggregation=>aggrtype_total ).
    **lr_field_settings ?= l_value.
    **lr_field_settings->set_group_aggr_displayed( abap_true ).
           One more thing, In addition to subtotal it also shows grand total in the end. Is this the normal feature or my code for subtotal is wrong?
           So what could be the problem?
           Any sample code will be really helpfull. Please help!
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga

    Hi Gopal,
    Please try to build the effect you commented out in the settings of the ALV. You can save it as a special layout. If scrolling works then, you should check which part of your coding leads to the problem and possibly correct it.
    If this is not possible, just create an OSS message.
    Ciao, Regina

  • 'Select ALL' not working for WD ABAP ALV

    Hi all,
    I have a web dynpro application with a tab strip with 9 tabs. Each tab has an ALV embedded in it. Each ALV is mapped to the same  node in component controller. When the application is executed 'Select ALL' works for first ALV on the first tab. However if i select a different tab i get the select all option on the left hand corner but it does nothing when chosen.
    I also tried creating custom button on ALV toolbar for this functinality. Here i am looping over all elements of the node (bound to ALV) and using method  set_selected( abap_true ) ( method of if_wd_context_element ). This also works for first ALV on the
    first tab. However again get the same issue if i choose any other tab.
    Node cardinality : 0.... n
    Node selection :  0.....n
    ALV selection mode set to MULTI using method SET_SELECTION_MODE( CL_WD_TABLE=>E_SELECTION_MODE-MULTI ) of cofig class cl_salv_wd_config_table.
    All your inputs/suggestions to resolve this issue will be greatly appreciated.
    Thanks,
    Vivek Priyadarshi

    Hi Aditya,
    Thanks for your reply. I am using 9 comp. usage of SALV_WD_TABLE to display 9 alv and all are mapped to the same comp. controller context node. The context node has the master structure with all fields, based on the chosen tab i am populating this context node with records and setting config model for ALV accordingly.
    I tried your trick, clicked on select all on first ALV (all records chosen, works correctly here) then chose the second tab on tabstrip, however records in the new (second) ALV were not selected. When i clicked 'Select all' it did nothing, no records were chosen ( original issue ).
    Did you invalidate the common node when you navigate between tabs?In my case i am populating this node with new data every time i navigate between tabs.
    One new thing i noticed. On the first tab i am able to select individual rows by clicking on the row selection buttons on the left edge of every row. However when i go the second tab clicking on row selection button it does not get selected, only way to select a row in this case is by doing CLTR+click, something doesn't feel right about this application.
    I am going to create a new context node to check if sharing a common context node is causin this issue.
    -Vivek

  • Filter Not working in ALV grid

    Hi All,
    The filter button in ALV Grid is not working for some fields. if the filter button is selected for a particular field in the ALV grid then no entries are getting displayed in the ALV. For few fields it is working. for few fields is it not displaying any entries after selecting filter.
    Please let me know what may be the possible causes for this issue.
    Thanks in Advance!
    Thanks & Regards,
    Preethi G

    Hi,
      Ex: your output is something like this
      A                     B                         C
      1                    2                             3
      4                    2                              5
      5                    3                              6
    When you filter B for value 2, then internally it creates one more internal table like this
    A                    B                         C
    1                002                         3
    4                002                         5
    5                003                         6
    it tries to matches value 2 to 002 and it fails to retrive the record.
    The solution is try to do the conversion exit on the column/field you are trying to filter it. It will work.
    Regards,
    Ramesh.

Maybe you are looking for

  • How do I get rid of the "notebook folder" in mail app?

    In the mail app under my aol account there is a folder named "notebooks". It can't be deleted. It only appears on my mac. It doesnt show on my ios devices and it doesnt show on the aol mail web site. How do I find the source of this folder? Aol says

  • Issues changing Project Status in Solution Manager

    Hello All; I have a project in Solution Manager that is ready to be closed out. When I try to advance the status from 'TEST" to "Emergency Correction' I get the following messages MsgType Message Class        Msg.no. Message text E       /TMWFLOW/PHC

  • How do I reset font book?

    Fontbook keeps hanging on me everytime I launch it and there are a number of fonts that have been disabled for some reason that previously were enabled. Is there a way to reset it?

  • Why did two of my bookmarks lose their url info and are no longer clickable/deletable?

    I have hundreds of bookmarks and two of them lost all their info all of a sudden. I click one, it doesn't go anywhere. I right click it, I get a menu that has these listed: Open, Open in a New Tab, Open all in tabs, open all in tabs (yes it repeats),

  • I_NetLogonControl failed: Status = 1355 0x54b ERROR_NO_SUCH_DOMAIN

    when running nltest commands getting the following errors are generated. C:\Users\Administrator>nltest.exe /sc_query:chickbuns.com I_NetLogonControl failed: Status = 1355 0x54b ERROR_NO_SUCH_DOMAIN C:\Users\Administrator>nltest.exe /dclist:chickbuns.