2 Field Catalogues in ALV list

Hi All,
I want to have 2 headers in ALV list. So Can we have 2 field catalogue one after the other in a single ALV List. Where first header(row) gives title like "Previous 5 months " & 2nd header (row) gives sub title like " JAN  FEB  MAR  APR  MAY ".
& then the data flows into the columns from the table 't_outtab'.
Thank You ALL.

You can do this using ALV list with some extra coding..
But in other cases(Grid etc it is not possible).
cehck this image..
http://img100.imageshack.us/img100/3846/output6ef.th.gif
REPORT ZTEST_ALV message-id zz .
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT type slis_layout_alv,
x_events type slis_alv_event,
it_events type SLIS_T_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
MALE type i,
female type i,
END OF ITAB.
SELECT VBELN
POSNR
FROM VBAP
UP TO 20 ROWS
INTO TABLE ITAB.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'MALE'.
X_FIELDCAT-SELTEXT_L = 'MALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'FEMALE'.
X_FIELDCAT-SELTEXT_L = 'FEMALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
x_events-NAME = SLIS_EV_TOP_OF_PAGE.
x_events-FORM = 'TOP_OF_PAGE'.
APPEND x_events TO iT_EVENTS.
CLEAR x_events .
L_LAYOUT-NO_COLHEAD = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
it_events = it_events
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.
FORM TOP_OF_PAGE.
*-To display the headers for main list
FORMAT COLOR COL_HEADING.
WRITE: / SY-ULINE(103).
WRITE: / SY-VLINE,
(8) ' ' ,
SY-VLINE,
(8) ' ' ,
SY-VLINE,
(19) '***'(015) centered,
sy-vline.
WRITE: / SY-VLINE,
(8) 'VBELN'(013) ,
SY-VLINE,
(8) 'POSNR'(014) ,
SY-VLINE,
(8) 'MALE'(016) ,
sy-vline,
(8) 'FMALE'(017) ,
sy-vline.
FORMAT COLOR OFF.
ENDFORM.
or else go for Hierarchy Report.

Similar Messages

  • Field catalogue for ALV Grid when program is run in the background

    Hi All,
    I have an ALV report that contains approx 27 fields.  Not all of these fields will be relevant for different Users, and many will want to change the order the fields appear in.
    When running on line the User can set a variant to present the data as they wish.  However, I need to email this report to the SAP Inbox with the fields displayed in the same Order with uncessary fields hidden as stated in the Field Catalogue.
    On-line none of this is an issue, however GET_FRONTEND_FIELDCATALOG cannot be used in Background, and attribute MT_FIELDCAT_LOCAL is Private and cannot be accessed.
    I have looked at using Class CL_ ALV_VARIANT to try to read the Variant being used, but couldn't get the information about the Variant coming back, instead I get an error in CL_ALV_VARIANT->LOAD_VARIANT.
    Can anybody recommend how to the Field Cat for a Variant for background processing?
    Thanks,
    Tony.

    Hi.
    You can not use an ALV report in Background or write to spool because it is a kind of dialog program.
    You can write only  a List report to spool so please find others sulotions.
    Hope it helps.
    Sayan.

  • Unable to see field lable in alv list in Ztable contents ouput

    Hi Experts,
                         I m unable to see some of the field labels(few are displaying n few r not displaying) in ALV list (in user parameters)  whn i excute the table contents in an ztable in abap dictonary.
    regards
    harish

    Hi,
    maintain the column name in the fieldcat.
      gt_fieldcat_chld-fieldname = 'BAND'.  " mantion your field name
      gt_fieldcat_chld-scrtext_l = 'Band'.  " mention the description
      or you can use gt_fieldcat-COLTEXT = 'Band'.
      gt_fieldcat_chld-outputlen = 5.
      gt_fieldcat_chld-ref_field  = 'BAND'.
      gt_fieldcat_chld-ref_table = 'ZVP_ITM_QTY_BAND'.
      APPEND gt_fieldcat_chld.
    Let me know if this helps.
    Regards,
    Janaki

  • MR51 : add custom field in the alv list

    Dear.
    I need to add a custom field in the alv layout of MR51.
    Do you know any exit in order to obtain this ?
    Thanks.

    Hi,
    try this
    I think there is no exits for same
    copy program of MR51 and make z one and add filed what filed you want to add
    Regards
    kailas Ugale

  • How to read modifed data in ALV List

    Hi,
    I have one input enabled field in my ALV list.  User can modify the values of that field.  How i can get what are all the records are modified by the user.
    Thanks
    stallin

    Hi,
    Try this code...
    REPORT ZTEST_EDIT_ALV                             .
    *Data Declaration
    DATA: BEGIN OF T_EKKO,
      EBELN TYPE EKPO-EBELN,
      EBELP TYPE EKPO-EBELP,
    *  FLAG TYPE C,
    *  HANDLE_STYLE TYPE LVC_T_STYL,
    END OF T_EKKO.
      DATA: GD_REPID LIKE SY-REPID, "Exists
      REF_GRID TYPE REF TO CL_GUI_ALV_GRID. "new
    DATA: BEGIN OF IT_EKKO OCCURS 0.
            INCLUDE STRUCTURE T_EKKO.
    DATA: END OF IT_EKKO.
    DATA: BEGIN OF IT_BACKUP OCCURS 0.
            INCLUDE STRUCTURE T_EKKO.
    DATA: END OF IT_BACKUP.
    *ALV data declarations
    TYPE-POOLS: SLIS.                                 "ALV Declarations
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV.
    *Start-of-selection.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_LAYOUT.
      IT_BACKUP[] = IT_EKKO[].
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  build_fieldcatalog
    *       text
    FORM BUILD_FIELDCATALOG.
      REFRESH FIELDCATALOG.
      CLEAR FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'EBELN'.
      FIELDCATALOG-SELTEXT_M   = 'Purchase Order'.
      FIELDCATALOG-INPUT     = 'X'.
      FIELDCATALOG-EDIT     = 'X'.
      FIELDCATALOG-COL_POS     = 2.
      APPEND FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-FIELDNAME   = 'EBELP'.
      FIELDCATALOG-SELTEXT_M   = 'PO Item'.
      FIELDCATALOG-COL_POS     = 3.
      APPEND FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    FORM BUILD_LAYOUT.
      "Permet d'ajuster les colonnes au text
    *  gd_layout-colwidth_optimize = 'X'.
    *  GD_LAYOUT-TOTALS_TEXT       = 'Totals'(201).
    *  gd_layout-box_fieldname = 'SELECT'.
    *  gd_layout-box_tabname   = 'IT_EKKO'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    FORM DISPLAY_ALV_REPORT .
      GD_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM        = GD_REPID
    *            i_callback_top_of_page   = 'TOP-OF-PAGE'
                I_CALLBACK_PF_STATUS_SET  = 'SET_PF_STATUS'
                I_CALLBACK_USER_COMMAND   = 'USER_COMMAND'
    *            i_grid_title             = 'My Title'
                IS_LAYOUT                 = GD_LAYOUT
                IT_FIELDCAT               = FIELDCATALOG[]
           TABLES
                T_OUTTAB                  = IT_EKKO
           EXCEPTIONS
                PROGRAM_ERROR             = 1
                OTHERS                    = 2.
      IF SY-SUBRC <> 0.
        WRITE:/ SY-SUBRC.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM DATA_RETRIEVAL.
      SELECT EBELN EBELP
       UP TO 10 ROWS
        FROM EKPO
        INTO CORRESPONDING FIELDS OF TABLE  IT_EKKO.
    ENDFORM.                    " DATA_RETRIEVAL
    *                      FORM SET_PF_STATUS                              *
    FORM SET_PF_STATUS USING RT_EXTAB   TYPE  SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD_FULLSCREEN1' EXCLUDING RT_EXTAB.
    ENDFORM.                    "set_pf_status
    *&      Form  user_command
    *       text
    *      -->R_UCOMM    text
    *      -->RS_SELFIELDtext
    FORM USER_COMMAND  USING R_UCOMM LIKE SY-UCOMM
                             RS_SELFIELD TYPE SLIS_SELFIELD.
    *then insert the following code in your USER_COMMAND routine...
    <b> IF REF_GRID IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            E_GRID = REF_GRID.
      ENDIF.
      IF NOT REF_GRID IS INITIAL.
        CALL METHOD REF_GRID->CHECK_CHANGED_DATA
      ENDIF.</b>*modify
      CASE R_UCOMM.
        WHEN '&IC1'.
          CHECK RS_SELFIELD-TABINDEX > 0.
          IF RS_SELFIELD-VALUE EQ '6000000001'.
            CALL TRANSACTION 'ZTEST'.
          ENDIF.
        WHEN 'REFRESH'.
          READ TABLE IT_EKKO INDEX  RS_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            READ TABLE IT_BACKUP INDEX RS_SELFIELD-TABINDEX.
            IF SY-SUBRC = 0.
              IF IT_EKKO <> IT_BACKUP.
    *  then do your check
              ENDIF.
            ENDIF.
          ENDIF.
          PERFORM DATA_RETRIEVAL.
          RS_SELFIELD-REFRESH = 'X'.
      ENDCASE.
    ENDFORM.                    "user_command
    Regards
    vijay

  • How to change the ColumnName in the output of an ALV List

    ello Experts,
    Can you please let me know how can I change the column name of a field in an ALV List. For eg: I want to see the 'I_FIELDCAT-MATNR' field's name as 'ITEM NUMBER' in the output.
    Thanks for the help

    Hi Raj,
    Have a look at this file.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/eac1fa0b-0e01-0010-0990-8530de4908a6
    Reward if useful.
    Thanks
    Aneesh.

  • ALV list display is truncated though data is present in internal table

    hi
    There are total 108 columns in my internal table, but the ALV list display shows only 90 , the fieldcatalog and final ALV internal table has the same structure. Please let me know how to display the rest of the field
    Regards
    Monirul

    Hi.,
    ALV List Display will display max. 90 columns it depends on line size 1023., Some times it goes to dump in number of columns increases .,  and some times it displays some columns in one line and other columns in other line which  will not look gud.. better use ALV Grid or OO ALV with custom container .
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • F4 help in ALV list

    Hi.
    I have a problem with f4 help in alv list.
    There is a field in my alv list which have a domain. This domain has its own values in value range.
    I have found how to show f4 help according to system tables ( for example kunnr in kna1 ) but I need to show this value range values as f4 help in my alv list.
    Please help me.
    Thanks.

    hi
    try this example
    REPORT zoo_alvf4 .
    DATA : alvgrid TYPE REF TO cl_gui_alv_grid,
    custom_container TYPE REF TO cl_gui_custom_container,
    fieldcatalog TYPE lvc_t_fcat.
    table to contain fields that require f4...............................
    DATA : lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
    DATA : ok_code TYPE sy-ucomm.
    TABLES : zemployee_c7.
    TYPES : BEGIN OF ty_emp,
    empid LIKE zemployee_c7-empid,
    empname LIKE zemployee_c7-empname,
    END OF ty_emp.
    DATA : i_emp TYPE TABLE OF ty_emp.
    DATA : wa_emp TYPE ty_emp.
    SELECT-OPTIONS : s_empid FOR zemployee_c7-empid.
    CLASS lcl_event_handler DEFINITION.
    PUBLIC SECTION.
    METHODS :
    handle_on_f1 FOR EVENT onf1 OF cl_gui_alv_grid
    IMPORTING e_fieldname es_row_no er_event_data,
    handle_on_f4 for event onf4 of cl_gui_alv_grid
    importing e_fieldname es_row_no er_event_data
    ENDCLASS.
    CLASS lcl_event_handler IMPLEMENTATION.
    METHOD handle_on_f1.
    IF e_fieldname = 'EMPID'.
    CALL SCREEN 3001.
    ENDIF.
    to prevent processing of standard f1 help............................
    er_event_data->m_event_handled = 'X'.
    ENDMETHOD.
    Method handle_on_f4.
    endmethod.
    ENDCLASS.
    start of selection....................................................
    START-OF-SELECTION.
    SELECT empid empname FROM zemployee_c7
    INTO CORRESPONDING FIELDS OF TABLE i_emp
    WHERE empid IN s_empid.
    CALL SCREEN 3000.
    MODULE status_3000 OUTPUT.
    SET PF-STATUS 'ZTOOL'.
    SET TITLEBAR 'ZTITLE'.
    IF alvgrid IS INITIAL.
    CREATE OBJECT custom_container
    EXPORTING
    container_name = 'ZCONTAINER'.
    CREATE OBJECT alvgrid
    EXPORTING
    i_parent = custom_container.
    PERFORM prepare_f4.
    CALL METHOD alvgrid->register_f4_for_fields
    EXPORTING
    it_f4 = lt_f4[]
    creating instance for event handler..................................
    DATA : event_handler TYPE REF TO lcl_event_handler.
    CREATE OBJECT event_handler.
    SET HANDLER event_handler->handle_on_f1 FOR alvgrid.
    SET HANDLER event_handler->handle_on_f4 FOR alvgrid.
    preparing field catalog..............................................
    PERFORM prepare_fieldcatalog CHANGING fieldcatalog.
    CALL METHOD alvgrid->set_table_for_first_display
    EXPORTING
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    IS_LAYOUT =
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    CHANGING
    it_outtab = i_emp
    it_fieldcatalog = fieldcatalog
    IT_SORT =
    IT_FILTER =
    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.
    ENDIF.
    ENDMODULE. " STATUS_3000 OUTPUT
    preparing field catalog...............................................
    FORM prepare_fieldcatalog CHANGING i_fieldcatalog TYPE lvc_t_fcat.
    DATA : ls_fcat TYPE lvc_s_fcat.
    ls_fcat-fieldname = 'EMPID'.
    ls_fcat-ref_table = 'ZEMPLOYEE_C7'.
    ls_fcat-coltext = 'EMPLOYEE ID'.
    APPEND ls_fcat TO i_fieldcatalog.
    CLEAR ls_fcat.
    ls_fcat-fieldname = 'EMPNAME'.
    ls_fcat-ref_table = 'ZEMPLOYEE_C7'.
    ls_fcat-coltext = 'EMPLOYEE NAME'.
    APPEND ls_fcat TO i_fieldcatalog.
    ENDFORM.
    MODULE user_command_3000 INPUT.
    CASE ok_code.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_3000 INPUT
    MODULE user_command_3001 INPUT.
    CASE ok_code.
    WHEN 'SAVE'.
    LEAVE TO SCREEN 0.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_3001 INPUT
    MODULE status_3001 OUTPUT.
    SET PF-STATUS 'GUI'.
    SET TITLEBAR 'TITLE'.
    ENDMODULE. " STATUS_3001 OUTPUT
    preparing fields to be registered for f4 help.........................
    FORM prepare_f4.
    lt_f4-fieldname = 'EMPNAME'.
    lt_f4-register = 'X'.
    lt_f4-getbefore = 'X'.
    lt_f4-chngeafter = 'X'.
    APPEND lt_f4.
    ENDFORM.
    Regards

  • Export ALV List into Excel Sheet

    Hi Friends,
    We are displaying an ALV List in report Program and we are exporting that into excel sheet using the icon "Spreadsheet(ctrlshiftF7)"provided by ALV Grid.
    But when it is displayed in Excel sheet it changes the sequence of columns (fields).
    And we observed that it displays all the CHAR fields first then the CURRENCY fields and then the DATE fields that we specified in field catalog.
    So, what should be done so that the fields are exported into Excel in the same order as specified in the field catalog of ALV List.

    Give this a look.
    REPORT ZEXCEL .
    INCLUDE ole2incl.
    DATA: application TYPE ole2_object,
    workbook TYPE ole2_object,
    sheet TYPE ole2_object,
    cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256.
    DATA index TYPE i.
    DATA: BEGIN OF itab1 OCCURS 0, first_name(10), END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0, last_name(10), END OF itab2.
    DATA: BEGIN OF itab3 OCCURS 0, formula(50), END OF itab3.
    *START-OF-SELECTION
    START-OF-SELECTION.
    APPEND: 'Peter' TO itab1, 'Ivanov' TO itab2,
    '=Sheet1!A1 & " " & Sheet2!A1' TO itab3,
    'John' TO itab1, 'Smith' TO itab2,
    '=Sheet1!A2 & " " & Sheet2!A2' TO itab3.
    CREATE OBJECT application 'excel.application'.
    SET PROPERTY OF application 'visible' = 1.
    CALL METHOD OF application 'Workbooks' = workbook.
    CALL METHOD OF workbook 'Add'.
    Create first Excel Sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 1.
    CALL METHOD OF sheet 'Activate'.
    SET PROPERTY OF sheet 'Name' = 'Sheet1'.
    LOOP AT itab1.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Value' = itab1-first_name.
    ENDLOOP.
    Create second Excel sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 2.
    SET PROPERTY OF sheet 'Name' = 'Sheet2'.
    CALL METHOD OF sheet 'Activate'.
    LOOP AT itab2.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Value' = itab2-last_name.
    ENDLOOP.
    Create third Excel sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 3.
    SET PROPERTY OF sheet 'Name' = 'Sheet3'.
    CALL METHOD OF sheet 'Activate'.
    LOOP AT itab3.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Formula' = itab3-formula.
    SET PROPERTY OF cells 'Value' = itab3-formula.
    ENDLOOP.
    Save excel speadsheet to particular filename
    CALL METHOD OF sheet 'SaveAs'
    EXPORTING #1 = 'c:\temp\exceldoc1.xls' "filename
    #2 = 1. "fileFormat
    Closes excel window, data is lost if not saved
    SET PROPERTY OF application 'visible' = 0.

  • Editable field in alv list display

    i WANT TO GIVE COLOR FOR EDITABLE FIELD IN ALV LIST DISPLAY.i TRIED WITH EMPHASIZE IN FIELD CATALOGUE ASSIGNING.bUT,IT IS NOT WORKING.HOW TO DO.tHANX IN ADVANCE.........

    HI,
    Please refer the link below:
    http://www.****************/Tutorials/ALV/Edit/demo.htm
    http://www.****************/Tutorials/ALV/ColorSALV/Demo.htm
    Thanks,
    Sriram Ponna.

  • ALV List -  Field Catalog - Change Column width

    Hi Friends,
    I am using Alv list to display the output of a report program. I have generated the field catalog using REUSE_ALV_FIELDCATALOG_MERGE function and to display the alv REUSE_ALV_LIST_DISPLAY.
    My Internal table has few fields like "text1 type string". So after generating the Fieldcatalog from internal table i have changed the field description, but i don't know how to change the column output display width. I have tried by changing OUTPUTLEN parameter to 50 but in the output it is taking only 10 characters instead of 50 characters.
      How can i change the field length(FOR STRING TYPE) for output display ??
    Which parameter do i need to change in field catalog for String type fields..
    Regards,
    Raju.
    Message was edited by: Narayana Raju Sampathirao

    Hi narayana,
    1. the STRING type is causing the problem.
    2. what u can do is,
      (i suppose u are modifying the alv field catalogue)
       One workaround is :
       and it works fantastic !
    3.  BOLD is important.
        (this will take care of the length)
    LOOP AT alvfc INTO alvwa.
      IF alvwa-fieldname = 'A'.
        alvwa-outputlen = '100'.
    <b>    alvwa-inttype = 'CHAR'.</b>
        MODIFY alvfc FROM alvwa.
      ENDIF.
    ENDLOOP.
    4. To get a TASTE of what i m saying,
       just copy paste in new program :
    REPORT abc.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0,
           a TYPE string.
            INCLUDE STRUCTURE t001.
    DATA :  END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvwa TYPE slis_fieldcat_alv.
    Select
    SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT itab.
      itab-a = 'pppppppppppppppppppppp'.
      MODIFY itab.
    ENDLOOP.
    *-------  Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      CHANGING
        ct_fieldcat            = alvfc
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    LOOP AT alvfc INTO alvwa.
      IF alvwa-fieldname = 'A'.
        alvwa-outputlen = '100'.
        alvwa-inttype = 'CHAR'.
        MODIFY alvfc FROM alvwa.
      ENDIF.
    ENDLOOP.
    Display
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        it_fieldcat             = alvfc
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    regards,
    amit m.

  • Hi all   F4 on field in alv list

    hi all
    i would like to know how is it possible to give f4 help to a field in alv list.  this is field is input enable.
    if not in alv list, is it possible in alv grid.
    thanx
    rocky

    HI
    like this
    TYPES : BEGIN OF ST_OBJID_SH,
             OTYPE TYPE HRP1000-OTYPE,
             OBJID TYPE HRP1000-OBJID,
            END OF ST_OBJID_SH.
    DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
    DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
    ***********SELECTION SCREEN DESIGN***********************
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    *SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .
    SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .
    SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    **********END OF SELECTION SCREEN DESIGN*****************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
    IF S_OBJID IS NOT INITIAL.
        SELECT OTYPE OBJID FROM HRP1000
                     INTO TABLE IT_OBJID_SH
                     WHERE OTYPE = 'D'.
    IF SY-SUBRC EQ 0.
    SEARCH HELP FOR QUALIFICATION.
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
                 DDIC_STRUCTURE         = ' '
            RETFIELD               =  'OBJID'
                 PVALKEY                = ' '
           DYNPPROG               = SY-REPID
           DYNPNR                 = SY-DYNNR
           DYNPROFIELD            = 'S_OBJID'
                 STEPL                  = 0
                 WINDOW_TITLE           =
                 VALUE                  = ' '
           VALUE_ORG              = 'S'
                 MULTIPLE_CHOICE        = ' '
                 DISPLAY                = ' '
                 CALLBACK_PROGRAM       = ' '
                 CALLBACK_FORM          = ' '
                 MARK_TAB               =
               IMPORTING
                 USER_RESET             =
          TABLES
            VALUE_TAB              =  IT_OBJID_SH
                 FIELD_TAB              =
                 RETURN_TAB             = RETURN_TAB
                 DYNPFLD_MAPPING        =
               EXCEPTIONS
                 PARAMETER_ERROR        = 1
                 NO_VALUES_FOUND        = 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.

  • How to edit particular field in alv list display-urgent

    HI ALL,
    my requirement is i am displaying output using alv list display. now my rewuirement :
    i am displaying out in edit mode only. when user clicks one particular field
    for example record is like
    runrate a01 maheed  -> if user clicks on a01 this field should be editable. i have a following code
      w_field-edit = w_edit.
      w_field-input = 'X'.    -> using this code i can able to display entire colomn in edit mode. this not suits my requirement.anybody can send me the sample code please.
    thanks,
    maheedhar.t

    Can you please send me the sample code plz.
    i am sending my code below.
    type-pools : slis.
    tables : zuser_secobjects.
    data : t_header1 like zuser_secobjects.
    data : begin of it_secobjects occurs 0.
            include structure t_header1.
    data :   checkbox type c value 'X',
            action type c,
          end of it_secobjects.
    data : begin of it_secobjects1 occurs 0.
            include structure ZUSER_SECOBJECTS.
    data :   checkbox type c VALUE 'X',
          end of it_secobjects1.
    data : wa_ita like line of it_secobjects.
    data : i_field type slis_t_fieldcat_alv with header line.
    data : w_field like line of i_field.
    data : i_sort type slis_t_sortinfo_alv.
    data : w_sort like line of i_sort.
    data : it_filt1 type slis_t_filter_alv with header line.
    data:
    i_tabname type tabname,
    i_repid like sy-repid,
    is_lout type slis_layout_alv.
    data :   it_filt type slis_t_filter_alv   with header line,
             it_evts type slis_t_event        with header line.
    DATA : is_vari type disvariant.
    constants :   c_default_vari value 'X',
                  c_save_vari    value 'U',
                   c_checkfield type slis_fieldname     value 'ACTION',
                   c_f2code     type sy-ucomm           value '&ETA'.
    data : chk_box type slis_fieldname.
    selection-screen: begin of block b1 with frame title text-t01.
    parameters : p_appln type zuser_secobjects-appln.
    parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
    p_partnr type zuser_secobjects-appln_partner,
    p_ptype type zuser_secobjects-partner_type default '02',
    p_upostn type zuser_secobjects-user_position,
    p_sdate like likp-erdat default sy-datum,
    p_edate(10) default '12/31/9999',
    p_revnum type zuser_secobjects-revnum,
    p_cted type zuser_secobjects-created_by,
    p_cdate type zuser_secobjects-creation_date,
    p_ctime type zuser_secobjects-creation_time,
    p_chnby type zuser_secobjects-changed_by,
    p_cdate1 type zuser_secobjects-changed_date,
    p_ctime1 type zuser_secobjects-changed_time.
    selection-screen: end of block b1.
    form user_command using p_ucomm like sy-ucomm
    rs_selfield type slis_selfield.
      case p_ucomm.
        when 'SELECT_ALL'. " SELALL is the FCODE of ur push button
          loop at it_secobjects into wa_ita.
            wa_ita-checkbox = 'X'.
            modify it_secobjects from wa_ita.
          endloop.
      rs_selfield-refresh = 'X'.   "<-  ADD THIS
      when 'DESLCT_ALL'.
        loop at it_secobjects into wa_ita.
            wa_ita-checkbox = ' '.
            modify it_secobjects from wa_ita.
          endloop.
    rs_selfield-refresh = 'X'.   "<-  ADD THIS
       is_lout-f2code               = c_f2code.
       is_lout-box_fieldname        = c_checkfield.
       is_lout-get_selinfos         = 'X'.
       is_lout-detail_popup         = 'X'.
       is_lout-detail_initial_lines = 'X'.
    maheed-start.
    *when 'SAVE'.
    *LOOP AT IT_SECOBJECTS WHERE CHECKBOX = 'X'.
    MOVE-CORRESPONDING IT_SECOBJECTS TO IT_SECOBJECTS1.
    APPEND IT_SECOBJECTS1.
    CLEAR IT_SECOBJECTS1.
    DELETE IT_SECOBJECTS.
    *ENDLOOP.
    *DELETE ZUSER_SECOBJECTS FROM TABLE IT_SECOBJECTS1.
    WHEN 'DELETE'.
        loop at it_SECOBJECTS where checkbox eq 'X'.
            delete it_SECOBJECTS.
        endloop.
    *RS_SELFIELD-REFRESH = 'X'.
    maheed-end.
    maheed-start.  apr 13
    WHEN 'DELETE'.
    loop at it_SECOBJECTS where checkbox eq 'X'.
    MOVE-CORRESPONDING IT_SECOBJECTS TO IT_SECOBJECTS1.
    APPEND IT_SECOBJECTS1.
    delete it_SECOBJECTS.
    endloop.
    RS_SELFIELD-REFRESH = 'X'.
    when 'SAVE'.
    DELETE ZUSER_SECOBJECTS FROM TABLE IT_SECOBJECTS1.
    commit work.
    refresh :IT_SECOBJECTS1.
    maheed-end.    apr 13
    *when 'SAVE'.
    *LOOP AT IT_SECOBJECTS WHERE CHECKBOX = 'X'.
    MOVE-CORRESPONDING IT_SECOBJECTS TO IT_SECOBJECTS1.
    APPEND IT_SECOBJECTS1.
    CLEAR IT_SECOBJECTS1.
    DELETE IT_SECOBJECTS.
    *ENDLOOP.
    *DELETE ZUSER_SECOBJECTS FROM TABLE IT_SECOBJECTS1.
    ENDCASE.
    endform.
    *&      Form  delete
    form delete.
      data : begin of is_secobjects occurs 0.
              include structure zuser_secobjects.
      data : checkbox type c.
      data : end of is_secobjects.
      is_secobjects-checkbox = 'X'.
      modify is_secobjects
        from it_secobjects
        transporting checkbox
      where checkbox = 'X'.
    endform.
    *&      Form  get_data
    form get_data.
      select * from zuser_secobjects
      into table it_secobjects.
    endform.                    " get_data
    *&      Form  prepare_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form prepare_fieldcatalog." USING w_edit TYPE any.
    data : w_edit type c.
    clear w_edit.
      clear: w_field,i_field.
      refresh:i_field.
      i_field-key = 'X'.
      i_field-col_pos = 1.
      i_field-ddictxt = 'S'.
      i_field-seltext_s = '@11@'.
    i_field-checkbox = 'X'.
      i_field-input = 'X'.
      i_field-fieldname = 'HEADER'.
      i_field-outputlen = 0.
      append i_field.
      clear i_field.
      w_field-fieldname = 'APPLN'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-seltext_l = text-m01.
      w_field-outputlen = '10'.
      w_field-EDIT = 'X'.      "maheed
      w_field-col_pos = 1.
      append w_field to i_field.
      clear w_field.
      w_field-fieldname = 'APPLN_USER'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-just = 'C'.
      w_field-seltext_l = text-m02.
      w_field-outputlen = '7'.
      w_field-col_pos = 2.
      append w_field to i_field.
      clear w_field.
      w_field-fieldname = 'APPLN_PARTNER'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-just = 'C'.
      w_field-seltext_l = text-m03.
      w_field-edit = w_edit.
      w_field-input = 'X'.
      w_field-outputlen = '7'.
      w_field-col_pos = 2.
      append w_field to i_field.
      clear w_field.
      w_field-fieldname = 'INACTIVE'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-just = 'C'.
      w_field-seltext_l = text-m02.
      w_field-outputlen = '7'.
      w_field-col_pos = 3.
      append w_field to i_field.
      clear w_field.
    endform.                    " prepare_fieldcatalog
    *&      Form  ALV_LIST_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form alv_list_display.
    DATA : LC_GLAY TYPE LVC_S_GLAY.
    LC_GLAY-EDT_CLL_CB = 'X'.
      i_repid = sy-repid.
      is_lout-box_fieldname = 'CHECKBOX'.
      it_filt-fieldname = 'ACTION'.
      call function 'REUSE_ALV_LIST_DISPLAY'
           exporting
                i_callback_program       = i_repid
                i_callback_pf_status_set = 'PF_STATUS_SET'
                i_callback_user_command  = 'USER_COMMAND'
                is_layout                = is_lout
                it_fieldcat              = i_field[]
                it_filter                = it_filt[]
                 it_events                = it_evts[]
                i_default                = c_default_vari
                i_save                   = c_save_vari
                is_variant               = is_vari
           tables
                t_outtab                 = it_secobjects.
    endform.                    " ALV_LIST_DISPLAY
    *&      Form  display
          text
         -->P_I_OBJECT  text
    form display using    object.
      case object.
    ENDCASE.
    endform.                    " display
    thanks,
    maheedhar.t

  • EDIT FIELD IN ALV LIST

    HI,
    WA_FIELDCAT-COL_POS = 4.
      WA_FIELDCAT-TABNAME = 'GT_OUT'.
      WA_FIELDCAT-FIELDNAME = 'DATAINS2'.
      WA_FIELDCAT-SELTEXT_M = 'POD'.
      WA_FIELDCAT-EDIT = 'X'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-EDIT = 'X'.
    I USED THIS ONE BUT IAM GETTING SYNERROR  WA_FIELDCAT DONT HAVE THIS COMPONENT.

    Refer to this related thread
    Re: how to edit particular field in alv list display-urgent

  • Time field in alv list

    Hi all ,
    i want to display alv list with time field . if no data exists in that field its showing 00:00:00 , i have to show it blank. if i change time field as type c in my internal table its showing like this 121314, i need to display it 12:13:14 . if no data it should display balnk . can any one help me out to reslove this issue?

    Hi priya,
    do this:
    declare in your itab a field like sy-uzeit.
    as example.
    move sy-uzeit to itab-uzeit.
    In fieldcat do this:
        MOVE  'X'                        TO   WA_FIELDCAT-NO_ZERO.
    Hope it helps.
    regards, Dieter

Maybe you are looking for

  • Confirmation of a production order

    Hello, I have a question regarding the confirmation of a production order. Is it possible to confirm part of a production order into a temporary special stock in 4.6b? The reason is that we have to perform inspection before posting it into final unre

  • Extraction:scripts of objects in database to a FILE

    Hello .... I m extracting the codes of objects(procedures,packages....) its working fine ...but for some objects its not entirely writing the lines from source say for one objects if there are 1000 lines its writing only 700 lines... declare v_handle

  • Missing BIOS 26.4 file for MSI H97M ECO motherboard

    The BIOS 26.4 file seems to be missing from the download page for the MSI H97M ECO motherboard - I get an error when clicking on the link in the UK download site. I have installed the 26.3 file instead and I am getting very strange fan rpm on the ECO

  • FCP export using compressor

    does anybody know where the jobs compressor submits get stored? I can't export via compressor out of FCP 6.1, (FCP quits responding) but if I export a quicktime then get that in compressor using a quemaster quick cluster, it rocks along fine until I

  • How can I Purchase Lotus Notes (IBM) for MacBook Air?

    Dear Friends, Can you help me, Please guide me to Purchase Lotus Notes Software (IBM) for my MBA. Thx Dodijp