Changeable records on column in ALV LIST

Hi,
i want to change my records on alv list. I mean records look like parameters in alv list. But i dont know the code about this .  I think i need to find code in slis_t_fieldcat_alv but i cant find it. If you can fix my problem i will be pleased.
Regards.

Hi You need to use STYLE attribute of layout & EDIT attribute of Fieldcatalog to do this.
Please refer the code snippet below :-
  wa_fieldcat-fieldname   = 'NETPR'.
  wa_fieldcat-scrtext_m   = 'Net Price'.
  wa_fieldcat-edit        = 'X'. "sets whole column to be editable
  wa_fieldcat-col_pos     = 7.
  wa_fieldcat-outputlen   = 15.
  wa_fieldcat-datatype     = 'CURR'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR  wa_fieldcat.
Please search in SCN before you post such questions, you will get a lot of code snippets demonstarting the same.
Regards
Abhii

Similar Messages

  • Dynamically assign value to a column in ALV LIST Display

    Hi all,
    How can I dynamically assign value to a column in ALV LIST Display without using classes and methods?
    Thanks,
    Ridhima

    Hi Vikranth,
    I am displaying one ALV list say with columns A and B.
    I have value in A but not in B. Now at runtime user selects one row, clicks on push button in application toolbar, then i have to display value in column B in the already displayed list.
    I searched and came to know it can be done with oops concept. but i am not using classes and methods.
    so how can i do this?
    Thanks,
    Ridhima.

  • Icon and text together in one column in alv list

    Hello Everyone,
    I want to display icon and text together in one column in ALV list.
    I am using reuse_alv_grid_display function module.
    Currently, i am able to see icon only in the column but i want to see both icon and text in one column in ALV.
    Please let me know if this scenario is possible in ALV and how.
    Thanks in advance.
    Regards, Tarun

    Hi,
    Check this code....
    REPORT  ZTEST_ALV_CHECK     MESSAGE-ID ZZ           .
    TYPE-POOLS: SLIS,icon.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT TYPE SLIS_LAYOUT_ALV/
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          POSNR LIKE VBAP-POSNR,
          ICON(1),
         END OF ITAB.
    SELECT VBELN
           POSNR
           FROM VBAP
           UP TO 20 ROWS
           INTO TABLE ITAB.
    loop at itab.
    if sy-tabix = 1 or sy-tabix = 2.
    itab-icon = '1'.
    elseif sy-tabix = 10 or sy-tabix = 20.
    itab-icon = '2'.
    else.
    itab-icon = '3'.
    endif.
    modify itab index sy-tabix.
    endloop.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-HOTSPOT = 'X'.
    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.
    L_LAYOUT-lights_fieldname = 'ICON'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        IS_LAYOUT                = L_LAYOUT
        IT_FIELDCAT              = IT_FIELDCAT
      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.
    Regards
    vijay

  • How to hide ,unhide columns  in ALV List

    Hi all,
    How to hide ,unhide columns  in ALV List..
    Plz guide me.
    Thanks in advance..
    Albert

    Hi Joseph,
    Check the following thread:
    Hide Unhide columns of ALV grid Report.
    Regards,
    Archana

  • Doubt in hiding columns in ALV list

    Hi Experts ,
                          I am working on block ALV list . I need to hide certain columns  in the list based on condition . For example : ALV structure has fields such MATNR    MEINS    MBRSH   MTART
    For a particular material if  ITAB-MEINS EQ C_SPACE . Then the column - MEINS should be hidden for particular material record.
    Could anyone suggest me code for this logic .
    Thanks ,
    Kumaran.C

    Hi Rajnesh ,
                           Thanks for that reply , But one doubt .
    Should we have to loop the ITAB before creating the feildcatalog ?
    say for ex :
    loop at itab.
    if itab-meins eq c_space.
      fieldcatalog-fieldname = 'MEINS'.
      fieldcatalog-selfield_m = 'UOM'.
      fieldcatalog-col_pos    = 3.
      fieldcatalog-no_out     = 'MEINS'.
    append fieldcatalog from fieldcatalog.
    end if.
    endloop.
    is this the way to code the above logic , pls explain .
    Thanks,
    Kumaran.C

  • How to download specified columns from ALV list

    Hi,
      I am executing a ALV List. After execution from list of columns i choose some columns remaining will be hide.
    But now I want to Download only those visible columns from my report. If any solution Please....
    Regards,
    venkat

    Hi,
      Here my requirement is to download it to application server. For download functionality I have created one button in the Menu.
    Regards,
    venkat

  • Hide columns for ALV list output in SAP Query SQ01/SQ02

    Hi All,
    I have a requirement to hide the columns which are empty in sap query SQ01 alv list output.
    Please let me know this functionality available in Query (SQ01) like normal reports
    Regards,
    Venkat

    Hi,
    We just can't make changes in this case as this are all system generated programs.
    WE have to write our own reports to make things flexible to match our requirements.
    Things you are asking is not possible.
    Regards,
    Suvendu

  • Editable column in ALV list report

    Hi,
    I  developed a ALV list block report. I want to make some of column editable in my alv list report.I set WA_FIELDCAT-EDIT     = 'X' in fieldcatalog but it's not working.
    Could you please sugest.
    Regards,
    Mohit

    Hi Mohit ,
    please  check WA_FIELDCAT-EDIT = 'X'    fieldcat which you are passing to ALV grid function module is same  or different  .
    or use in this way
    perform get_fieldcat using  'QUANTITY'     'Enter.Qty'               12 'R' 'N' '000' 'N' 'N' 'N' 'N'  'N' 'N' .
    get_fieldcat  using   p_fieldname
                                p_txtname
                                p_length
                                p_justfy
                                p_keyfld
                                p_color
                                p_hotspt
                                p_total
                                p_sort
                                p_subtot
                                p_para1
                                p_zero .
      clear ms_fieldcat .
      ms_fieldcat-fieldname = p_fieldname .
      ms_fieldcat-seltext_l = p_txtname   .
      ms_fieldcat-ddictxt   = 'L'         .
      ms_fieldcat-outputlen = p_length    .
      ms_fieldcat-just      = p_justfy    .
      ms_fieldcat-lzero     = 'X'         .
      ms_fieldcat-checkbox = 'X'          .
      ms_fieldcat-edit     = 'X'          .
      if p_fieldname = 'CHK' .
        ms_fieldcat-checkbox = 'X'.
        ms_fieldcat-edit = 'X'.
      else.
        ms_fieldcat-checkbox = ' '.
        ms_fieldcat-edit = ' '.
      endif.
      if p_fieldname = 'QUANTITY' .
        ms_fieldcat-edit = 'X'.
      endif.
    regards
    Deepak.

  • Serial Number in ALV list

    Hi...
    How do we give Serial numbers to the records displayed in an ALV list? I can create a column(Sr. No) in the internal table, but this wont work if the user sorts the list.
    Regards,
    Anoop

    hi.
    you can try this out..
    the statment WA_A2-SELTEXT_L = 'S_NO' is necessary for display of the numbers in the column in alv..
    for example..
    WA_A2-COL_POS = 1.
    WA_A2-FIELDNAME = 'S_NO'.
    <b>WA_A2-SELTEXT_L = 'S_NO'.</b>WA_A2-TABNAME = 'IT_A1'.
    WA_A2-HOTSPOT = 'X'.
    APPEND WA_A2 TO IT_A2.
    CLEAR WA_A2.

  • Hide column in  alv

    how i can make column hide in alv report

    Set the NO_OUT parameter in the field catalog as X.
    no_out(1)      type c,        " (O)blig.(X)no out
    In the case it would not show the column in ALV list
    Message was edited by: Anurag Bankley

  • Alv list ..records with green ,red, yellow,grey lights

    Hello Experts,
    I have one requirement,
    in my alv list if the records match the recors should be displayed with GREEN light,
    similarly for other mmatches it should display with red, yellw, grey lights.
    please help me by sending the coding ,its an urgent requirement.
    thanks ,
    shaik.

    Zameera,
    *& Report ZMDEMO_ALV_04
    *&Make an Exception field ( = Traffic lights)
    *&There can be defined a column in the grid for display of traffic lights. This field is of type Char 1, and can contain the following values:
    *& 1 Red
    *& 2 Yellow
    *& 3 Green
    *&The name of the traffic light field is supplied inh the gs_layout-excp_fname used by method set_table_for_first_display.
    report zmdemo_alv_04.
    tables: sflight.
    type-pools: icon.
    types: begin of ty_sflight.
    include structure sflight.
    types: traffic_light type c,
    lights LIKE icon_xml_doc,
    lights(4),
    icon type icon-id.
    types: end of ty_sflight.
    G L O B A L I N T E R N A L T A B L E S
    data: t_sflight type standard table of ty_sflight.
    G L O B A L D A T A
    data: ok_code like sy-ucomm,
    wa_sflight type ty_sflight.
    Declare reference variables to the ALV grid and the container
    data:
    go_grid type ref to cl_gui_alv_grid,
    go_custom_container type ref to cl_gui_custom_container.
    data:
    t_fcat type lvc_t_fcat,
    wa_layout type lvc_s_layo.
    S T A R T - O F - S E L E C T I O N.
    start-of-selection.
    perform build_fieldcat.
    perform build_layout.
    set screen '100'.
    *& Module USER_COMMAND_0100 INPUT
    module user_command_0100 input.
    case ok_code.
    when 'EXIT'.
    leave to screen 0.
    endcase.
    endmodule. " USER_COMMAND_0100 INPUT
    *& Module STATUS_0100 OUTPUT
    module status_0100 output.
    Create objects
    if go_custom_container is initial.
    create object go_custom_container
    exporting container_name = 'ALV_CONTAINER'.
    create object go_grid
    exporting
    i_parent = go_custom_container.
    perform load_data_into_grid.
    endif.
    endmodule. " STATUS_0100 OUTPUT
    *& Form load_data_into_grid
    form load_data_into_grid.
    data l_light type c value '1'.
    Read data from table SFLIGHT
    select *
    from sflight
    into table t_sflight.
    Condition placing to the traffic_light Field
    LOOP AT t_sflight INTO wa_sflight.
    wa_sflight-traffic_light = l_light.
    MODIFY t_sflight FROM wa_sflight.
    IF l_light = '3'.
    l_light = '1'.
    ELSE.
    l_light = l_light + 1.
    ENDIF.
    ENDLOOP.
    Setting the Icon based on the traffic_light field value.
    LOOP AT t_sflight INTO wa_sflight.
    CASE wa_sflight-traffic_light.
    WHEN '1'.
    wa_sflight-lights = icon_red_light.
    WHEN '2'.
    wa_sflight-lights = icon_yellow_light.
    WHEN '3'.
    wa_sflight-lights = icon_green_light.
    ENDCASE.
    MODIFY t_sflight FROM wa_sflight.
    ENDLOOP.
    loop at t_sflight into wa_sflight.
    case l_light.
    when '1'.
    wa_sflight-lights = icon_red_light.
    when '2'.
    wa_sflight-lights = icon_yellow_light.
    when '3'.
    wa_sflight-lights = icon_green_light.
    endcase.
    if l_light = '3'.
    l_light = '1'.
    else.
    l_light = l_light + 1.
    endif.
    modify t_sflight from wa_sflight.
    endloop.
    Load data into the grid and display them
    call method go_grid->set_table_for_first_display
    exporting
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    i_structure_name = 'SFLIGHT'
    IS_VARIANT =
    i_save = 'A'
    I_DEFAULT = 'X'
    is_layout = wa_layout
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    changing
    it_outtab = t_sflight[]
    it_fieldcatalog = t_fcat
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    others = 4
    endform. " load_data_into_grid
    *& Form build_fieldcat
    text
    --> p1 text
    <-- p2 text
    form build_fieldcat .
    data: w_fcat type lvc_s_fcat.
    define macro_fcat.
    w_fcat-fieldname = &1.
    w_fcat-col_pos = &2.
    w_fcat-coltext = &3.
    append w_fcat to t_fcat.
    clear w_fcat.
    end-of-definition.
    macro_fcat 'CARRID' 1 text-c01 .
    macro_fcat 'CONNID' 2 text-c02 .
    macro_fcat 'FLDATE' 3 text-c03 .
    macro_fcat 'PRICE' 4 text-c04 .
    macro_fcat 'SEATSMAX' 5 text-c05 .
    macro_fcat 'SEATSOCC' 6 text-c06 .
    macro_fcat 'LIGHTS' 7 text-c07 .
    endform. " build_fieldcat
    *& Form build_layout
    text
    --> p1 text
    <-- p2 text
    form build_layout .
    wa_layout-cwidth_opt = 'X'.
    wa_layout-excp_fname = 'TRAFFIC_LIGHT'.
    wa_layout-excp_group = '1'.
    endform. " build_layout
    Pls. Reward if useful.

  • ALV List only 80 Columns when runinning as background job

    Hello Guys,
    I have a Problem with an ALV List.
    We use the FM REUSE_ALV_HIERSEQ_LIST_DISPLAY for a Document Journal.
    When I run it in foreground it works fine. But when I view the spool in background the list makes a break at excactly 80 signs, but the line size should be about 120.
    In the report the Line-Size is set correctly, even the print parameters seem to be ok. We are running it with X_65_255.
    I saw that there are some SAP Notes to this topic, but on our release (SAP_BASIS 700) the notes are already implemented.
    Has anyone a solution to this topic?
    Thanks and regards
    Roland

    Try this.
    [ALV List only 80 Columns when running in background job|https://forums.sdn.sap.com/click.jspa?searchID=25735042&messageID=5686003]

  • Multiple Lines Header and Records in ALV List

    Dear All,
    I am faced with a wierd user requirement to print multiple line header in ALV. Currently we have a classical report where we are displaying a huge text for example 400 characters in a single cell of a column of the report.
    Now we will have to convert this to ALV report where I need to show that data in a single cell. I am wondering how is it possible in ALV list/grid. Please let me know if you guys have any clue.
    Regards,
    Bikramjit

    Hi,
    Did you find a solution for this?, I am also having a similar requirement.
    If you have any work around please share.
    Thanks.

  • How to Change Column header in ALV List

    hello,
    is there a way to change the column header/label of an ALV list other than inheriting it from the source table it is bound to?
    thanks,
    sid

    Yes, you can.  If you are using a field catalog, you can change the field labels in your program.
    For example.
      data: fc_tmp type slis_fieldcat_alv .
      clear: fieldcat. refresh: fieldcat.
      clear: fc_tmp.
    <b>  fc_tmp-reptext_ddic    = 'Material Number'.</b>
      fc_tmp-fieldname  = 'MATNR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '18'.
      fc_tmp-col_pos    = 2.
      append fc_tmp to fieldcat.
    If you are using the MERGE funciton module to get your field catalog, then you just need to loop thru it and change the field which is holding the description, then modify the line of the field catalog.
    REgards,
    Rich Heilman

  • Subtotal text in the 3rd column of the alv list

    Hi Guru,
    Can anyone know or have some codes on how to implement a subtotal text in the 3rd column of the ALV list. Im using FM REUSE_ALV_HIERSEQ_LIST_DISPLAY to display the report.
    Please give some advise or help.
    Thanks and rewards is given.

    Hi my friend,
    Insted Using FM REUSE_ALV_HIERSEQ_LIST_DISPLAY
    better use REUSE_ALV_GRID_DISPLAY.
    in that 
            it_sort            = i_sort[]
      constants :     c_x       type char1 value 'X'.
        l_rec_fieldcat_wa-do_sum    = c_x.
      endif.

Maybe you are looking for

  • Windows 8.1 problems with my enterprise user

    Hi all, I have two problems that I need help with. For background information, I am in an IT-support enterprise and I am a support person for a client. Since I am developing and maintaining an application for this client that is to be used inside the

  • Decompile a jar file

    i have a jar file, how can i decompile it?

  • LMS 4.2 discovery does not resolve hostname

    Hi, I'm trying automatic discovery with Ping on sweep module. I'm using the following configuration (you can also see it in the attached file): discovery module - ping on sweep global seed device - 192.168.6.35 preferred DCR display name - DNS resolv

  • DB from AIX to NT

    Can I use the full database backup (made under AIX)to restore it under Windows NT 4.0? Both databases are version 8.0.4, however the NT version is a workgroup version and the AIX version is an Enterprise Edition. Thanks in advance. null

  • MacBook Pro - use iMac as mirror

    Greetings. I've seen many versions of this question, but not this exact one, so.... I have a MacBook Pro 6,1. I also have an iMac 7,1. I sometimes want to use the iMac screen as a mirror of the MacBook Pro screen (because it's a bigger screen). The M