Doubts in ALV?

Hi,
I have few doubts in Reuse_Alv_List_Display.
1. How to use It_Filter?
2. Their is a direct filter option in he list display. then what is the need of this It_Filter?
Thanks.

Hi ajay
Use
Set current filter settings. A row of the table describes the selection conditions for column entries that are not to be displayed.
You should never manually set up the internal table with the filter settings. Use this method only to set filter criteria that you got using get_filter_criteria or a layout.
Features
CALL METHOD <ref. var. to CL_GUI_ALV_GRID > ->set_filter_criteria
   EXPORTING
      IT_FILTER  =   <internal table of type LVC_T_FILT > .
<b>IT_FILTER</b>
Table with filter properties for columns for which a filter is to be set initially
check this link
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/top_of_page-top_of_list-using-alvgrid-functions-617843
http://www.sap-basis-abap.com/sapalv.htm
Rewards if helpfull
Regards
Pavan

Similar Messages

  • Doubts in alv interactive report

    Hello Gurus
    i am new to abap  i have doubt regarding interactive alv .  i wrote one but it gives runtime error . i taken reference to a sample program availiable please explain this code so i can write interactive alv effectively.
    FORM POPULATE_EVENT.
    READ TABLE ITAB_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
    IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY ITAB_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
    ENDIF.
    IF ITAB_EMPLOY-EMPID NE ''.
    READ TABLE ITAB_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
    IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'USER_COMMAND'. MODIFY ITAB_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-NAME.
    ENDIF.
    ENDIF.
    ENDFORM.

    Hi,
        Event form names are appended to an internal table and passed to the ALV. And whatever you write inside that form
    can be called through the function module.
    What you are trying to do is modify the internal table with the form name, which does not exsist. Instead of this append it.
    There are lot of example of this ALV list events.
    DATA:     T_EVENT TYPE SLIS_T_EVENT,
         W_EVENT TYPE SLIS_ALV_EVENT.
    CLEAR W_EVENT.
    W_EVENT-FORM = SLIS_EV_AFTER_LINE_OUTPUT.
    W_EVENT-NAME = SLIS_EV_AFTER_LINE_OUTPUT."AFTER_LINE_OUTPUT event
    APPEND W_EVENT TO T_EVENT.
    Thanks & Regards,
    Tapodipta Khan

  • Some doubts in alv report

    how can i page breakin alv report ?
    what are the types of variants and events in alv report?
    how to hide field in alv?
    how to change standard pf status in alv reports?
    plz give me sample program for how to use variants in alv?
    <THREAD LOCKED. Please stop asking interview questions. There is already a lot of information out there, refer to the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] on how to ask a good question and learn to search>
    Edited by: Mike Pokraka on Oct 15, 2008 4:52 PM

    how can i page breakin alv report ?
    - Yes... using NEW-PAGE
    what are the types of variants and events in alv report?
    - DATA: g_variant LIKE disvariant.
    - DATA: gt_eventos          TYPE slis_t_event.
    how to hide field in alv?
    - When you define the field catalog mark this field ls_fieldcat-no_out = 'X'.
    how to change standard pf status in alv reports?
    CLEAR ls_extab.
    ls_extab-fcode = 'ZASSIG'.
    APPEND ls_extab TO extab.
    SET PF-STATUS 'Z09_STATUS' EXCLUDING extab.

  • Doubt in ALV grid (OO ALV) download to Excel

    Hi All,
    I done Report using OOALV when down loading to Excel one row got automatically inserted to the ALV Excel downloaded sheet at the top and the row contains Sy datum , Dynamic list display , page no
    my requirement is to delete that row. Is that possible. If so please suggest me how to handle that
    Thanks
    Kiran

    Hi,
    Check this link:
    Re: Digit missing in the alv export
    Hope this helps.
    Regards,
    Satish Kanteti

  • Doubt in Alv Report Coloumn Heading

    Hi Gurus
    I want to print 2 coloumn headings in ALv Report.
    For eg: 1st line coloumn heading contains
                  Name   Number        Date      status
                2nd line coloumn heading contains under status
                              Active      Incative            
    Then if my list size is not enough to show the full details. so i can cut it in 2 lines
        if my list contains 20 coloumns
        i have to put 10 coloumns in first line
        then remaning 10 coloums in second line.
    i want the solution for both the questions.
    Help me.
    Regards.
    Bhuvana.

    For the first issue
    Use Top of Page Event to write a simple list which will act as a header for the alv list.
    Second issue:
    In the fieldcat,
    Position all the first 10 coloums row_pos = 1
    Position all the next 10 coloums row_pos = 2
    Regards,
    Lijo Joseph
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 12:35 PM

  • Doubt in alv top of page

    hi,
    I am trying to pass top of page to my alv report.
    DATA : TY_EVENTS TYPE SLIS_ALV_EVENT,
    IT_EVENTS TYPE SLIS_T_EVENT.
    CLEAR TY_EVENTS.
    TY_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
    TY_EVENTS-FORM = 'TOP_OF_PAGE'.
    APPEND TY_EVENTS TO IT_EVENTS.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = v_repid
       I_CALLBACK_PF_STATUS_SET       = 'SET_PF_STATUS'
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
       I_STRUCTURE_NAME               = 'itab'
       IS_LAYOUT                      = s_layout
       IT_FIELDCAT                    = t_fieldcatalog[]
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
        IT_EVENTS                      = IT_EVENTS
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        t_outtab                       = itab
    EXCEPTIONS
       PROGRAM_ERROR                  = 1
       OTHERS                         = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Now i have to write the code for top of page in the perform 'TOP_OF_PAGE'.
    My problem is when i double click the 'TOP_OF_PAGE'
    in here TY_EVENTS-FORM = 'TOP_OF_PAGE'.
    ,its not creating a form but insted it is asking
    Program text 'TOP_OF_PAGE' does not exist.
    Do you want to create the object .
    and when i click yes its taking to text elements
    I need to get some like this
    *& Form TOP_OF_PAGE
    text
    FORM TOP_OF_PAGE.
    SKIP.
    ULINE.
    WRITE :/2 ' DATE :', SY-DATUM,
    ENDFORM. "TOP_OF_PAGE
    waiting for replies
    How do i get the form so that i can write the code for my top of page

    hi Preeti,
    if you click on the 'TOP_OF_PAGE', it will not create a form routine, because, the name of the form is passed as a character text to the function module. So you need to manually write the form routine with the name top_of_page.
    Please use the following code; your requirement would be met!!!!
    form top_of_page.
      data:
          ls_line type slis_listheader,
          lt_line type table of slis_t_listheader,
          lv_date(10).
      ls_line-typ  = 'H'.
      concatenate sy-datum6(2) sy-datum4(2) sy-datum+0(4)
                 into lv_date separated by '/'.
      concatenate 'Date' lv_date into ls_line-info
                            separated by space.
      append ls_line to lt_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
      exporting
          it_list_commentary = lt_line.
    endform.
    Hope this works.
    Sajan.

  • Doubt on ALV report

    Hi gurus,
         For all of your support , I written the ALV report.Now the field is editable. But the problem is I need to save that field value what we edited.
           Actual requirment is we have some materials list.of vehicles... Those vechicles will move to repair after some days. Then in repair location, the user will enter some comments about that material like when it will be replaced like..That note data need to be saved.. When ever the users will execute the same report once again, that saved data will be appear..
          Please suggest me on this issue..
        Thanks in Advance
    Thanks and Regards
    Siri...

    Hi,
    chk out this..
    http://help.sap.com/saphelp_47x200/helpdata/en/39/27ae3a061d522ae10000000a114084/frameset.htm
    Regards,
    Arunsri

  • Doubt in ALV OO

    Hiee friends ,
           There is always a trailing space left at the extreme right end of ALV report . I don't wish to have that
           blank space . I am using OO method for the alv report
           I used the cl_gui_splitter_container , to split the main container but still the blank space at the 
           right  end of alv report remains .
          Can anyone tell me how to avoid that space or else to have a picture to over there so that there 
           would be no blank space in the alv report.

    Check the below code....
    REPORT ZSPLIT_ALV .
    Declearing Variable for the custom container N grid.
    DATA: CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          GRID TYPE  REF TO CL_GUI_ALV_GRID,
          l_docking  TYPE REF TO cl_gui_docking_container,
          l_splitter TYPE REF TO cl_gui_splitter_container,
          l_container_top TYPE REF TO cl_gui_container,
          l_container_bottom TYPE REF TO cl_gui_container,
          HEAD TYPE REF TO CL_GUI_ALV_TREE.
    DATA: GT_HEADER TYPE TABLE OF SLIS_LISTHEADER WITH HEADER LINE.
    Declearing Field Catalog
    DATA: GT_FIELDCAT TYPE LVC_T_FCAT,
          WA_FIELDCAT LIKE LINE OF GT_FIELDCAT.
    Declearing Layout Str N Varient
    DATA: GS_LAYOUT TYPE LVC_S_LAYO.
    DATA: GS_VARIANT LIKE DISVARIANT.
    DATA: OK_CODE LIKE SY-UCOMM.
    DATA: SAV.
    GS_VARIANT-REPORT = SY-REPID.
    SAV = 'A'.
    *GS_LAYOUT-GRID_TITLE =
    *'Report on Service Tax Payment to Vendors with Payment date details'.
    GS_LAYOUT-DETAILTITL =
    'REPORT TO DISPLAY SERVICE TAX REGISTER VENDOR DETAILS'.
    GS_LAYOUT-Zebra = 'X'.
    GS_LAYOUT-CWIDTH_OPT = 'X'.
    Data  Declaration
    DATA: BUKRS LIKE BSIS-BUKRS,
          HKONT LIKE BSIS-HKONT,
          BUDAT LIKE BSIS-BUDAT.
    Str of internal Table and work area.
    DATA: BEGIN OF STR,
            BUKRS LIKE BSIS-BUKRS,
            HKONT LIKE BSIS-HKONT,
            GJAHR LIKE BSIS-GJAHR,
            BUDAT LIKE BSIS-BUDAT,
            BELNR LIKE BSIS-BELNR,
            BUZEI LIKE BSIS-BUZEI,
            SGTXT LIKE BSIS-SGTXT,
            DMBTR LIKE BSIS-DMBTR,
            WAERS LIKE BSIS-WAERS,
            LIFNR LIKE BSAK-LIFNR,
            TXT   LIKE BSAK-SGTXT,
            NAME1 LIKE LFA1-NAME1,
            AUGDT LIKE BSAK-AUGDT, " Clearing Date
            AUGBL LIKE BSAK-AUGBL, " Clearing Doc No.
            ITEM  LIKE BSAK-BUZEI, " Clearing Doc Item
            XBLNR LIKE BSIS-XBLNR, " Ref. Doc No,
            FWBAS LIKE BSEG-FWBAS, "BASE AMOUNT
          END OF STR.
    DATA: ITAB LIKE STANDARD TABLE OF STR,
          FIN_TAB LIKE STANDARD TABLE OF STR,
          WA LIKE LINE OF ITAB.
    DATA: T_BSAK LIKE BSAK OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF VEND OCCURS 0,
             LIFNR LIKE LFA1-LIFNR,
             NAME1 LIKE LFA1-NAME1,
          END OF VEND.
    DATA: BEGIN OF T_BKPF OCCURS 0,
             BUKRS LIKE BKPF-BUKRS,
             BELNR LIKE BKPF-BELNR,
             STBLG LIKE BKPF-STBLG,
         END OF T_BKPF.
    DATA : BEGIN OF T_BSEG OCCURS 0,
             BUKRS LIKE BSEG-BUKRS,
             BELNR LIKE BSEG-BELNR,
             GJAHR LIKE BSEG-GJAHR,
             BUZEI LIKE BSEG-BUZEI,
             FWBAS LIKE BSEG-FWBAS,
          END OF T_BSEG.
    Selection Screen for input .
    SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-001.
      SELECT-OPTIONS : COMP FOR BUKRS OBLIGATORY,
                       GL   FOR HKONT OBLIGATORY,
                       DATE FOR BUDAT OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK BLK.
    Populating the Field catalog
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'BUKRS'.
    WA_FIELDCAT-REF_TABLE = 'BSIS'.
    WA_FIELDCAT-REF_FIELD = 'BUKRS'.
    WA_FIELDCAT-COLTEXT = 'Comp. Code'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-EMPHASIZE = 'C111'.
    WA_FIELDCAT-COL_POS = 1.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    *CLEAR WA_FIELDCAT.
    *WA_FIELDCAT-FIELDNAME = 'HKONT'.
    *WA_FIELDCAT-REF_TABLE = 'BSIS'.
    *WA_FIELDCAT-REF_FIELD = 'HKONT'.
    *WA_FIELDCAT-COLTEXT = 'G/L Acc. No.'.
    *WA_FIELDCAT-JUST = 'C'.
    *WA_FIELDCAT-EMPHASIZE = 'C611'.
    *WA_FIELDCAT-COL_POS = 2.
    *APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'BUDAT'.
    WA_FIELDCAT-REF_TABLE = 'BSIS'.
    WA_FIELDCAT-REF_FIELD = 'BUDAT'.
    WA_FIELDCAT-COLTEXT = 'Doc. Date'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-COL_POS = 3.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'BELNR'.
    WA_FIELDCAT-REF_TABLE = 'BSIS'.
    WA_FIELDCAT-REF_FIELD = 'BELNR'.
    WA_FIELDCAT-COLTEXT = 'Accounting Doc.'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-EMPHASIZE = 'C110'.
    WA_FIELDCAT-COL_POS = 2.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'XBLNR'.
    WA_FIELDCAT-REF_TABLE = 'BSAK'.
    WA_FIELDCAT-REF_FIELD = 'XBLNR'.
    WA_FIELDCAT-COLTEXT = 'Reference Doc.'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-COL_POS = 4.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'BUZEI'.
    WA_FIELDCAT-REF_TABLE = 'BSIS'.
    WA_FIELDCAT-REF_FIELD = 'BUZEI'.
    WA_FIELDCAT-COLTEXT = 'Item'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-COL_POS = 5.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'SGTXT'.
    WA_FIELDCAT-REF_TABLE = 'BSIS'.
    WA_FIELDCAT-REF_FIELD = 'SGTXT'.
    WA_FIELDCAT-COLTEXT = 'Item Text'.
    WA_FIELDCAT-JUST = 'L'.
    WA_FIELDCAT-COL_POS = 6.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'WAERS'.
    WA_FIELDCAT-REF_TABLE = 'BSEG'.
    WA_FIELDCAT-REF_FIELD = 'WAERS'.
    WA_FIELDCAT-COLTEXT = 'CuRR'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-DO_SUM = 'X'.
    WA_FIELDCAT-COL_POS = 7.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'LIFNR'.
    WA_FIELDCAT-REF_TABLE = 'BSAK'.
    WA_FIELDCAT-REF_FIELD = 'LIFNR'.
    WA_FIELDCAT-COLTEXT = 'Vendor'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-COL_POS = 8.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'NAME1'.
    WA_FIELDCAT-REF_TABLE = 'LFA1'.
    WA_FIELDCAT-REF_FIELD = 'NAME1'.
    WA_FIELDCAT-COLTEXT = 'Vendor Name'.
    WA_FIELDCAT-JUST = 'L'.
    WA_FIELDCAT-COL_POS = 9.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'AUGDT'.
    WA_FIELDCAT-REF_TABLE = 'BSAK'.
    WA_FIELDCAT-REF_FIELD = 'AUGDT'.
    WA_FIELDCAT-COLTEXT = 'Clearing Date'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-COL_POS = 10.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'AUGBL'.
    WA_FIELDCAT-REF_TABLE = 'BSAK'.
    WA_FIELDCAT-REF_FIELD = 'AUGBL'.
    WA_FIELDCAT-COLTEXT = 'Clearing Doc No.'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-COL_POS = 11.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'ITEM'.
    WA_FIELDCAT-REF_TABLE = 'BSAK'.
    WA_FIELDCAT-REF_FIELD = 'BUZEI'.
    WA_FIELDCAT-COLTEXT = 'Clr Doc Itm.'.
    WA_FIELDCAT-JUST = 'C'.
    WA_FIELDCAT-COL_POS = 12.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'TXT'.
    WA_FIELDCAT-REF_TABLE = 'BSAK'.
    WA_FIELDCAT-REF_FIELD = 'SGTXT'.
    WA_FIELDCAT-COLTEXT = 'Cheque Details'.
    WA_FIELDCAT-JUST = 'L'.
    WA_FIELDCAT-COL_POS = 13.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'DMBTR'.
    WA_FIELDCAT-REF_TABLE = 'BSIS'.
    WA_FIELDCAT-REF_FIELD = 'DMBTR'.
    WA_FIELDCAT-COLTEXT = 'Amount'.
    WA_FIELDCAT-JUST = 'L'.
    WA_FIELDCAT-DO_SUM = 'X'.
    WA_FIELDCAT-COL_POS = 14.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'FWBAS'.
    WA_FIELDCAT-REF_TABLE = 'BSEG'.
    WA_FIELDCAT-REF_FIELD = 'FWBAS'.
    WA_FIELDCAT-COLTEXT = 'BASE Amount'.
    WA_FIELDCAT-JUST = 'L'.
    WA_FIELDCAT-DO_SUM = 'X'.
    WA_FIELDCAT-COL_POS = 15.
    APPEND WA_FIELDCAT TO GT_FIELDCAT.
    Selection of Document No.
    SELECT * FROM BSIS INTO CORRESPONDING FIELDS OF TABLE ITAB
                                  WHERE  BUKRS IN COMP AND
                                         HKONT IN GL   AND
                                         BUDAT IN DATE.
    IF SY-SUBRC = 0.
    Selection of Document  No. Which are Reversed.
    SELECT BUKRS BELNR STBLG FROM BKPF INTO CORRESPONDING FIELDS
                       OF TABLE T_BKPF FOR ALL ENTRIES IN ITAB
                         WHERE  BUKRS = ITAB-BUKRS  AND
                                BELNR = ITAB-BELNR .
    SELECT BUKRS BELNR BUZEI FWBAS FROM BSEG INTO CORRESPONDING FIELDS
                           OF TABLE T_BSEG FOR ALL ENTRIES IN ITAB
                               WHERE  BUKRS = ITAB-BUKRS  AND
                                      BELNR = ITAB-BELNR  AND
                                      BUZEI = ITAB-BUZEI.
    IF NOT T_BKPF[] IS INITIAL.
    Deleting the Documents which are reversed.
      CLEAR WA.
      LOOP AT ITAB INTO WA.
        LOOP AT T_BKPF WHERE  BUKRS = WA-BUKRS  AND
                              BELNR = WA-BELNR .
         IF T_BKPF-STBLG <> ' '.
           DELETE ITAB WHERE
           BELNR = T_BKPF-BELNR.
         ENDIF.
       ENDLOOP.
    ENDLOOP.
    ENDIF.
    Selecting the Vendor Details
    SELECT * FROM BSAK INTO TABLE T_BSAK FOR ALL ENTRIES IN ITAB
                                  WHERE BUKRS = ITAB-BUKRS AND
                                        BELNR = ITAB-BELNR .
    CLEAR WA.
    LOOP AT ITAB INTO WA.
       LOOP AT T_BSAK  WHERE BUKRS = WA-BUKRS AND
                             BELNR = WA-BELNR .
          WA-LIFNR = T_BSAK-LIFNR.
          WA-AUGDT = T_BSAK-AUGDT.
          WA-AUGBL = T_BSAK-AUGBL.
          WA-ITEM  = T_BSAK-BUZEI.
          APPEND WA TO FIN_TAB.
       ENDLOOP.
    ENDLOOP.
    ENDIF.
    IF NOT FIN_TAB[] IS INITIAL.
    LOOP AT FIN_TAB INTO WA.
       LOOP AT T_BSEG  WHERE BUKRS = WA-BUKRS AND
                             BELNR = WA-BELNR AND
                             BUZEI = WA-BUZEI.
          WA-FWBAS = T_BSEG-FWBAS.
          MODIFY FIN_TAB FROM WA TRANSPORTING FWBAS.
       ENDLOOP.
    ENDLOOP.
    Selection for getting Vendor Name.
    SELECT LIFNR NAME1 FROM LFA1 INTO TABLE VEND FOR ALL ENTRIES IN FIN_TAB
                                  WHERE LIFNR = FIN_TAB-LIFNR.
      CLEAR WA.
      LOOP AT FIN_TAB INTO WA.
        LOOP AT VEND WHERE LIFNR  = WA-LIFNR.
          WA-NAME1 = VEND-NAME1.
          MODIFY FIN_TAB FROM WA.
        ENDLOOP.
    ENDLOOP.
    ENDIF.
    CLEAR WA.
    LOOP AT FIN_TAB INTO WA.
      LOOP AT T_BSAK WHERE  BUKRS = WA-BUKRS AND
                            BELNR = WA-BELNR AND
                            BUZEI = WA-ITEM.
       WA-TXT = T_BSAK-SGTXT.
       MODIFY FIN_TAB FROM WA.
    ENDLOOP.
    ENDLOOP.
    concatenate date-low6(2) date-low4(2) date-low+2(2)
    into date-low
    separated by '.'.
    concatenate date-high6(2) date-high4(2)
    date-high+2(2) into date-high
    separated by '.'.
    CALL SCREEN 500.
    *&      Module  STATUS_0500  OUTPUT
          text
    MODULE STATUS_0500 OUTPUT.
      SET PF-STATUS 'STAT'.
      SET TITLEBAR 'TIT'.
    ENDMODULE.                 " STATUS_0500  OUTPUT
    *&      Module  CRE_OBJ  OUTPUT
          text
    MODULE CRE_OBJ OUTPUT.
    IF CONTAINER IS INITIAL.
      CREATE OBJECT CONTAINER
           EXPORTING CONTAINER_NAME = 'CUS_CON'.
    CREATE OBJECT l_docking
              EXPORTING side = cl_gui_docking_container=>dock_at_left
                        extension = 200.
        CREATE OBJECT l_splitter
               EXPORTING parent = CONTAINER
                         rows = 2
                         columns = 1.
       CALL METHOD l_splitter->set_border
            EXPORTING border = cl_gui_cfw=>true.
        CALL METHOD l_splitter->set_row_mode
             EXPORTING mode = l_splitter->mode_absolute.
        CALL METHOD l_splitter->set_row_height
             EXPORTING id = 1
                       height = 110.
       l_container_top  =
          l_splitter->get_container( row = 1 column = 1 ).
       l_container_bottom =
          l_splitter->get_container( row = 2 column = 1 ).
        CREATE OBJECT HEAD
               EXPORTING parent = l_container_top.
        CREATE OBJECT GRID
               EXPORTING i_parent = l_container_bottom.
      CLEAR GT_HEADER.
      GT_HEADER-TYP = 'H'.
      GT_HEADER-INFO = 'SERVICE TAX REGISTER VENDOR DETAILS'.
      APPEND GT_HEADER.
      CLEAR GT_HEADER.
      GT_HEADER-TYP = 'S'.
      GT_HEADER-KEY  = 'Company Code : '.
      GT_HEADER-INFO = comp-low.
      if not comp-high is initial.
        concatenate GT_HEADER-INFO ' - To - ' comp-high into GT_HEADER-INFO.
        endif.
      APPEND GT_HEADER.
      CLEAR GT_HEADER.
      GT_HEADER-TYP = 'S'.
      GT_HEADER-KEY  = 'G/L Account      : '.
      GT_HEADER-INFO = gl-low.
      if not gl-high is initial.
      concatenate GT_HEADER-INFO '  - To -  ' gl-high into GT_HEADER-INFO.
      endif.
      APPEND GT_HEADER.
      CLEAR GT_HEADER.
      GT_HEADER-TYP = 'S'.
      GT_HEADER-KEY  = 'Posting Date      : '.
      GT_HEADER-INFO = date-low.
      if not date-high is initial.
      concatenate GT_HEADER-INFO '  - To -  ' date-high into GT_HEADER-INFO.
      endif.
      APPEND GT_HEADER.
    ENDIF.
    ENDMODULE.                 " CRE_OBJ  OUTPUT
    *&      Module  TRANS  OUTPUT
          text
    MODULE TRANS OUTPUT.
    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
           EXPORTING I_STRUCTURE_NAME = 'STR'
                     IS_LAYOUT        = GS_LAYOUT
                     IS_VARIANT       = GS_VARIANT
                     I_SAVE           = 'A'
          CHANGING   IT_OUTTAB        = FIN_TAB
                     IT_FIELDCATALOG  = GT_FIELDCAT.
    CALL METHOD HEAD->CREATE_REPORT_HEADER
          EXPORTING IT_LIST_COMMENTARY = GT_HEADER[]
                    I_BACKGROUND_ID = 'ALV_BACKGROUND'
                    I_SET_SPLITTER_HEIGHT = 'X'.
    ENDMODULE.                 " TRANS  OUTPUT
    *&      Module  USER_COMMAND_0500  INPUT
          text
    MODULE USER_COMMAND_0500 INPUT.
    CASE OK_CODE.
      WHEN 'BACK'.
        LEAVE TO SCREEN 0.
      WHEN 'CANCEL'.
        LEAVE TO SCREEN 0.
      WHEN 'EXIT'.
        LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0500  INPUT
    Hope this helps.

  • Doubt in alv grid

    Hi,
    i have developed a new program in which i have to display the material number, short text and long text in the ouput i had developed a program in which it was displaying the output for the material number having only long texts but i have to display the texts which was short text also. By executing the below program i'm getting the output for the values which are having only long texts but i have to display the output even if there is shor text also
    FORM GET_DATA.
    *To Fetch Data from Ekpo Table
    SELECT  WERKS MATNR FROM EKPO
    INTO CORRESPONDING   FIELDS OF  TABLE
                                   INT_EKPO
                                   WHERE
                                   EKPO~MATNR = S_MATNR AND
                                   EKPO~WERKS = S_WERKS.
    * sort int_ekpo by werks.
    delete  adjacent  duplicates  from INT_EKPO .
    *To Fetch Data from MAKT Table
    SELECT MATNR MAKTX FROM MAKT
    INTO CORRESPONDING   FIELDS OF  TABLE
                                     INT_MAKT
                                     FOR ALL ENTRIES IN INT_EKPO
                                     WHERE MAKT~MATNR = INT_EKPO-MATNR.
    loop at int_ekpo.
         read table int_MAKT with key matnr = INT_EKPO-MATNR.
                     int_OUT-MATNR  = INT_EKPO-MATNR.
                     INT_OUT-MAKTX  = INT_MAKT-MAKTX.
    ENDLOOP.
    **" Read text
          thread-tdname = INT_EKPO-MATNR.
          thread-tdid = 'BEST'.
          thread-tdobject = 'MATERIAL'.
                    CALL FUNCTION 'READ_TEXT'
                      EXPORTING
    *                   CLIENT                        = SY-MANDT
                        ID                            = thread-tdid
                        LANGUAGE                      = sy-langu
                        NAME                          = thread-tdname
                        OBJECT                        = thread-tdobject
    *                   ARCHIVE_HANDLE                = 0
    *                   LOCAL_CAT                     = ' '
    *                 IMPORTING
    *                   HEADER                        =
                      TABLES
                        LINES                         = it_tlines.
    LOOP AT it_tlines.
          IF sy-tabix <> 1.
                CLEAR :int_out-matnr, int_out-maktx.
          ENDIF.
                int_out-tdline = it_tlines-tdline.
          APPEND int_out.
    ENDLOOP.
              ENDFORM.
    ****ALV list definintion
    DATA: ws_cat TYPE slis_t_fieldcat_alv ,
          int_cat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          g_custom_container TYPE REF TO cl_gui_custom_container.
    FORM field_catalog.
    ***MATERIAL NO no
      int_cat-tabname       = 'INT_OUT'.
      int_cat-fieldname     = 'MATNR'.
      int_cat-reptext_ddic  = 'MATERIAL NO'.
      APPEND int_cat .
    *material Short Description
      int_cat-tabname       = 'INT_OUT'.
      int_cat-fieldname     = 'MAKTX'.
      int_cat-reptext_ddic  = 'MATERIAL SHORT DESCRIPTION'.
      APPEND int_cat .
    ** Material Long Description
      int_cat-tabname       = 'INT_OUT'.
      int_cat-fieldname     = 'TDLINE'.
      int_cat-reptext_ddic  = 'MATERIAL LONG DESCRIPTION'.
      int_cat-datatype = 'CHAR'.
      int_cat-outputlen = '100'.
        APPEND int_cat .
    endform.
    *&      Form  display_data
    *       text
    FORM display_data.
    data: new(15) TYPE N.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          it_fieldcat        = int_cat[]
        TABLES
          t_outtab           = int_out
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM.                    "display_data
    thanks in advance

    make the following corrections.
    loop at int_ekpo.
         read table int_MAKT with key matnr = INT_EKPO-MATNR.
    if sy-subrc = 0.
                     int_OUT-MATNR  = INT_EKPO-MATNR.
                     INT_OUT-MAKTX  = INT_MAKT-MAKTX.
    endif.
    **" Read text
          thread-tdname = INT_EKPO-MATNR.
          thread-tdid = 'BEST'.
          thread-tdobject = 'MATERIAL'.
                    CALL FUNCTION 'READ_TEXT'
                      EXPORTING
    *                   CLIENT                        = SY-MANDT
                        ID                            = thread-tdid
                        LANGUAGE                      = sy-langu
                        NAME                          = thread-tdname
                        OBJECT                        = thread-tdobject
    *                   ARCHIVE_HANDLE                = 0
    *                   LOCAL_CAT                     = ' '
    *                 IMPORTING
    *                   HEADER                        =
                      TABLES
                        LINES                         = it_tlines.
    clear thread.
    LOOP AT it_tlines.
    condense it_tlines-tdline.
    concatenate        int_out-tdline it_tlines-tdline into int_out-tdline separetd by space.
    ENDLOOP.
    refresh it_tlines.
    append int_out.
    clear int_out.
    endloop.
              ENDFORM.
    Regards,
    Ravi

  • Doubt in ALV Grid Control

    Hi Everyone,
    I am working on ALV Grid Control, where i am facing a problem with adding new buttons and writing the new code for the button, for placing the (display) button i used the method <b>handle_tool_bar</b>, But i want to know how to write the code for this particular button (display).
    Kindly give me the solution for this

    http://www.abap4.it/download/ALV.pdf
    Add the handle so we get user command control (ie Refresh)
    perform add_handle using 'USER_COMMAND' 'PAI_USER_COMMAND'.
    Colour and hotspot the project id column
    w_fieldcat-fieldname = 'PROJECT_ID'.
    w_fieldcat-emphasize = 'C400'.
    w_fieldcat-hotspot = 'X'.
    append w_fieldcat to t_fieldcat.
    Iconify and set the length of the icon column
    clear w_fieldcat.
    w_fieldcat-fieldname = 'ZEXCEPTION'.
    w_fieldcat-icon = 'X'.
    w_fieldcat-outputlen = g_light_length.
    append w_fieldcat to t_fieldcat.
    Intensify every other line, improves readability
    t_layout-zebra = 'X'.
    Set up an exit on the refresh event, so it gets passed back to us
    wa_event_exit-ucomm = '&REFRESH'. " Refresh
    wa_event_exit-after = 'X'.
    append wa_event_exit to t_event_exit.
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = 'ZGER_PROJECT_ID' " **CHANGE** !
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_structure_name = 'ZPROJECT_DATA'
    i_grid_title = 'Project list'
    it_event_exit = t_event_exit
    i_default = 'X'
    it_fieldcat = t_fieldcat
    is_layout = t_layout
    i_save = 'A'
    it_events = t_events
    tables
    t_outtab = t_main
    exceptions
    program_error = 1
    others = 2.

  • Hi, i have doubt in alv field cat log

    1)In alv field cat preparation (i dont want to display for one particular field in output screen) can u pls send me the code.
    2)in field cat for a particular field i want to display in different color for that can u send me code.
    3)code for (DOUBLE CLICK) event.
                for the can u send me a code
    Regards,
    Nagesh

    Hi Nagesh,
    I think you have posted your question in the wrong forum, this forum is for education related topics only.  Please review the existing forums and re-post it to the appropriate one.
    Regards,
    Simon

  • SIMPLE DOUBT IN ALV INTERACTIVE REPORTING

    HI EXPERETS,
    This is part of code in alv interactive reporting.
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
          PERFORM BUILD_FIELDCATLOG_EKPO.
          PERFORM EVENT_CALL_EKPO.
          PERFORM POPULATE_EVENT_EKPO.
          PERFORM DATA_RETRIEVAL_EKPO.
          PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
          PERFORM DISPLAY_ALV_EKPO.
      ENDCASE.
    ENDFORM.                    "user_command
    In This i didn't get wat's the meaning of    WHEN '&IC1'.What is
    actually &IC1 means.
    plz help me.
    Regards
    Suresh kumar

    HI
    PLZ REFER TO THIS
    *& Report  ZTESTDEMO_INTERACTIVE_LIST_2
    REPORT  ZTESTDEMO_INTERACTIVE_LIST_2.
    TABLES: MARA,MARC,MARD.
    * internal table itab_mara 3 fields matnr, ernam,mtart
    DATA: BEGIN OF ITAB_MARA OCCURS 0,
    MATNR LIKE MARA-MATNR,  " material number
    ERNAM LIKE MARA-ERNAM,  " name of person who create
    MTART LIKE MARA-MTART,  " Material Type
    END OF ITAB_MARA.
    * internal table itab_marc 3 fields matnr, werks,lvorm
    DATA: BEGIN OF ITAB_MARC OCCURS 0,
    MATNR LIKE MARC-MATNR,
    WERKS LIKE MARC-WERKS,  " Plant
    LVORM LIKE MARC-LVORM,  " Flag Material for Deletion at Plant Level
    END OF ITAB_MARC.
    * internal table itab_mard 2 fields
    DATA: BEGIN OF ITAB_MARD OCCURS 0,
    MATNR LIKE MARD-MATNR,
    LGORT LIKE MARD-LGORT,  " Storage Location
    END OF ITAB_MARD.
    SELECT-OPTIONS: S_MTART FOR MARA-MTART.
    INITIALIZATION.
    S_MTART-LOW = 'HALB'.
    S_MTART-HIGH = 'HAWA'.
    S_MTART-OPTION = 'BT'.
    APPEND S_MTART.
    START-OF-SELECTION.
    SELECT MATNR ERNAM MTART FROM MARA INTO TABLE ITAB_MARA WHERE MTART IN
    S_MTART.
    PERFORM DISPLAY.
    TOP-OF-PAGE.
    WRITE:/2(15) 'MATERIAL NO',20(20) 'CREATED BY',45(15) 'MATERIAL TYPE'.
    FORM DISPLAY.
    LOOP AT ITAB_MARA.
    WRITE:/ ITAB_MARA-MATNR UNDER 'MATERIAL NO' HOTSPOT ON,ITAB_MARA-ERNAM
    UNDER 'CREATED BY',ITAB_MARA-MTART UNDER 'MATERIAL TYPE'.
    HIDE: ITAB_MARA-MATNR.
    ENDLOOP.
    ENDFORM.
    AT LINE-SELECTION.
    CASE SY-LSIND.
    WHEN 1.
    SELECT MATNR WERKS LVORM FROM MARC INTO TABLE ITAB_MARC WHERE MATNR =
    ITAB_MARA-MATNR.
    PERFORM DISPLAY1.
    WHEN 2.
    SELECT MATNR LGORT FROM MARD INTO TABLE ITAB_MARD WHERE MATNR =
    ITAB_MARC-MATNR.
    PERFORM DISPLAY2.
    when 3.
    sy-lsind = 0.
    ENDCASE.
    FORM DISPLAY1.
    LOOP AT ITAB_MARC.
    WRITE:/ ITAB_MARC-MATNR HOTSPOT ON, ITAB_MARC-WERKS,ITAB_MARC-LVORM.
    HIDE: ITAB_MARC-MATNR.
    ENDLOOP.
    WRITE:/ SY-LSIND.
    ENDFORM.
    FORM DISPLAY2.
    LOOP AT ITAB_MARD.
    WRITE:/ ITAB_MARD-MATNR, ITAB_MARD-LGORT.
    ENDLOOP.
    WRITE:/ SY-LSIND.
    ENDFORM.
    regards
    ravish
    <b>plz dont forget to reward points if useful</b>

  • Basic Doubt in ALV grids

    All -
    I'm realtively new to ALV grid reporting.
    What should be done in order to not get the default setting like sorting,set filter screen Icons and the other icons in the report .
    Thanks in advance.

    You mean that you want to exclude those icons from the toolbar?  You can do it by using the exclude parameter.
    Here's how.   See the parts in bold, you can look at the other functions that can be execluded via SE24 in the attributes tab.  Check the attributes that start with MC_FC_
    REPORT ZRICH_0001.
    TABLES: MARA.
    DATA: BEGIN OF I_ALV OCCURS 0,
          MATNR TYPE MARA-MATNR,
          MAKTX TYPE MAKT-MAKTX,
          END OF I_ALV.
    *       CLASS cl_event_receiver DEFINITION      Handles Double Click
    CLASS CL_EVENT_RECEIVER DEFINITION.
      PUBLIC SECTION.
        METHODS HANDLE_DOUBLE_CLICK
          FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
          IMPORTING E_ROW E_COLUMN.
      PRIVATE SECTION.
    ENDCLASS.
    *       CLASS CL_EVENT_RECEIVER IMPLEMENTATION    Handles Double Click
    CLASS CL_EVENT_RECEIVER IMPLEMENTATION.
      METHOD HANDLE_DOUBLE_CLICK.
        PERFORM DRILL_DOWN USING E_ROW-INDEX.
      ENDMETHOD.
    ENDCLASS.
    DATA: ALV_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: EVENT_RECEIVER TYPE REF TO CL_EVENT_RECEIVER.
    DATA: ALV_GRID       TYPE REF TO CL_GUI_ALV_GRID.
    DATA: LAYOUT    TYPE LVC_S_LAYO.
    DATA: FIELDCAT  TYPE LVC_T_FCAT.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001 .
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      CALL SCREEN 100.
    *      Module  status_0100  OUTPUT
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '0100'.
      SET TITLEBAR '0100'.
      DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
      DATA: VARIANT TYPE  DISVARIANT.
      VARIANT-REPORT = SY-REPID.
      VARIANT-USERNAME = SY-UNAME.
    * Create Controls
      CREATE OBJECT ALV_CONTAINER
             EXPORTING
                   CONTAINER_NAME    = 'ALV_CONTAINER'.
      CREATE OBJECT ALV_GRID
             EXPORTING
                   I_PARENT          =  ALV_CONTAINER.
    *  Create Event Receiver
      CREATE OBJECT EVENT_RECEIVER.
    *  ALV Specific. Data selection.
    *  Populate Field Catalog
      PERFORM GET_FIELDCATALOG.
    <b>*   Optionally restrict generic functions to 'change only'.
    *   (The user shall not be able to add new lines).
      PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.</b>
      CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
               IS_LAYOUT              = LAYOUT
               IS_VARIANT             = VARIANT
               I_SAVE                 = 'U'
               I_STRUCTURE_NAME       = 'I_ALV'
    <b>           it_toolbar_excluding   = lt_exclude</b>
          CHANGING
               IT_OUTTAB       = I_ALV[]
               IT_FIELDCATALOG = FIELDCAT[].
    *   handler for ALV grid
      SET HANDLER EVENT_RECEIVER->HANDLE_DOUBLE_CLICK FOR ALV_GRID.
    ENDMODULE.
    *      Module  USER_COMMAND_0100  INPUT
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK' OR 'CANC'.
          IF NOT ALV_CONTAINER IS INITIAL.
            CALL METHOD ALV_CONTAINER->FREE.
            CLEAR: ALV_CONTAINER.
            FREE : ALV_CONTAINER.
          ENDIF.
          IF SY-SUBRC = 0.
            SET SCREEN 0.
            LEAVE SCREEN.
          ELSE.
            LEAVE PROGRAM.
          ENDIF.
        WHEN 'EXIT'.
          IF NOT ALV_CONTAINER IS INITIAL.
            CALL METHOD ALV_CONTAINER->FREE.
            CLEAR: ALV_CONTAINER.
            FREE : ALV_CONTAINER.
          ENDIF.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.
    * FORM GET_DATA
    FORM GET_DATA.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE I_ALV
            FROM MARA
              INNER JOIN MAKT
                ON MARA~MATNR = MAKT~MATNR
                   WHERE MARA~MATNR IN S_MATNR
                     AND MAKT~SPRAS = SY-LANGU.
      SORT I_ALV ASCENDING BY MATNR.
    ENDFORM.
    *      Form  Get_Fieldcatalog - Set Up Columns/Headers
    FORM GET_FIELDCATALOG.
      DATA: LS_FCAT TYPE LVC_S_FCAT.
      REFRESH: FIELDCAT.
      CLEAR: LS_FCAT.
      LS_FCAT-REPTEXT    = 'Material Number'.
      LS_FCAT-COLTEXT    = 'Material Number'.
      LS_FCAT-FIELDNAME  = 'MATNR'.
      LS_FCAT-REF_TABLE  = 'I_ALV'.
      LS_FCAT-OUTPUTLEN  = '18'.
      LS_FCAT-COL_POS    = 1.
      APPEND LS_FCAT TO FIELDCAT.
      CLEAR: LS_FCAT.
      LS_FCAT-REPTEXT    = 'Material Description'.
      LS_FCAT-COLTEXT    = 'Material Description'.
      LS_FCAT-FIELDNAME  = 'MAKTX'.
      LS_FCAT-REF_TABLE  = 'I_ALV'.
      LS_FCAT-OUTPUTLEN  = '40'.
      LS_FCAT-COL_POS    = 2.
      APPEND LS_FCAT TO FIELDCAT.
    ENDFORM.
    * DRILL_DOWN
    FORM DRILL_DOWN USING INDEX.
      READ TABLE I_ALV INDEX INDEX.
      IF SY-SUBRC = 0.
        SET PARAMETER ID 'MAT' FIELD I_ALV-MATNR.
        CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
        IF NOT ALV_CONTAINER IS INITIAL.
          CALL METHOD ALV_CONTAINER->FREE.
          CLEAR: ALV_CONTAINER.
          FREE : ALV_CONTAINER.
        ENDIF.
      ENDIF.
    ENDFORM.
    <b>***********************************************************************
    *      Form  EXCLUDE_TB_FUNCTIONS
    FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
    * Only allow to change data not to create new entries (exclude
    * generic functions).
      DATA LS_EXCLUDE TYPE UI_FUNC.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_SORT_ASC.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
      LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_SORT_DSC.
      APPEND LS_EXCLUDE TO PT_EXCLUDE.
    **  This excludes all buttons
    *  LS_EXCLUDE = '&EXCLALLFC'.
    *  APPEND LS_EXCLUDE TO PT_EXCLUDE.
    ENDFORM.</b>
    Regards,
    RIch Heilman

  • *bold* Doubt in alv

    Hi friends i am new to sap.
    I have a querry in alv.In this  report i only get 3 columns in the output [fname,dept and age] whereas location ,eid doesn't comes.i
    tried to increase the occurs 5 to 10 ,but it did't worked .
    Any suggestion please ??
    REPORT zalvreport .
    TABLES: zemp.
    DATA: BEGIN OF t_report OCCURS 5,
    name LIKE zemp-fname,
    age LIKE zemp-age,
    deprt LIKE zemp-dept,
    local LIKE zemp-location,
    empid like zemp-eid,
    END OF t_report.
    TYPE-POOLS: slis.
    DATA t_fcat TYPE slis_t_fieldcat_alv.
    DATA: d_repid LIKE sy-repid.
    SELECT-OPTIONS: s_name FOR zemp-fname .
    START-OF-SELECTION.
      SELECT * FROM zemp WHERE fname IN s_name.
        MOVE: zemp-fname TO t_report-name,
              zemp-age TO t_report-age,
              zemp-location to t_report-local,
              zemp-dept TO t_report-deprt,
              zemp-eid TO t_report-empid.
        APPEND t_report.
      ENDSELECT.
      IF sy-subrc NE 0.
        WRITE 'No data found'.
        EXIT.
      ENDIF.
      d_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name         = d_repid
                i_internal_tabname     = 'T_REPORT'
                i_inclname             = d_repid
             CHANGING
                ct_fieldcat            = t_fcat
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
      IF sy-subrc <> 0.
        WRITE: / 'Error:',sy-subrc,
        'when Create Field Catalog'.
        EXIT.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_callback_program = d_repid
                it_fieldcat        = t_fcat
           TABLES
                t_outtab           = t_report
           EXCEPTIONS
                program_error      = 1
                OTHERS             = 2.
      IF sy-subrc <> 0.
        WRITE: / 'Error:',sy-subrc,
        'when Call ALV List Display'.
        EXIT.
      ENDIF.

    hi lokesh
    here is some information for the FM   'REUSE_ALV_FIELDCATALOG_MERGE'
    Create field catalog from dictionary structure or internal table
    Supports the creation of the field catalog for the ALV function modules based either on a structure or table defined in the ABAP Data Dictionary, or a program-internal table.
    The program-internal table must either be in a TOP Include or its Include must be specified explicitly in the interface.
    The variant based on a program-internal table should only be used for rapid prototyping since the following restrictions apply:
    Performance is affected since the code of the table definition must always be read and interpreted at runtime.
    Dictionary references are only considered if the keywords LIKE or INCLUDE STRUCTURE (not TYPE) are used.
    If the field catalog contains more than 90 fields, the first 90 fields are output in the list by default whereas the remaining fields are only available in the field selection.
    If the field catalog is passed with values, they are merged with the 'automatically' found information.
    so it will be better for u if u create Field catalog manually as described above in this u have more hold of catalog creation
    Cheers
    Snehi Chouhan

  • Doubt in ALV componenet

    I am having 20 to 25 fields in my screen along with a table in between.
    if i use SALV_WD_TABLE component , whether  i can bring all those screen fields in my ALV output.
    if not possible with SALV_WD_TABLE then what i have to do .
    pls help me in this regard.

    Hi,
    I'm not sure if i understood your question correctly, but are you trying to add a new line to the table which contains the values of your input fields?
    If so, then try this:
    - Retrieve the data from the context node(s) that are connected to your input fields.
    - Retrieve the table which contains the data of your table.
    - Gather all the data from your input fields and add them to a structure which has the same line type as your table.
    - Add the new line to your table and bind this table to the context node that has a binding to your ALV.
    Good luck and regards,
    Jos

Maybe you are looking for

  • Laptop Blank/Blac​kscreen Issue

    Hello guys. I have a HP laptop Envy 17 3D. Yesterday As I was using it just browsing the internet, I went to shower when I came back to it about 15 mins later the screen was black you could see the white led but nothing on the screen. I turned it off

  • When I connect my iPod touch to my stereo, I cannot skip tracks using my iPod or the stereo controls.

    When I connect my iPod touch to my stereo, I cannot change tracks using the iPod or the stereo controls. I did not have this problem with my iPod nano. I have the software update 4.2.1 installed. Is it a problem with the software or the stereo? Pleas

  • Developer 6.0 Eap release

    Hi, The only Oracle product I have installed is the RDBMS on Solaris. I assume from the Developer documentation that I can install Developer on my NT box even though my server is on Solaris. When I run setup it begins to install some support files bu

  • Refresh Time to be reduced in 11G

    Hi Experts, Kindly provide your suggestions, We have a scenario where the reporting database is refreshed on a daily basis from the production. the apps team has requested us to do this activity post EOD backup. Please suggest the fastest method to e

  • Queries that can be performed in FI, CO, HR, MM, PP, SD

    Hi, Could any one please give me a list of queries that can be executed based on FI, CO, HR, MM, PP, SD.  I have an interview tomorrow and I have to be prepared with some list of queries/reports that are generated for each module. Thanks