ALV Grid: Alternate Field Catalog per Line Type possible?

I'm using the ALV Grid Classes: Is it possible to change the Field Catalog per line type? I have two different line types: 1) Interspersed headers and 2) data lines. The Interspersed headers should have no_zero = 'x' and the data lines no_zero = space.

It can be done by REUSE_ALV_HIERSEQ_LIST_DISPLAY in classic ALV .
Alternately, it can be done by ALV object model. Try SALV* and look into sample programs.

Similar Messages

  • ALV Grid Control -- Field Catalog

    Hi ,
      In the filed catalog for ALV grid control ( LVC_T_FCAT) ,there is a field called CHECKTABLE , can i use this to validate the value entered in that cell of a editable ALV.
    If yes then what are the perquisites of using it.
    Regards
    Arun

    Hi Arun,
    look the help.sap.com documentation, all the field of the field catalog are describe and explain.
    Regards
    Frédéric

  • Reg. can we display alv grid using field groups (extracts)

    Hi,
    can we display alv grid using field groups (extracts). is this possible. i have to develop a blocked alv.
    tnks
    Yerukala Setty

    No, you will need the data in an internal table to use ALV.
    Cheers
    Allan

  • ALV program with Field Catalog

    Hi ,
    Can any body please provide me sample ALV programs with Field Catalog and GRID DISPLAY. and also please give me the steps for writing the program.
    Thanks in advance.
    KP

    Hi,
    For ALV GRID DISPLAY (using <b>OOPS</b>),
    1)Create an object of the <b>container</b>(an instance of a class like cl_gui_custom_container).
    2)Create an object of the <b>ALV using class cl_gui_alv_grid</b> and give the CONTAINER name that you define in your screen layout as the parent of the ALV.
    3)Call the method <b>SET_TABLE_FOR_FIRST_DISPLAY</b> of the class cl_gui_alv_grid.
    4)<b>Field catalog</b> is used when you want a variation of the standard structure to be displayed on your ALV.A  variable of table type <b>LVC_T_FCAT</b> is defined and variations can be made as per the requirements.The variable is then passed in the method SET_TABLE_FOR_FIRST_DISPLAY.
    <b>A SAMPLE PROGRAM:</b>
    REPORT SAMPLE:
    *-- GLOBAL DATA DECLARATIONS FOR ALV
    <b>DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.</b>
    DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV'.
    <b>DATA gr_ccontainer TYPE REF TO cl_gui_custom_container.</b>
    DATA gt_fieldcat TYPE lvc_t_fcat.
    Data:i_spfli type table of spfli.
    *The value CC_ALV is given to the custom container in the screen layout
    START-OF-SELECTION.
    select * from spfli into table i_spfli.
    Call screen 100.
    MODULE STATUS_0100 OUTPUT
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    *Create container
    <b>CREATE OBJECT gr_ccontainer
    EXPORTING container_name = gc_custom_control_name.</b>
    *Create ALV
    <b>CREATE OBJECT gr_alvgrid
    EXPORTING i_parent = gr_ccontainer.</b>
    *field catalog
    <b>PERFORM prepare_field_catalog CHANGING gt_fieldcat.</b>
    *to display the ALV
    <b>CALL METHOD gr_alvgrid->set_table_for_first_display</b>
    EXPORTING
      I_STRUCTURE_NAME              = 'SPFLI'
    CHANGING
    it_outtab = i_spfli[]
    it_fieldcatalog = gt_fieldcat.
    ENDMODULE.                    "display_alv OUTPUT
    MODULE USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
    IF sy-ucomm = 'BACK' OR
         sy-ucomm = 'EXIT' OR
         sy-ucomm = 'CANCEL'.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.
    *& Form prepare_field_catalog
    FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
    DATA ls_fcat TYPE lvc_s_fcat.
    ls_fcat-ref_table = 'SPFLI'.
    ls_fcat-fieldname = 'CARRID'.
    APPEND ls_fcat TO pt_fieldcat.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'CONNID'.
    ls_fcat-ref_table = 'SPFLI'.
    APPEND ls_fcat TO pt_fieldcat.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'DEPTIME'.
    ls_fcat-ref_table = 'SPFLI'.
    APPEND ls_fcat TO pt_fieldcat.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'ARRTIME'.
    ls_fcat-ref_table = 'SPFLI'.
    APPEND ls_fcat TO pt_fieldcat.
    CLEAR ls_fcat.
    endform.
    <b>For more sample programs refer:</b>http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm
    http://www.sapdevelopment.co.uk/reporting/alvhome.htm
    <b>-->download the PDF from following link.</b>
    www.abap4.it/download/ALV.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    <b>Some more:</b>
    http://www.sap-hefte.de/download/dateien/1025/087_leseprobe.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    http://www.alvgmbh.de/dwnload/gonio_t.pdfhttp://
    <b>You can get all demo programs for ALV:</b>Go to se38 and type BCALV* and press F4 for all demo porgrams.
    Regards,
    Beejal
    **Reward if this helps

  • Drill down capabilities for an alv grid display field using oops concept

    Hi All,
    could anyone help me in how to achieve the drill down capabilities for an alv grid display field using oops concept.
    Thanks & Regards,
    padmasri.

    padmasri,
    Hope your requirement is something like, when you click on a sales order number it should display that order (VA03), in a grid output displayed using set_table_for_first_display.
    you can acheive it using event double click.
    *&            L O C A L  C L A S S E S   -   D E F I N I T O N         *
    class lcl_event_receiver: local class to handle event DOUBLE_CLICK
    CLASS LCL_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.                    "lcl_event_receiver DEFINITION
    *&    L O C A L  C L A S S E S   -   I M P L E M E N T A T I O N       *
    CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
      METHOD HANDLE_DOUBLE_CLICK.
        PERFORM HANDLE_DOUBLE_CLICK USING E_ROW
                                          E_COLUMN.
      ENDMETHOD.                           "handle_double_click
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    FORM HANDLE_DOUBLE_CLICK USING E_ROW    TYPE LVC_S_ROW
                                   E_COLUMN TYPE LVC_S_COL.
      DATA: LS_DETAIL LIKE LINE OF T_OUTPUT.
          WHEN 'T_OUTPUT'.
            READ TABLE T_OUTPUT   INDEX E_ROW-INDEX INTO LS_DETAIL.
    If clicked on PO Number or PO Item, call ME23
        IF E_COLUMN-FIELDNAME = 'EBELN' OR
           E_COLUMN-FIELDNAME = 'EBELP' .
          SET PARAMETER ID 'BES' FIELD LS_DETAIL-EBELN.
          SET PARAMETER ID 'BSP' FIELD LS_DETAIL-EBELP.
          CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
    If clicked on sales order number or item, call VA03
        ELSEIF E_COLUMN-FIELDNAME = 'VBELN' OR
               E_COLUMN-FIELDNAME = 'POSNR'.
          SET PARAMETER ID 'AUN' FIELD LS_DETAIL-VBELN.
          SET PARAMETER ID 'APO' FIELD LS_DETAIL-POSNR.
          CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
    Hope this helps

  • Append list values under Field selection per Mvt type (MIGO)

    Hi Experts,
    Can we append list of values for u2018Field Nameu2019 in case of Setting for goods movement (MIGO), under Field selection per Mvt type. We want to append values for 101 Mvt type.
    Current values are
    CUSTNAME Customer
    EXVKW Sales Value
    GRUND Reason for Movement
    LIFNR Vendor
    SGTXT Text
    WEANZ Number of GR Slips
    WEMPF Goods recipient
    Regards,
    Praful Mankar

    Hi pafulmankar
    If you find the solution, please share with me. I do have the same requirement
    Thanks

  • ALV Tree in Field Catalog

    Hi ,
    Can we create ALV tree in Field catalog and expand output table depending on the click on tree.
    Regards,
      Satya

    Did you look at SLIS Dev. Class.
    There are many samples in ALV.
    ibrahim

  • Field selection per movement type

    Hi,
    Vendor is an optional entry for 201 movement type. I've checked it from
    SPRO->Materials Management->Settings for Enjoy Transactions->Settings for Goods Movements (MIGO)->Field Selection per Mvt Type
    and it seems to be an optional entry thus its not asking vendor in MIGO, but when I go to MB1A tcode, there seems the vendor is required. How could I change that? Is there a special transaction for MB1A's field selection?
    Thank you
    Irem

    Hi
    You need to check if any screen variant has been activated fot the Trnsaction MB1B.
    Using screen variants also we can activate such checks.
    Check in transaction SHD0.
    Here enter the transaction code and check the screen variant that is active.
    Thanks & Regards
    KK

  • How to disable a button on ALV grid that was enabled per user action?

    In an editable ALV grid, per entry in one of the fields , a button is eanbled in a field next to it.
    This is written in the event onF4. (not all the lines are shown here).
                ls_f4-fieldname = 'TEXT1''.
                ls_f4-row_id    = es_row_no-row_id.
                ls_f4-value     = icon_create_text.
                ls_f4-error     = space.
                ls_f4-tabix     = space.
                IF ls_return-fieldval EQ 'AB'.
                  ls_f4-style     = cl_gui_alv_grid=>mc_style_button.
                ELSE.
    *Now when Field1 = 'CD'.
    *the button in field2 should disappear.   
                 ls_f4-value     = space.
                  ls_f4-style     = space.
                ENDIF.
                ls_f4-style2    = space.
                ls_f4-style3    = space.
                ls_f4-style4    = space.
                APPEND ls_f4 TO <t_f4>.
    This is not happening.
    Please advise.
    Thanks,
    Ven

    example
           wa_celltab-fieldname = 'VBELN'.
          wa_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
          INSERT wa_celltab INTO TABLE itab-celltab.

  • ALV Grid - mark fields as changed

    I have an editable ALV grid, and when the user changes field values then the data_changed event is called correctly so I can validate the changes.
    I am now implementing an upload method which replaces the values in the data table.  The problem is that the control does not recognise the lines as new or changed, so does not do any checking on them or pass to the data_changed event. 
    I can use method if_cached_prop~set_prop ( propname  = 'GridModified'           propvalue = '1' )
    to set the grid modified flag, but  get_modified_cells returns an empty table so there are no fields passed to my data_changed implementation.
    I think I could use method CHANGE_DATA_FROM_INSIDE to set the new values.  However, it is marked as internal only, and it will be very tedious to fill the tables...
    Is there any way to flag fields as changed?
    Alternatively, if I do my checks in my upload method, is there a way to add messages to the output log? 
    Thanks
    Michael

    I have worked out a solution.
    I can use method CHANGE_DATA_FROM_INSIDE, and as long as layout-val_data = 'X' then the data_changed method is called to do validations.  However, the data in fields with errors is deleted...
    My alternative solution is to store the uploaded values and when checking the data, put the uploaded values manually into er_data_changed->mt_good_cells.  The trick is to manually set the grid status to modified, so that the data_changed handler implementation is called - this is done with METHOD gr_grid_0200->if_cached_prop~set_prop.
    The ALV grid data is in <outtab> which has all fields of <outtab> plus a few extras
    I upload from file into <data_table>.
        data:
          ls_mod_cell     type LVC_S_MODI.
    *     Add correct tabix and celltab fields.
          refresh <outtab>.
          clear <gs_outtab>.
    *     Move to outtab structure and put into grid table
          loop at <data_table> assigning <data>.
            move-corresponding <data> to <gs_outtab>.
            insert <gs_outtab> into table <outtab>.
    *       Store the field data for validations
            ls_mod_cell-row_id = sy-tabix.
            ls_mod_cell-tabix = sy-tabix.
            ls_mod_cell-SUB_ROW_ID = fl_uploaded.
            LOOP AT gt_fieldcat_0200 ASSIGNING <fcat>
                    where tech = '' and no_out = ' '.
              ls_mod_cell-fieldname = <fcat>-fieldname.
              assign component <fcat>-fieldname of structure <data> to <value>.
              if sy-subrc = 0.
                ls_mod_cell-value = <value>.
                insert ls_mod_cell into table t_mod_cells.
              endif.
            Endloop.
          endloop.
    *     Update the table display.  This resets the internal version of the data table.
          CALL METHOD gr_grid_0200->refresh_table_display.
    *     Force the GridModified flag to on
          CALL METHOD gr_grid_0200->if_cached_prop~set_prop
            EXPORTING
              propname           = 'GridModified'
              propvalue          = '1'
            EXCEPTIONS
              others             = 0              .
    In the local method for handle_data_changed, I can then use the stored data
    *   When importing data from file, the fields are not checked
    *   Add uploaded values to the data_changed tables
    *   (First remove any fields which have been subsequently changed by the user)
        if t_mod_cells is not initial.
          loop at er_data_changed->mt_mod_cells into ls_mod_cell.
            delete t_mod_cells
                   where row_id    = ls_mod_cell-row_id
                   and   fieldname = ls_mod_cell-fieldname.
          endloop.
          insert lines of t_mod_cells into table er_data_changed->mt_good_cells.
          insert lines of t_mod_cells into table er_data_changed->mt_mod_cells.
        endif.
       ....  Validation code ...
    *   Remove uploaded fields.  Otherwise any without error will blank out the value in the grid...
        delete er_data_changed->mt_good_cells where SUB_ROW_ID = fl_uploaded.
        delete er_data_changed->mt_mod_cells where SUB_ROW_ID = fl_uploaded.
    *   If no errors, remove uploaded data
        if error_in_data EQ space.
          clear t_mod_cells.
        endif.

  • ALV Grid - Printnig field names.

    Hi Gurus,
    I have a requirement for a report which has the format for display as shown below.
    Sr. No | Mat No. |  Material grp | some material types | COLUMN HEADINGS
    |*********|*************** | 10g | 20g | 30g | 40g | COLUMN HEADINGS
    000001 |xyz*****|ABCDEFGHIJ | 005 | 0004| 002 | 003 | From this data start
    As u can see, there is two level fields description printing... We can do it in List,
    I want to know whether we can achieve it using ALV.  
    As shown above, field column "some material types" having sub types as 10g, 20g, 30g and 40g.  So I want one column to be split into four or five columns.
    *Points will be granted.
    Regards,
    Shailesh.

    Hi Shailesh,
    The short answer is no, you cannot.
    It would not make sense to do such a thing, anyway.  After all, "some material types" is there as a heading for a group of four columns, but using the usual ALV-grid functionality, the user would be able, for instance, to move the 30g column to the left of the Mat No column, say.
    The requirement may make sense in an ABAP list, where the columns are fixed, but not in an ALV, where the columns can be moved.
    They will have to change the requirement!
    John

  • Radio button in ALV without using field catalog

    Hi All,
    My requirement is i want to create a RFC function module to display the header table.
    while executing the function module the output is of alv grid format.
    i have used the structure for this.
    i didnt create a layout and fieldcatalog.
    now i need to add a radio button in that alv grid display.
    how to create the radio button without using field catalog.
    Thank in Advance.

    Hi Aishwarya,
    You need to use the field catalog for displaying a field as a radio button in ALV grid.
    Please refer to this link for doing so. [Radio buttons in ALV Grid|http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-RadioButtonsinALVGRIDREPORT]
    You can use LVC_FIELDCATALOG_MERGE wherein you can use your structure and the Icon for Radiobutton.
    Refer to this link -[Radiobuttons in ALV Grid 2|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02535ce-9eaf-2910-ae8c-f2f2afc1c8e7?quicklink=index&overridelayout=true]
    Best Regards,
    Sharmila
    Edited by: Sharmila Subramanian on Mar 18, 2011 12:34 PM

  • Alv with out field catalog

    Hi experts,
    Is it possible to display ALV report with out using field catalog ? If yes please tell me how .
    Thanks,
    Usha

    Hi ,
    use the FM  'REUSE_ALV_FIELDCATALOG_MERGE'
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = SY-REPID
       I_INTERNAL_TABNAME           = 'T_KNA1'
       I_STRUCTURE_NAME             = 'KNA1'
      I_CLIENT_NEVER_DISPLAY       = 'X'
       I_INCLNAME                   = SY-REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = T_FCAT1
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
      OTHERS                       = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Vijay

  • Alv grid mandatory field.

    hi...
    I have a ALV grid  that is displayed ... i fill up the entries in this and then save them.
    i need to declare  some fields as mandatory
    how shall i do it
    thanks

    Hi,
    Check the fieldcatalog, if there is any option .. I don;t think we have option for it..
    Other wise u have to take care in ur program by checking if there is any value entered in the field , if not throw error message , something like this..
    This iam telling reagrding by using FM REUSE_ALV_GRID_DISPLAY..
    Regards,
    Nagaraj

  • Overview fields used per document type in MM and FI

    Hello All,
    iIs there a possibility to get an overview of all fields used (mandatory, optional etc.) for each document type in MM and FI? I want to create a list which fields per document type are used in both MM and FI and which are only used in MM or FI.
    Thanks in advance for answers!

    Hi,
    You can point out all the fields with
    1) At the time of defining Screen lay out for purchasing (NBF) in MM for GR-IR Control.
    2) or you can tally which tables are conjugated with MSEG from SE11.
    Might this will clear you.
    regards,
    Ninad

Maybe you are looking for

  • Is there a way to rotate images in iPhoto on the ipad

    I take photos with the iPhone or iPad and unless I sync them back to the Mac, there does not seem to be a way to rotate images. This makes having a nice slideshow (for the unlock screen) a problem as a bunch of images are all sideways. I'd like to be

  • Gmail server problem on macbook pro - os x

    I keep getting a server delivery error on my gmail.  I receive emails but I have problem sending - especially emails with attachments, they do not even load ! My airport shows looking for networks so is it a network problem ? Hotmail and all other we

  • Discussion on load-balance and load-sharing

    Hi, I found a article, which discuss the difference between load-balance and load-sharing. I think the explanation is pretty good, please see below. But I still have a question: how can we decide to choose one the both balance in the production envir

  • Using Broadcasting IP to save a File

    I need to save a file to all the computers on a network. I do not know how many computers there are but I do know that their IP's are all in some constant range. I cant put a client on these computers to transfer to. Ive tryed some tests with using f

  • Find out use of tables.

    Hi I've been asked to list all the tables that a third party application use when it runs a process. How could I find out that? Thanks in advance.