ALV Webdynrpo - issues

Hi,
I have created a ALV webdynrpo and have following questions.
1- I have created a zstructure and used in my webdynpro.I don't want to display one of the column.How do we hide that?
2- How can we re-arrange columns sequence in the output view ?
3- I have 2 views(SEARCHVIEW & OUTPUTVIEW) and I was able to hide COPY/RESET buttons which comes on screen defaultly in SEARCHVIEW by using following code in   WDDOINIT method
wd_this->m_handler->set_global_options( i_display_btn_cancel  = abap_false
                                                              i_display_btn_check   = abap_false
                                                              i_display_btn_reset     = abap_false
                                                              i_display_btn_execute = abap_false ).
When I run the report it is using OUTPUTVIEW and these(COPY/RESET) are comming back again.I tried using same code in WDDOINT of OUTPUTVIEW but I am getting an error.
Access via 'NULL' object reference not possible.
4- How do we add Checkbox to the one of the output Column.Just need to enable or disable based on variable.
Rgds
Vara
Edited by: Vara K on Jan 15, 2009 6:19 PM

That is a lot of questions for one thread.  In general you will need to access the component usage interface of the ALV and then you can gain access to the model class of the alv. I often do this functionality in the WDDOINIT of my component controller.
data: l_ref_cmp_usage type ref to if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.
  data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv( ).
  data l_table type ref to cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).
Throught the model object (cl_salv_wd_config_table) you can do most everything you describe in code.  Also consider that with the settings button you can do most of these things at runtime and save the settings as views. 
1- I have created a zstructure and used in my webdynpro.I don't want to display one of the column.How do we hide that?
data l_column type ref to cl_salv_wd_column.
  l_column = l_table->if_salv_wd_column_settings~get_column( 'CLIENT' ).
  l_column->set_visible( cl_wd_uielement=>e_visible-none ).
2- How can we re-arrange columns sequence in the output view ?
l_column = l_table->if_salv_wd_column_settings~get_column( 'BUYER_GUID' ).
  l_column->set_position( 2 ).
3- I have 2 views(SEARCHVIEW & OUTPUTVIEW) and I was able to hide COPY/RESET buttons which comes on screen defaultly in SEARCHVIEW by using following code in WDDOINIT method
Are you sure you are talking about ALV here.  This code sample looks like Select-Options and not ALV.  Reset and Execute definitely sounds like Select-Options as ALV has no such standard buttons.
4- How do we add Checkbox to the one of the output Column.Just need to enable or disable based on variable
data checkbox type ref to cl_salv_wd_uie_checkbox.
  l_column = l_table->if_salv_wd_column_settings~get_column( 'ADD_PARTICIPANTS' ).
  create object checkbox.
  checkbox->set_checked_fieldname( 'ADD_PARTICIPANTS' ).
  checkbox->set_enabled_fieldname( 'ADD_PART_ENABLED' ).
  l_column->set_cell_editor( checkbox ).

Similar Messages

  • Webdynrpo ALV filter issue

    Hi All,
    In web dynpro ALV we have one column called Article . I am trying to find the article 661-2689 by using Standard SAP filter option but the Article is getting converted to 000000000000000661-000000000000002689 . This zero appending happens when I choose the Filter/ Press enter key . It does not find the article by using Filter option .
    Our system version is SAP_BASIS 700 . Please let me know if there is any solution to this ALV Filter issue .
    Thanks in advance,
    Kiran.

    Hi Kiran,
    It depends on the attribute's data element. If it's NUMC this property is automatically displayed in the context in the bottom panel labeled "Formatting".
    But if you are trying to do it whit Article i think the data element is MATNR of type CHAR, so this property will not be displayed.
    May be, you need to convert the value assigned to your filter field before to trigger the filter. I think you have created an action for the event "onFilter" in your table, so in this action before to do "wd_this->table_filter->apply_filter( )" maybe you need to use the FM CONVERSION_EXIT_ALPHA_OUTPUT in order to quit the leading zeros.

  • ALV print issue in top-of-page

    Hi,
    I have developed a alv report using REUSE_ALV_GRID_DISPLAY function module. I am using top-of-page event in events table to output top-of-page details. It is showing output correctly on screen but when I do a print preview, it is showing only the grid details and no header info from top-of-page. Please advise what can be the issue? I might be missing some parameter somewhere..I am creating my field catalog manually w/o reference to a structure or internal table..can this be a issue..
    Thanks in advance

    Have you passed the program name in parameter I_CALLBACK_PROGRAM
    DATA:f_repid TYPE sy-repid.
    f_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program      = f_repid  "  Program name

  • ITS 6.20 PL18 - ALV Grid issues

    Hi,
    We are in the midst of testing the ITS 6.20 patch 18 with EP6 SP12 and we have run into some problems that were not evident with 6.10.
    First. With IAC PP_MY_REQUIREMENTS (Requirements Profile) and PP_MY_PROFILEMATCHUP (Profile Matchup), there is now a visible horizontal bar that goes across the whole window. It can be moved up and down. This is not there in 6.10.
    Second. With the new PZ31_EWT (Edit Qualifications) transaction, when you select a qualification on the left and it then appears on the right, the dropdown for the ALV grid does not stay droped down when clicked. You have to hold the mouse button, and then when you drag over top of the choice that you want, it doesn't select it, BUT, if you use your arrow keys on the keyboard, it changes the value.
    Third. With PV8I (Internal Training), when viewing the Booking Information in the bottom of the screen, the top line/header of the window is only 1/8 visible.
    Has anyone run into any of these problems before? Does patch 19 or 20 (when it comes out) solve any of these problems?
    Sorry for all the ranting!!
    Cheers,
    Kevin

    Hi Kevin,
    I tried to recreate these issues with patch 20.
    First. I was not able to get the screens in the test system but it sounds to me like a splitter sash that devides two areas.
    Second. The drop down listboxes work as expected with patch 20 and stay open.
    Third. I am unsure if I did the correct steps but the book information area in PV8I looks pretty good. The header was completely visible.
    Best regards,
    Klaus

  • Alv output issue

    Hi everyone,
                      i m posting one of my ALV Program which i m having error as well as i m having few doubts , frnds plz clarify.
    <code>
    *ztest_alv_sri.
    *& Report  ZSrialv                                                 *
    REPORT  ZSrialv
            MESSAGE-ID Z00.
    TABLE DECLARATIONS
    TABLES : EKKO.        "Purchasing Document Header
    CONSTANTS DECLARATIONS
    CONSTANTS : C_EBELN(5) VALUE 'EBELN'.
    DATA DECLARATIONS
    DATA : V_FLAG,        "For Select Status
           V_DATA(50).    "To Store Data
    TYPE DECLARATIONS FOR ALV                                            *
    TYPE-POOLS : SLIS.
    *Type Declarations for Field Catalog for Basic List
    DATA : I_FLDCAT_HEAD  TYPE SLIS_T_FIELDCAT_ALV,
           WA_FLDCAT_HEAD TYPE SLIS_FIELDCAT_ALV.
    *Type Declarations for Field Catalog for Secondary List
    DATA : I_FLDCAT_ITEM  TYPE SLIS_T_FIELDCAT_ALV,
           WA_FLDCAT_ITEM TYPE SLIS_FIELDCAT_ALV.
    *Type Declarations for Displaying Images on Basic Grid
    DATA : I_COMMENT  TYPE SLIS_T_LISTHEADER,
           WA_COMMENT TYPE SLIS_LISTHEADER.
    *Type Declarations for Displaying Images on Secondary Grid
    DATA : I_COMMENT_SEC  TYPE SLIS_T_LISTHEADER,
           WA_COMMENT_SEC TYPE SLIS_LISTHEADER.
    *Type Declarations for ALV Events for Basic Grid
    DATA : I_EVENTS TYPE SLIS_T_EVENT,
           WA_EVENT LIKE LINE OF I_EVENTS.
    *Type Declarations for ALV Events for Secondary Grid
    DATA : I_EVENTS_SEC TYPE SLIS_T_EVENT,
           WA_EVENT_SEC LIKE LINE OF I_EVENTS.
    *Type Declarations for Layout Design
    DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    *Type Declarations for Linking the fields
    DATA : WA_KEYINFO TYPE SLIS_KEYINFO_ALV.
    INTERNAL TABLE DECLARATIONS
    *--Internal Table for Basic List
    DATA : BEGIN OF IT_FINAL_BAS OCCURS 0,
             EBELN LIKE EKKO-EBELN,        "Purchasing Document Number
             BUKRS LIKE EKKO-BUKRS,        "Company Code
             AEDAT LIKE EKKO-AEDAT,        "Date on which the record was created
             EKORG LIKE EKKO-EKORG,        "Purchasing Organization
             EKGRP LIKE EKKO-EKGRP,        "Purchasing group
             COLOR(3),                     "For applying color
           END OF IT_FINAL_BAS.
    *--Internal Table for Secondary List
    DATA : BEGIN OF IT_FINAL_SEC OCCURS 0,
             EBELN LIKE EKPO-EBELN,        "Purchasing Document Number
             MATNR LIKE EKPO-MATNR,        "Material Number
             TXZ01 LIKE EKPO-TXZ01,        "Material Desc
             WERKS LIKE EKPO-WERKS,        "Plant
             LGORT LIKE EKPO-LGORT,        "Location
             MATKL LIKE EKPO-MATKL,        "Material Group
             MENGE LIKE EKPO-MENGE,        "Purchase order quantity
             MEINS LIKE EKPO-MEINS,        "Order unit
             NETPR LIKE EKPO-NETPR,        "Net price in purchasing document (in document currency)
             NETWR LIKE EKPO-NETWR,        "Net order value in PO currency
             DUMMY LIKE ICON-ID,           "For placing Icon
             COLOR(3),                     "For applying color
           END OF IT_FINAL_SEC.
    *--Internal Table for Secondary List with selected records
    DATA : BEGIN OF I_ITEM_DISPLAY OCCURS 0,
             EBELN LIKE EKPO-EBELN,        "Purchasing Document Number
             MATNR LIKE EKPO-MATNR,        "Material Number
             TXZ01 LIKE EKPO-TXZ01,        "Material Desc
             WERKS LIKE EKPO-WERKS,        "Plant
             LGORT LIKE EKPO-LGORT,        "Location
             MATKL LIKE EKPO-MATKL,        "Material Group
             MENGE LIKE EKPO-MENGE,        "Purchase order quantity
             MEINS LIKE EKPO-MEINS,        "Order unit
             NETPR LIKE EKPO-NETPR,        "Net price in purchasing document (in document currency)
             NETWR LIKE EKPO-NETWR,        "Net order value in PO currency
             DUMMY LIKE ICON-ID,           "For placing Icon
             COLOR(3),                     "For applying color
           END OF I_ITEM_DISPLAY.
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
    SELECT-OPTIONS: S_EBELN FOR EKKO-EBELN.
    SELECTION-SCREEN END OF BLOCK B1.
    Event : INITIALIZATION
    INITIALIZATION.
      MOVE 'Developed by'(001) TO V_DATA.
    Event : AT SELECTION SCREEN
    AT SELECTION-SCREEN.
      PERFORM VALIDATE_EBELN.
    Event : START-OF-SELECTION
    START-OF-SELECTION.
    *--Getting the Data
      PERFORM GET_DATA.
    *--Generating the Field catalog for basic and secondary grid
      PERFORM GET_FLDCAT.
    *--Generating the Layout for basic and secondary grid
      PERFORM GET_LAYOUT.
    *--Generating the key infor to link Basic grid to Secondary grid
      PERFORM GET_KEYINFO.
    *--Generating the Events for Basic and Secondary Grid
      PERFORM GET_EVENTS.
    Event : END-OF-SELECTION
    END-OF-SELECTION.
      IF V_FLAG EQ 'X'.
    *--Generating Basic List
        PERFORM DISP_BASIC_LIST.
      ELSE.
        MESSAGE I010 WITH 'No Data Found To Display'(002).
      ENDIF.
         SUB-ROUTINES
    *&      Form  VALIDATE_EBELN
          Validating the PO No
    FORM VALIDATE_EBELN .
      SELECT EBELN
      UP TO 1 ROWS
      INTO (EKKO-EBELN)
      FROM EKKO
      WHERE EBELN IN S_EBELN.
      ENDSELECT.
      IF SY-SUBRC NE 0.
        MESSAGE I010 WITH 'Invalid PO No'(003) S_EBELN-LOW 'To'(004) S_EBELN-HIGH.
      ENDIF.
    ENDFORM.                    " VALIDATE_EBELN
    *&      Form  GET_DATA
          Getting Basic List and Secondary List Data
    FORM GET_DATA .
    *--Getting Basic List Data
      SELECT EBELN                  "PO No
             BUKRS                  "Company Code
             AEDAT                  "Creation Date
             EKORG                  "Purch Org
             EKGRP                  "Purch Group
       INTO TABLE IT_FINAL_BAS
       FROM EKKO
       WHERE EBELN IN S_EBELN.
    *--Getting Secondary List Data
      IF SY-SUBRC EQ 0.
        SELECT EBELN                "PO No
               MATNR                "Material No
               TXZ01                "Material Desc
               WERKS                "Plant
               LGORT                "Location
               MATKL                "Material Group
               MENGE                "PO Qty
               MEINS                "Unit
               NETPR                "Net Price
               NETWR                "Net Value
          INTO TABLE IT_FINAL_SEC
          FROM EKPO
          WHERE EBELN IN S_EBELN.
      ENDIF.
      IF SY-SUBRC EQ 0.
        V_FLAG = 'X'.
      ELSE.
        V_FLAG = SPACE.
      ENDIF.
    ENDFORM.                    " GET_DATA
    *&      Form  GET_FLDCAT
          Generating the Field Catalog
    FORM GET_FLDCAT .
    *--Generating the Field Catalog for Basic List
      WA_FLDCAT_HEAD-FIELDNAME = 'EBELN'(005).
      WA_FLDCAT_HEAD-COL_POS = '1'.
      WA_FLDCAT_HEAD-JUST = 'C'.
      WA_FLDCAT_HEAD-OUTPUTLEN = '12'.
      WA_FLDCAT_HEAD-SELTEXT_M  = 'PO Number'(006).
      WA_FLDCAT_HEAD-DDICTXT = 'M'.
    WA_FLDCAT_HEAD-REF_TABNAME = ' '.
      WA_FLDCAT_HEAD-HOTSPOT = 'X'.
      APPEND WA_FLDCAT_HEAD TO I_FLDCAT_HEAD.
      CLEAR WA_FLDCAT_HEAD .
      WA_FLDCAT_HEAD-FIELDNAME = 'BUKRS'(007).
      WA_FLDCAT_HEAD-COL_POS = '2'.
      WA_FLDCAT_HEAD-OUTPUTLEN = '12'.
      WA_FLDCAT_HEAD-SELTEXT_M = 'Company Code'(008).
      WA_FLDCAT_HEAD-DDICTXT = 'M'.
      APPEND WA_FLDCAT_HEAD TO I_FLDCAT_HEAD.
      WA_FLDCAT_HEAD-FIELDNAME = 'AEDAT'(009).
      WA_FLDCAT_HEAD-COL_POS = '3'.
      WA_FLDCAT_HEAD-OUTPUTLEN = '10'.
      WA_FLDCAT_HEAD-SELTEXT_M = 'PO Date'(010).
      WA_FLDCAT_HEAD-DDICTXT = 'M'.
      APPEND WA_FLDCAT_HEAD TO I_FLDCAT_HEAD.
      WA_FLDCAT_HEAD-FIELDNAME = 'EKORG'(011).
      WA_FLDCAT_HEAD-COL_POS = '4'.
      WA_FLDCAT_HEAD-OUTPUTLEN = '6'.
      WA_FLDCAT_HEAD-SELTEXT_M = 'PO Org'(012).
      WA_FLDCAT_HEAD-DDICTXT = 'M'.
      APPEND WA_FLDCAT_HEAD TO I_FLDCAT_HEAD.
      WA_FLDCAT_HEAD-FIELDNAME = 'EKGRP'(013).
      WA_FLDCAT_HEAD-COL_POS = '5'.
      WA_FLDCAT_HEAD-OUTPUTLEN = '8'.
      WA_FLDCAT_HEAD-SELTEXT_M = 'PO Group'(014).
      WA_FLDCAT_HEAD-DDICTXT = 'M'.
      WA_FLDCAT_HEAD-DO_SUM = 'X'.
      APPEND WA_FLDCAT_HEAD TO I_FLDCAT_HEAD.
    *--Generating the Field Catalog for secondary List
      WA_FLDCAT_ITEM-FIELDNAME = 'EBELN'(005).
      WA_FLDCAT_ITEM-COL_POS = '1'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '12'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'PO Number'(006).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
    WA_FLDCAT_ITEM-REF_TABNAME = ' '.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'MATNR'(015).
      WA_FLDCAT_ITEM-COL_POS = '2'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '18'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'Item Number'(016).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
    WA_FLDCAT_ITEM-REF_TABNAME = ' '.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'TXZ01'(017).
      WA_FLDCAT_ITEM-COL_POS = '3'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '40'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'Item Desc'(018).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'WERKS'(019).
      WA_FLDCAT_ITEM-COL_POS = '4'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '6'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'Plant'(020).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'LGORT'(021).
      WA_FLDCAT_ITEM-COL_POS = '5'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '9'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'Location'(022).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'MATKL'(023).
      WA_FLDCAT_ITEM-COL_POS = '6'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '10'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'Mat Group'(024).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'MENGE'(025).
      WA_FLDCAT_ITEM-COL_POS = '7'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '17'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'PO Qty'(026).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'MEINS'(027).
      WA_FLDCAT_ITEM-COL_POS = '8'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '3'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'Unit'(028).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'NETPR'(029).
      WA_FLDCAT_ITEM-COL_POS = '9'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '14'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'Net Price'(037).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'NETWR'(030).
      WA_FLDCAT_ITEM-COL_POS = '10'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '16'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'Net Value'(031).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
      WA_FLDCAT_ITEM-FIELDNAME = 'DUMMY'(038).
      WA_FLDCAT_ITEM-COL_POS = '11'.
      WA_FLDCAT_ITEM-JUST = 'C'.
      WA_FLDCAT_ITEM-OUTPUTLEN = '3'.
      WA_FLDCAT_ITEM-SELTEXT_M  = 'Status'(039).
      WA_FLDCAT_ITEM-DDICTXT = 'M'.
      WA_FLDCAT_ITEM-ICON = 'X'.
      APPEND WA_FLDCAT_ITEM TO I_FLDCAT_ITEM.
    ENDFORM.                    " GET_FLDCAT
    *&      Form  DISP_BASIC_LIST
          Generating the Basic List
    FORM DISP_BASIC_LIST .
    *--Applying the color to record in Basic List
         LOOP AT IT_FINAL_BAS.
            IF IT_FINAL_BAS-BUKRS LE 1000.
              IT_FINAL_BAS-COLOR = 'C21'.
            ELSEIF IT_FINAL_BAS-BUKRS GT 1000 AND IT_FINAL_BAS-BUKRS LE 2000.
              IT_FINAL_BAS-COLOR = 'C41'.
            ELSEIF IT_FINAL_BAS-BUKRS GT 2000 AND IT_FINAL_BAS-BUKRS LE 3000.
              IT_FINAL_BAS-COLOR = 'C71'.
            ELSEIF IT_FINAL_BAS-BUKRS GT 3000.
              IT_FINAL_BAS-COLOR = 'C51'.
            ENDIF.
              MODIFY IT_FINAL_BAS INDEX SY-TABIX.
           ENDLOOP.
    *--Generating the Grid output
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = 'Zsrialv'
        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                   = 'PLAIN_BACKGROUND'
        I_GRID_TITLE                      =
        I_GRID_SETTINGS                   =
          IS_LAYOUT                         = WA_LAYOUT
          IT_FIELDCAT                       = I_FLDCAT_HEAD
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
        IT_SORT                           =
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = ' '
        IS_VARIANT                        =
          IT_EVENTS                         = I_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
        IT_ALV_GRAPHICS                   =
        IT_HYPERLINK                      =
        IT_ADD_FIELDCAT                   =
        IT_EXCEPT_QINFO                   =
        I_HTML_HEIGHT_TOP                 =
        I_HTML_HEIGHT_END                 =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_FINAL_BAS
       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.                    " DISP_BASIC_LIST
    *&      Form  GET_EVENTS
          Getting the ALV Events
    FORM GET_EVENTS .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = I_EVENTS
       EXCEPTIONS
         LIST_TYPE_WRONG       = 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.
    *--Calling the User Defined sub-routines for ALV Events
      IF NOT I_EVENTS[] IS INITIAL.
        READ TABLE I_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
        WA_EVENT-FORM = 'GENERATE_USERCOMMAND_HEADER'.
        MODIFY I_EVENTS FROM WA_EVENT INDEX SY-TABIX.
        READ TABLE I_EVENTS INTO WA_EVENT WITH KEY NAME = 'END_OF_LIST'.
        WA_EVENT-FORM = 'GENERATE_USERCOMMAND_FOOTER'.
        MODIFY I_EVENTS FROM WA_EVENT INDEX SY-TABIX.
        READ TABLE I_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
        WA_EVENT-FORM = 'GENERATE_USERCOMMAND3'.
        MODIFY I_EVENTS FROM WA_EVENT INDEX SY-TABIX.
      ENDIF.
    ENDFORM.                    " GET_EVENTS
    *&      Form  GENERATE_USERCOMMAND_HEADER
          Displaying Header-Text and Logo on Grid
    FORM GENERATE_USERCOMMAND_HEADER.
      CLEAR I_COMMENT[].
      WA_COMMENT-TYP = 'H'.
      WA_COMMENT-INFO = 'General Purchase Order Info'(032).
      APPEND WA_COMMENT TO I_COMMENT.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = I_COMMENT
          I_LOGO             = 'ENJOYSAP_LOGO'.
        I_END_OF_LIST_GRID       = 'X'.
    ENDFORM.                    " GENERATE_USERCOMMAND
    *&      Form  GENERATE_USERCOMMAND_FOOTER
          Displaying Footer-Text
    FORM GENERATE_USERCOMMAND_FOOTER .
      CLEAR I_COMMENT[].
      WA_COMMENT-TYP = 'S'.
      WA_COMMENT-KEY = V_DATA.
      WA_COMMENT-INFO = 'satish'(033).
      APPEND WA_COMMENT TO I_COMMENT.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = I_COMMENT
         I_LOGO                   = ''
          I_END_OF_LIST_GRID       = 'X'.
    ENDFORM.                    " GENERATE_USERCOMMAND_FOOTER
    *&      Form  GENERATE_USERCOMMAND3
          Getting the F-Code and Calling Secondary List
    -->  P_UCOMM        LIKE SY-UCOMM
    -->  P_SELFIELD     TYPE SLIS_SELFIELD
    FORM GENERATE_USERCOMMAND3 USING P_UCOMM LIKE SY-UCOMM
                                     P_SELFIELD TYPE SLIS_SELFIELD.
       CASE P_UCOMM.
        WHEN '&IC1'.   "DOUBLE CLICK Func-Code
          READ TABLE IT_FINAL_BAS INDEX P_SELFIELD-TABINDEX.
          REFRESH I_ITEM_DISPLAY.
    *--Applying the color to record in Secondary List
          LOOP AT IT_FINAL_SEC WHERE EBELN = IT_FINAL_BAS-EBELN.
            IF IT_FINAL_SEC-NETPR EQ 0.
              IT_FINAL_SEC-DUMMY = '@0A@'.
              IT_FINAL_SEC-COLOR = 'C61'.
            ELSEIF IT_FINAL_SEC-NETPR GT 0 AND IT_FINAL_SEC-NETPR LE 200.
              IT_FINAL_SEC-DUMMY = '@09@'.
              IT_FINAL_SEC-COLOR = 'C41'.
            ELSEIF IT_FINAL_SEC-NETPR GT 200 AND IT_FINAL_SEC-NETPR LE 1000.
              IT_FINAL_SEC-DUMMY = '@08@'.
              IT_FINAL_SEC-COLOR = 'C71'.
            ELSEIF IT_FINAL_SEC-NETPR GT 1000.
              IT_FINAL_SEC-DUMMY = '@6P@'.
              IT_FINAL_SEC-COLOR = 'C51'.
            ENDIF.
              MODIFY IT_FINAL_SEC INDEX SY-TABIX.
            MOVE-CORRESPONDING IT_FINAL_SEC TO I_ITEM_DISPLAY.
            APPEND I_ITEM_DISPLAY.
            CLEAR I_ITEM_DISPLAY.
          ENDLOOP.
    *--Getting the ALV Events of Secondary List
          PERFORM GET_EVENTS_SEC.
    *--Generating the ALV Secondary Grid output
          CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
            I_INTERFACE_CHECK              = ' '
            I_BYPASSING_BUFFER             =
            I_BUFFER_ACTIVE                = ' '
              I_CALLBACK_PROGRAM             = 'Zsrialv'
            I_CALLBACK_PF_STATUS_SET       = ' '
            I_CALLBACK_USER_COMMAND        = ' '
            I_STRUCTURE_NAME               =
              I_BACKGROUND_ID                = 'PLAIN_BACKGROUND'
              IS_LAYOUT                      = WA_LAYOUT
              IT_FIELDCAT                    = I_FLDCAT_ITEM
            IT_EXCLUDING                   =
            IT_SPECIAL_GROUPS              =
            IT_SORT                        =
            IT_FILTER                      =
            IS_SEL_HIDE                    =
            I_DEFAULT                      = 'X'
            I_SAVE                         = ' '
            IS_VARIANT                     =
              IT_EVENTS                      = I_EVENTS_SEC
            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
          IMPORTING
            E_EXIT_CAUSED_BY_CALLER        =
            ES_EXIT_CAUSED_BY_USER         =
            TABLES
              T_OUTTAB                       = I_ITEM_DISPLAY
            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.
      ENDCASE.
    ENDFORM.                    " GENERATE_USERCOMMAND3
    *&      Form  GET_LAYOUT
          Generating the Layout
    FORM GET_LAYOUT .
      WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.           "OPTIMIZING FIELD WIDTH
      WA_LAYOUT-ZEBRA = 'X'.                       "PUTTING ZEBRA COLORS
      WA_LAYOUT-INFO_FIELDNAME = 'COLOR'(034).     "APPLYING COLORS TO ROWS
    ENDFORM.                    " GET_LAYOUT
    *&      Form  GET_KEYINFO
          Getting Key info
    FORM GET_KEYINFO .
    *--Linking the Basic List to Secondary List
      WA_KEYINFO-HEADER01 = C_EBELN.
      WA_KEYINFO-ITEM01 = C_EBELN.
    ENDFORM.                    " GET_KEYINFO
    *&      Form  GET_EVENTS_SEC
          Getting Secondary List Events
    FORM GET_EVENTS_SEC .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
      EXPORTING
        I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = I_EVENTS_SEC
       EXCEPTIONS
         LIST_TYPE_WRONG       = 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.
    *--Calling user-defined sub-routines for Secondary List
      IF NOT I_EVENTS_SEC[] IS INITIAL.
        READ TABLE I_EVENTS_SEC INTO WA_EVENT_SEC WITH KEY NAME = 'TOP_OF_PAGE'.
        WA_EVENT_SEC-FORM = 'GENERATE_USERCOMMAND_H_SEC'.
        MODIFY I_EVENTS_SEC FROM WA_EVENT_SEC INDEX SY-TABIX.
        READ TABLE I_EVENTS_SEC INTO WA_EVENT_SEC WITH KEY NAME = 'END_OF_LIST'.
        WA_EVENT_SEC-FORM = 'GENERATE_USERCOMMAND_F_SEC'.
        MODIFY I_EVENTS_SEC FROM WA_EVENT_SEC INDEX SY-TABIX.
      ENDIF.
    ENDFORM.                    " GET_EVENTS_SEC
    *&      Form  GENERATE_USERCOMMAND_H_SEC
       Displaying Header-Text and Logo on Grid For Secondary List
    FORM GENERATE_USERCOMMAND_H_SEC.
      CLEAR I_COMMENT_SEC[].
      WA_COMMENT_SEC-TYP = 'H'.
      WA_COMMENT_SEC-INFO = 'Purchase Order Info'(035).
      APPEND WA_COMMENT_SEC TO I_COMMENT_SEC.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = I_COMMENT_SEC
          I_LOGO             = 'ENJOYSAP_LOGO'.
        I_END_OF_LIST_GRID       = 'X'.
    ENDFORM.                    " GENERATE_USERCOMMAND_H_SEC
    *&      Form  GENERATE_USERCOMMAND_F_SEC
          Displaying Footer-Text for Secondary List
    FORM GENERATE_USERCOMMAND_F_SEC.
      CLEAR I_COMMENT_SEC[].
      WA_COMMENT_SEC-TYP = 'S'.
      WA_COMMENT_SEC-KEY = V_DATA.
      WA_COMMENT_SEC-INFO = 'satish'(036).
      APPEND WA_COMMENT_SEC TO I_COMMENT_SEC.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = I_COMMENT_SEC
         I_LOGO                   = ''
          I_END_OF_LIST_GRID       = 'X'.
    ENDFORM.                    " GENERATE_USERCOMMAND_F_SEC </code>

    The OO ALV does not invoke the TOP-OF-PAGE event. Do you want a picture above your ALV Grid? If so you can use a splitter container and put a picture control at the top and your ALV grid on the bottom.
    This posting has an example of using a splitter container:
    Changing width of a custom container dynamically
    This posting has a discussion about using TOP-OF-PAGE:
    Display Page numbers in ALV
    This posting has an example of using picture control:
    Insert picture in selection screen.
    This posting has an example of putting a picture on top of an ALV grid:
    Logo in OO ALV Grid
    Regards,
    Pavan

  • In webdynpro for ABAP  alv table issue

    hello gurus,
                      i am new for webdynpro for ABAP.i strucked at one point at designing time.anybody  could you suggest me on this.
    thanks in advance.
    let me explain my scenario first.
    in my webdynpro for ABAP developement i have one alv table having ten fields.i am featching the data for eight fields from one Ztabale and updating , for rest of two fields we need to fill after displaying output using the respective F4 help. Right now these two fields are in input editable mode.now i am getting the values successfully from F4 help and at the same time it is allowing MANUAL ENTRIES also but as per my requirement it  should not allow  any manual entries . for this i have made these two fields are in readonly mode as like as rest of fields to avoid the MANUAL ENTRIES  but at this time i didnot get any F4 helpfor those two fields.
    so how can i achive my goal in this thing could any one suggest me.
    my final conclusion is we need to get only F4 help values into those two fields . it should not allow any manual values at any point of time.
    best regards,
    babu

    ya hi  harshit,
          my self also used same code in my action part . here i have one table with four fields  carrid , connid , fldate , price.
    for carrid i have created freely programmed search help.but if it is in display mode there is no F4 help in enable mode.
    in context for attribute carrid
    DATA lo_nd_flight TYPE REF TO if_wd_context_node.
      DATA lo_el_flight TYPE REF TO if_wd_context_element.
      DATA ls_flight TYPE wd_this->element_flight.
      DATA lt_flight TYPE wd_this->elements_flight.
    navigate from <CONTEXT> to <FLIGHT> via lead selection
      lo_nd_flight = wd_context->get_child_node( name = wd_this->wdctx_flight ).
      select connid fldate price from sflight into CORRESPONDING FIELDS OF TABLE
        lt_flight UP TO 20 ROWS.
    @TODO handle non existant child
    IF lo_nd_flight IS INITIAL.
    ENDIF.
    get element via lead selection
    lo_el_flight = lo_nd_flight->get_element( ).
    alternative access  via index
    lo_el_flight = lo_nd_flight->get_element( index = 1 ).
    @TODO handle not set lead selection
    IF lo_el_flight IS INITIAL.
    ENDIF.
    get all declared attributes
    lo_el_flight->get_static_attributes(
       IMPORTING
         static_attributes = ls_flight ).
    CALL METHOD lo_nd_flight->bind_table
      EXPORTING
        new_items            = lt_flight
       set_initial_elements = ABAP_TRUE
       index                =
    DATA: lo_cmp_usage TYPE REF TO if_wd_component_usage.
    DATA: lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
        instantiate ALV component usage if necessary
      lo_cmp_usage = wd_this->wd_cpuse_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
        pass reference to data node to instance of ALV usage
      lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
      lo_interfacecontroller->set_data( r_node_data = lo_nd_flight ).
    Configure ALV
      DATA lr_config TYPE REF TO cl_salv_wd_config_table.
      lr_config = lo_interfacecontroller->get_model( ).
    **declerations
      DATA: lt_columns TYPE salv_wd_t_column_ref,
            ls_columns TYPE salv_wd_s_column_ref,
            lr_input TYPE REF TO cl_salv_wd_uie_input_field,
            name TYPE string,
            lt_node_info TYPE wdr_context_attr_info_map,
            ls_node_info TYPE wdr_context_attribute_info,
            lv_tabix TYPE sy-tabix,
            lr_info TYPE REF TO if_wd_context_node_info.
      TYPES: BEGIN OF ty_name,
              name TYPE string,
             END OF ty_name.
      DATA: lt_name TYPE TABLE OF ty_name,
            ls_name TYPE ty_name.
    **for getting node info
    *Get the context node information
      lr_info = lo_nd_flight->get_node_info( ).
      lt_node_info = lr_info->get_attributes( ).
      LOOP AT lt_node_info INTO ls_node_info.
        CASE ls_node_info-name.
          WHEN 'CARRID'.
            ls_name-name = ls_node_info-name.
            APPEND ls_name TO lt_name.
         WHEN 'REGIONALOFFICER'.
           ls_name-name = ls_node_info-name.
           APPEND ls_name TO lt_name.
         WHEN 'INSPECTORNAME'.
           ls_name-name = ls_node_info-name.
           APPEND ls_name TO lt_name.
        ENDCASE.
      ENDLOOP.
    *Logic for  Table Horizontal Scrolling
      lr_config->if_salv_wd_table_settings~set_visible_row_count( 13 ).
      "  lr_config->if_salv_wd_table_settings~set_width( '1085' ).
      lr_config->if_salv_wd_table_settings~set_width( '100%' ).
      lr_config->if_salv_wd_table_settings~set_scrollable_col_count( 8 ).
      "  lr_config->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).
      lr_config->if_salv_wd_table_settings~set_first_visible_scroll_col( 'CARRID' ).
      lr_config->if_salv_wd_table_settings~set_cell_action_event_enabled( abap_true ).
    Set the table editable .
      DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      lr_table_settings ?= lr_config.
      lr_table_settings->set_read_only( abap_false ).
      lr_table_settings->set_read_only( abap_true ).
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
            lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lt_string TYPE STANDARD TABLE OF string,
            ld_string TYPE string,
            ld_int TYPE i,
            lv_index TYPE i.
    Make few columns editable and attach inputfield, if permitted.
        DATA lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
        CLEAR lt_string.
        APPEND 'CARRID' TO lt_string.
        LOOP AT lt_string INTO ld_string.
          lr_column_settings ?= lr_config.
          lr_column = lr_column_settings->get_column( ld_string ).
          CREATE OBJECT lr_input_field
            EXPORTING
              value_fieldname = ld_string.
          lr_input_field->set_read_only( abap_true ).
          lr_column->set_cell_editor( lr_input_field ).
        ENDLOOP.
        CLEAR lt_string.

  • ALV layout issue in excel sheet

    Hi all,
    When i executed my report, it will send the output  data in excel format to my email id.
    It is  ALV report. When i changed the layout , the layout change is happening in report output, but in my excel sheet chagned layout set was not coming. It is coming old format only.
    Is there any FM to handle the dynamic  layouts
    please help me in this.
    regards,
    Ajay Ram

    Hi Ajay
    When you change the layout, its done in the ALV o/p or rather in foreground.
    You can't make this layout change be reflected in the excel sheet that is made thru background job.
    One option is to save the layout you want and then before executing the ALV report, load the layout you want by using FMs
    REUSE_ALV_VARIANT_DEFAULT_GET
    REUSE_ALV_VARIANT_F4
    REUSE_ALV_VARIANT_EXISTENCE
    You can get the sample codes in sdn by searching for these FMs
    Reward points if useful
    Cheers
    ~Arun

  • ALV table issue after patching.

    Hi Experts.
    In our applications, there is a button. On click of that button an ALV list will be displayed in the POP-UP.
    First time when we click the button this works fine. After that the ALV list does not get displayed in the POU-UP.
    Every time we have to re login and do the process.
    Note: This is happening only after patching.
    Thanks.

    Hi i have attached the piece of code. This code is written in DOINIT Method of the view in which the ALV is embedded. Everytime the table lt_locations will have the data which needs to be displayed in the ALV. The ALV gets displayed only first time and next time if we click the button, the ALV list is not displayed.
    DATA lo_nd_srlocations TYPE REF TO if_wd_context_node.
    DATA lo_el_srlocations TYPE REF TO if_wd_context_element.
      DATA ls_srlocations    TYPE wd_this->element_srlocations.
      DATA it_srlocations    TYPE wd_this->elements_srlocations.
      DATA lt_srlocations    TYPE STANDARD TABLE OF zxr_locations.
      navigate from <CONTEXT> to <SRLOCATIONS> via lead selection
      lo_nd_srlocations = wd_context->get_child_node( name = wd_this->wdctx_srlocations ).
      get element via lead selection
    lo_el_srlocations = lo_nd_srlocations->get_element(  ).
    SELECT  * FROM zxr_locations INTO TABLE lt_srlocations.
      DATA lo_nd_locations TYPE REF TO if_wd_context_node.
    DATA lo_el_locations TYPE REF TO if_wd_context_element.
    DATA ls_locations TYPE wd_this->element_locations.
        DATA lt_locations TYPE wd_this->elements_locations.
    navigate from <CONTEXT> to <LOCATIONS> via lead selection
      lo_nd_locations = wd_context->get_child_node( name = wd_this->wdctx_locations ).
    get all declared attributes
      lo_nd_locations->get_static_attributes_table(
        IMPORTING
          table = lt_locations ).
    lo_nd_srlocations->bind_table( lt_locations ).
    lo_nd_srlocations->bind_table( lt_srlocations ).
      DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_alv_srlocations( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_interfacecontroller =   wd_this->wd_cpifc_alv_srlocations( ).
      DATA lo_value TYPE REF TO cl_salv_wd_config_table.
      lo_value = lo_interfacecontroller->get_model(
    data lr_column_settings type REF TO if_salv_wd_column_settings.
    *data lr_table_settings type ref to if_salv_wd_table_settings.
    lr_column_settings ?= lo_value.
    *lr_table_settings ?= lo_value.
    lr_column_settings->delete_column( 'MANDT' ).

  • ALV do_sum issue

    Hi,
    I have ALV report, and i m showing total at the top of PO, i have one column of percentage and has a data type P. In my field catalog i'm not passing do_sum for this column. But even i'm getting total at the top. My req is, for this column i don't want the total to be displayed at the top...
    Pls help....

    You percentage field should be the type P.
      8' ' 'PER_COMP'        ' ' 'QUAN' 'P' '000010' ' ' '% Complete'                       '% Complete'           ' '.
    I have tried to replicate the error which you are getting, but I didn't get any. Here is my sample code:
    REPORT  ZTEST_NP_ALV_1.
    type-pools: slis.
    types: begin of ty_bkpf,
           belnr type bkpf-belnr,
           buzei type bseg-buzei,
           dmbtr type bseg-dmbtr,
           per   type bseg-dmbtr,
           per1  type char10,
           end   of ty_bkpf.
    data: it_bkpf type standard table of ty_bkpf,
          wa_bkpf type ty_bkpf.
    DATA: t_fieldcat   TYPE slis_t_fieldcat_alv.
    DATA:  wa_fieldcat   TYPE slis_fieldcat_alv.
    START-OF-SELECTION.
       select belnr buzei dmbtr
              into table it_bkpf
              from  bseg
              up to 20 rows.
       loop at it_bkpf into wa_bkpf.
         wa_bkpf-per = 0.
         modify it_bkpf from wa_bkpf.
         clear  wa_bkpf.
       endloop.
        PERFORM create_field_catalog.
        PERFORM create_alv_output.
    *&      Form  create_field_catalog
    FORM create_field_catalog .
             PERFORM add_field_catalog USING :
               '01' 'BELNR'     'Doc'         '20'  '',
               '02' 'BUZEI'     'Line'        '10'  '',
               '03' 'DMBTR'     'Amount'      '20'  'X',
               '04' 'PER'       'Per % '      '10'  '',
               '05' 'PER1'      'Per1 % '     '10'  ''.
    ENDFORM.                    " create_field_catalog
    *&      Form  add_field_catalog
    *       Adds field details into field catalog
    FORM add_field_catalog  USING    p_colpos
                                     p_fldname
                                     p_fldtext
                                     p_outlen
                                     p_sum..
      wa_fieldcat-row_pos       = '1'.
      wa_fieldcat-col_pos       = p_colpos.
      wa_fieldcat-fieldname     = p_fldname.
      wa_fieldcat-tabname       = 'IT_BKPF'.
      wa_fieldcat-reptext_ddic  = p_fldtext.
      wa_fieldcat-outputlen     = p_outlen.
      wa_fieldcat-no_zero       = 'X'.  " <<
      wa_fieldcat-do_sum        = p_Sum.
      APPEND  wa_fieldcat TO t_fieldcat.
      CLEAR : wa_fieldcat.
    ENDFORM.                    " add_field_catalog
    *&      Form  create_alv_output
    *       Generate ALV Grid output
    FORM create_alv_output .
      DATA: l_repid LIKE sy-repid,
            l_layout type SLIS_LAYOUT_ALV.
      l_repid = sy-repid.
      l_layout-totals_before_items = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = l_repid
          IS_LAYOUT                = l_layout
          it_fieldcat             = t_fieldcat[]
        TABLES
          t_outtab                = it_bkpf
        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.                    " create_alv_output
    Regards,
    Naimesh Patel

  • ALV GRID Issue

    Hi,
    I have created a tabstrip. it is having two tab one is debit memo tab another one is document flow tab.directly if i am clicking the debit memo tab the alv grid output is not comming. if i am clicking debit memo tab after clicking the document flow tab ALV Grid output is commong perfectly.
    please help me....

    Hi,
    see my code....
    if not gcc_dmhdr_container is initial.
        call method gcc_dmhdr_container->free
          exceptions
            cntl_error        = 1
            cntl_system_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.
        call method gcc_grid_dmhdr->free
          exceptions
            cntl_error        = 1
            cntl_system_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.
      endif.
    call function 'LVC_FIELDCATALOG_MERGE'
         EXPORTING
           i_structure_name       = lv_tab_name1
        changing
          ct_fieldcat            = lt_fcat[]
        exceptions
          inconsistent_interface = 1
          program_error          = 2
          others                 = 3.
    *Custom Container
      create object gcc_dmhdr_container
        exporting
          container_name              = 'DM_HEADER'
        exceptions
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          others                      = 6.
    ALV Grid
      create object gcc_grid_dmhdr
        exporting
          i_parent          = gcc_dmhdr_container
        exceptions
          error_cntl_create = 1
          error_cntl_init   = 2
          error_cntl_link   = 3
          error_dp_create   = 4
          others            = 5.
      if sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      clear gs_layout.
      gs_layout-sel_mode   = 'A'.       "Allow multi line selection
      gs_layout-info_fname = 'ROW_COLINFO'.
         gs_layout-FRONTEND = 'X'.
         gs_layout-TOTALS_BEF = 'X'.
      gs_layout-numc_total = space.
    Grid Display
      call method gcc_grid_dmhdr->set_table_for_first_display
        exporting
             i_structure_name              = c_s_dmhdr
          is_variant                    = gs_variant
          i_save                        = 'A'
          is_layout                     = gs_layout
           it_toolbar_excluding          = gt_excl_fun[]
        changing
          it_outtab                     = ouput[]
          it_fieldcatalog               = lt_fcat[]
        exceptions
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4.
      if sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    In debugging mode i have tested the output table and field catalog tables. the values are comming perfectly..

  • ALV IDA Issues.

    Hi Folks,
    I am creating ALV IDA from external views.
    1. When I am trying to group any column, automatically 1s row  comes with ungrouped manner.
    2.When I am trying to un group each certificate number, I am getting dump, but same code working for Table.
    3. When I am trying to do total for respective column, automatically blank lines getting appended.
    Regards,
    Amol

    Hi Amol,
    it  looks like bugs. Thus I'll recommend to open an appropriate CSS ticket on component BC-SRV-ALV so that the development team can have a look at it and eventually reproduce it in your system.
    Thanks & Kind regards,
    Carine

  • Experts help me alv header issue

    Hi experts
    plz help
    i want to create a rectangular box in my header(top of page)
    plz guide me how to do it .
    plz giv me the code also.
    thanx in advance .

    Hi,
          I don't think its possible, but you can draw the horizontal lines upto 60 character. Pass underscore to info field of slis_t_listheader table up to 60 character only.
    Try this.
    *&      Form  sub_top_of_page                                          *
    This form is to build the Page Header                               *
    FORM sub_top_of_page .
    *--Local Variable
      DATA : lv_title(120) TYPE c,                  " Title
             lv_month(30)  TYPE c,
             lv_mont(30)   TYPE c,
             lv_bud(16)    TYPE c.
    *--Local Work Area
      DATA : lwa_line TYPE slis_listheader.  " Hold list header
    CONCATENATE p_month 'to' s_hmonth INTO lv_month SEPARATED BY space.
    IF NOT s_hmonth IS INITIAL.
       lv_mont = lv_month.
    ELSE.
      lv_mont = p_month.
    ENDIF.
    *--Title  Display
      lwa_line-typ = 'H'.               " header
      lv_title = sy-title.
      lwa_line-info = '_____________________'.
      APPEND lwa_line TO it_header.
      CLEAR lwa_line.
    *--Month Display
      lwa_line-typ  = 'S'.                " Item
      WRITE: lv_mont TO lv_month.
      lwa_line-key = text-024.
      lwa_line-info = ''______________________.
      APPEND lwa_line TO it_header.
    *--Budget Display
      lwa_line-typ  = 'S'.                " Item
      WRITE: p_bud TO lv_bud.
      lwa_line-key = text-025.
      lwa_line-info = lv_bud.
      APPEND lwa_line TO it_header.
      CLEAR: lwa_line,
             lv_mont.
    *--This funcation module will display the top of the page
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = it_header.
    *--Free
      FREE : it_header.
    ENDFORM.                    "sub_top_of_page
    Regards,
    prashant

  • [ALV] Save as dialog box is - in fact - Save as Web Page

    Hi,
    When exporting ALV to Excel from a Web Dynpro application, the Excel file opens correctly.
    But, upon calling the "Save as" entry, the dialog box is not the expected one: it is the Save as Web page one.
    Although I tried to change Excel format using the standard report SALV_BS_ADMIN_MAINTAIN, I didn't succeed in changing this.
    Could someone point me on a customizing point I missed or a resource by Microsoft dealing with this aspect?
    Many thanks in advance.
    Best regards,
    Guillaume

    Hi,
    you may want to refer Note 1590484 - ABAP ALV: SALV_BS_ADMIN_MAINTAIN issues in 7.02, 1080608 - Defining ABAP ALV export format for spreadsheet and also some related notes wrt these notes.
    Thanks,
    Chandra

  • ALV list -Runtime error using the Spreadsheet button(CTRL+SHIFT+F7)

    Hi,
    We are on ECC6.0.When ever I try to use the button 'Spreadsheet' (CTRLSHIFTF7) it gives me the following runtime error.It works fine if I use the export button.Also it works for ALV grid.Issue is only with ALV list.
    Can you pelase advise waht could be the issue.
    Thanks
    Venkat
    Runtime Errors         GETWA_NOT_ASSIGNED
    Date and Time          08.06.2009 16:02:22
    Short text
    Field symbol has not yet been assigned.
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "CL_SALV_BS_TT_RESULT_TABLE====CP" had to be
    terminated because it has
    come across a statement that unfortunately cannot be executed.
    Error analysis
    You attempted to access an unassigned field symbol
    (data segment 32781).
    This error may occur if
    - You address a typed field symbol before it has been set with
    ASSIGN
    - You address a field symbol that pointed to the line of an
    internal table that was deleted
    - You address a field symbol that was previously reset using
    UNASSIGN or that pointed to a local field that no
    longer exists
    - You address a global function interface, although the
    respective function module is not active - that is, is
    not in the list of active calls. The list of active calls
    can be taken from this short dump.
    Trigger Location of Runtime Error
    Program                                 CL_SALV_BS_TT_RESULT_TABLE====CP
    Include                                 CL_SALV_BS_TT_RESULT_TABLE====CM00L
    Row                                     165
    Module type                             (METHOD)
    Module Name                             GET_CELL_VALUE
    Source Code Extract
    Line
    SourceCde
    135
    call method cl_alv_xslt_transform=>get_days_since_1900
    136
    exporting
    137
    i_date = l_date
    138
    receiving
    139
    e_num  = attribute01.
    140
    141
    elseif ls_attribute-s_dfies-inttype eq cl_abap_typedescr=>typekind_time. "Time
    142
    data:
    143
    l_time type t.
    144
    145
    l_time = <l_data>.
    146
    147
    call method cl_alv_xslt_transform=>get_isotime_from_inttime
    148
    exporting
    149
    i_value = l_time
    150
    receiving
    151
    e_value = value.
    152
    153
    *... fill attribute01 with percent value of actual day
    154
    call method cl_alv_xslt_transform=>get_percent_of_act_day
    155
    exporting
    156
    i_time = l_time
    157
    receiving
    158
    e_num  = attribute01.
    159
    160
    elseif ls_attribute-s_dfies-inttype ca if_salv_bs_log_exp_operand=>c_numeric and
    161
    ls_attribute-s_dfies-convexit is initial.
    162
    case ls_attribute-s_dfies-reference_field_type.
    163
    when if_salv_bs_c_data=>reffieldtype_curr.
    164
    *... get iso value for currency value
    >>>>>
    call method cl_alv_xslt_transform=>get_isonum_from_intnum
    166
    exporting
    167
    i_value    = <l_data>
    168
    i_currency = <l_reference>
    169
    i_decimals = ls_attribute-s_dfies-decimals
    170
    importing
    171
    e_value    = l_isovalue.
    172
    173
    when if_salv_bs_c_data=>reffieldtype_quan.
    174
    *... get iso value for quantity value
    175
    call method cl_alv_xslt_transform=>get_isonum_from_intnum
    176
    exporting
    177
    i_value    = <l_data>
    178
    i_unit     = <l_reference>
    179
    i_decimals = ls_attribute-s_dfies-decimals
    180
    importing
    181
    e_value    = l_isovalue.
    182
    183
    when others.
    184
    *... get iso value for value

    Hi Pinaki,
    Thanks for your reply.
    below is my code.
    data: t_fieldcat type slis_t_fieldcat_alv,
            w_fieldcat like line of t_fieldcat,
            w_layout   type slis_layout_alv,
            t_sort     type slis_t_sortinfo_alv,
            w_sort     like line of t_sort,
            t_events   type slis_t_event,
            w_events   like line of t_events.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
           exporting
                i_structure_name   = 'ZSD_ORDERS'
                i_bypassing_buffer = 'X'
           changing
                ct_fieldcat        = t_fieldcat.
      data: l_lines_fieldcat type i.
      describe table t_fieldcat lines l_lines_fieldcat.
      clear: w_fieldcat.:
      w_fieldcat-col_pos = l_lines_fieldcat + 1.
      w_fieldcat-datatype = 'QUAN'.
      w_fieldcat-just = ' '.
      w_fieldcat-do_sum = ' '.
      w_fieldcat-fieldname = 'ZZSCLQTY'.
      w_fieldcat-tabname = 'T_DATA'.
      w_fieldcat-qfieldname = 'VRKME'.
      w_fieldcat-seltext_s = text-a01.
      w_fieldcat-seltext_m = text-a01.
      w_fieldcat-seltext_l = text-a01.
      append w_fieldcat to t_fieldcat.
    Modify column headings
      loop at t_fieldcat into w_fieldcat.
        case w_fieldcat-fieldname.
          when 'MATNR'.
            w_fieldcat-no_zero = 'X'.
          when 'ZZPRICECHECK'.
            w_fieldcat-reptext_ddic = text-l01.
          when 'KZWI5'.
            w_fieldcat-reptext_ddic = text-l02.
          when 'VBELN'.
            w_fieldcat-hotspot = 'X'.
          when 'BMENG'.
            w_fieldcat-do_sum = 'X'.
          when 'COUNTER'.
            w_fieldcat-do_sum = 'X'.
            w_fieldcat-reptext_ddic = text-l03.
          when 'OBJDE'.
            w_fieldcat-reptext_ddic = 'Obj ID'.
              endcase.
        modify t_fieldcat from w_fieldcat.
      endloop.
    Format output options
      clear w_layout.
      w_layout-colwidth_optimize    = 'X'.
      w_layout-zebra                = 'X'.
      w_layout-get_selinfos         = 'X'.
      w_layout-detail_initial_lines = 'X'.
      w_layout-group_change_edit    = 'X'.
    Specify list processing events
      w_events-name = 'TOP_OF_PAGE'.
      w_events-form = 'TOP_OF_PAGE'.
      append w_events to t_events.
    Fit Add List Variant from Selection Screen               "003
      clear: w_variant.
      w_variant-report  = sy-repid.
      w_variant-variant = sp_vari.
    end Fit02
      call function 'REUSE_ALV_LIST_DISPLAY'
           exporting
                i_callback_program      = w_repid
                is_layout               = w_layout
                it_sort                 = t_sort
                i_callback_user_command = 'USER_COMMAND'
                is_variant              = w_variant
                i_save                  = 'A'
                it_fieldcat             = t_fieldcat[]
                it_events               = t_events[]
           tables
                t_outtab                = t_data.
    endform.

  • How do we resize Output ALV?

    Hi,
    I don't want horizontal scrollbar in my ALV webdynrpo output.Where do i set this option?
    Basically I want to disable scroll-bar.
    Rgds
    Vara
    Edited by: Vara K on Jan 15, 2009 9:25 PM

    Hi,
    You can hide scrollbar in ALV by hiding ALV Footer.
    * create an instance of ALV component
    DATA: LR_IF_CONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,
          LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE,
          LR_CMDL TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
          LR_TABLE_SETTING TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.
    LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
    IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
       LR_CMP_USAGE->CREATE_COMPONENT( ).
    ENDIF.
    ** get reference to the ALV model
    LR_IF_CONTROLLER = WD_THIS->WD_CPIFC_ALV( ).
    LR_CMDL = LR_IF_CONTROLLER->GET_MODEL( ).
    LR_TABLE_SETTING ?= LR_CMDL.
    ** hide ALV Footer
    LR_TABLE_SETTING->SET_FOOTER_VISIBLE(
    IF_SALV_WD_C_TABLE_SETTINGS=>FOOTER_VISIBLE_FALSE ).
    Regards,
    $=====$
    Are you newbie? Check this out: [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]

Maybe you are looking for

  • Indesign CS4 won't open or create new files. Why???

    I'm using Indesign CS4 and all of a sudden it won't open old files or creat new ones. I've restarted my machine and program and it still won't do anything. Any ideas?

  • Want name of table which stores all program names

    Hi all, I want to find all the custom programs (all Z programs)in the system. Can any one tell me which table stores all the programs, t.code and stuff like that so that i can search for all the Z programs in it. i tried TSTC and TSTCT, however I don

  • Relationship between coherence and NIC teaming

    Hi, We are using Tangosol coherence for clustering purpose in our product Webmethods Integration server. When our server starts up it tries to jojn tne cluster. Our scenario is this :- We have 2 servers running on 2 separate boxes A&B. They are on sa

  • Issue in setting up Visual Composer in Composition Environment

    Hi, Does anybody configured Visual Composer in Composition Environment? I am able to install Composition Environment. I am trying to do some post installation steps given in the help document to work on Visual Composer. As per the document we need co

  • Remove little window "my computer" screen when screen sharing with iChat?

    Anyone know if it is possible to remove or minimize the little window when screen sharing with iChat? if you try to drag it off the screen, it just pops back. It does not seem possible to close it without getting booted out of the screen sharing.