Error in Editable column in ALv O/P using Style.

hi,
I have written
Style Declaration
  DATA : ls_listrow LIKE LINE OF i_final,
         ls_stylerow TYPE lvc_s_styl,
         ls_styletab TYPE lvc_t_styl.
Processing to Final Table
  LOOP AT i_bal INTO wa_bal.
    wa_final-vbukr = wa_bal-vbukr.
    wa_final-abukr = wa_bal-abukr.
    wa_final-konts = wa_bal-konts.
    wa_final-vendor = wa_bal-vendor.
    wa_final-customer = wa_bal-customer.
    wa_final-w_wrbtr_c = wa_bal-w_wrbtr_c.
    wa_final-w_wrbtr_v = wa_bal-w_wrbtr_v.
    wa_final-flag = wa_bal-flag.
Green - 3
    IF wa_final-flag = 'X'.
      wa_final-light = '3'.
      wa_final-chk = 'X'.
For the checkbox to be in Editable mode and also checked by Default
      ls_stylerow-fieldname = 'CHK'.
      ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
      ls_stylerow-style2 = space.
      ls_stylerow-style3 = space.
      ls_stylerow-style4 = space.
      ls_stylerow-maxlen = 1.
Appending the  CELLTAB table existing in I_final table
      APPEND ls_stylerow TO ls_styletab.
      INSERT LINES OF ls_styletab INTO TABLE wa_final-celltab.
Appending the Final Table Entries
      APPEND wa_final TO i_final.
Red - 1
    ELSEIF wa_final-flag = ' '.
      wa_final-light = '1'.
      wa_final-chk = space.
For the check box to be in Disabled mode
      ls_stylerow-fieldname = 'CHK'.
      ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
      ls_stylerow-style2 = space.
      ls_stylerow-style3 = space.
      ls_stylerow-style4 = space.
      ls_stylerow-maxlen = 1.
Appending the  CELLTAB table existing in I_final table
      APPEND ls_stylerow TO ls_styletab.
      INSERT LINES OF ls_styletab INTO TABLE wa_final-celltab.
Appending the Final Table Entries
      APPEND wa_final TO i_final.
    ENDIF.
    CLEAR : wa_final,
            ls_styletab,
            ls_stylerow.
  ENDLOOP.
FORM field_catalog  CHANGING p_gt_fieldcat.
  CLEAR gs_fieldcat.
  gs_fieldcat-col_pos = '1'.
  gs_fieldcat-fieldname = 'CHK'.
  gs_fieldcat-ref_field = 'I_FINAL-CHK'.
  gs_fieldcat-scrtext_l = 'Check box'.
  gs_fieldcat-hotspot = 'X'.
  gs_fieldcat-checkbox = 'X'.
  gs_fieldcat-edit = 'X'.
  APPEND gs_fieldcat TO gt_fieldcat.
endform.
My final data is wa_final = flag = ' '.
                        wa_final-light = 1
                        wa_final-chk = space.
and o/p is is going to diabled mode...but in o/p, I am able to check the checbox which should not occur.
Regards,
Deepthi.

Hello Deepthi
The table type LVC_T_STYL is a sorted table type therefore you cannot use APPEND to add entries to this itab.
    * Appending the CELLTAB table existing in I_final table
APPEND ls_stylerow TO ls_styletab.  " no effect, record not added to itab
" Even worse: NO syntax error !!!
" Instead use:
INSERT ls_stylerow INTO TABLE ls_styletab.
Regards
  Uwe

Similar Messages

  • See my error : (REP-1272: Column ‘CF_1’ may not be used as break Column.)

    Hi master
    Sir I have master detail report and I use one formula column and one place holder column in my report in master section
    I use this code
    function CF_1Formula return Date is
    begin
    if :chqdate is not null then
         :cp_1 :=:chqdate;
    else
         :cp_1 :=:sdate;
         end if;
    end;
    Sir when I run my report then system give me this error
    REP-1272: Column ‘CF_1’ may not be used as break Column.
    Please give me idea how I get report
    Thank
    aamir

    Hello,
    Break Order cannot be used for some Column Type :
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwcontxt/props/pi_col_break_order.htm
    (CLOB is not explicitly specified, but the restriction for LONG and LONG RAW exists for CLOB too)
    Regards

  • 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.

  • Editable field in alv tree output using cl_gui_alv_tree

    Hi,
    i need Editable field with F4 help in alv tree output using cl_gui_alv_tree.
    regards,
    Naresh

    sadly, this is not possible. An ALV Tree cannot by editable.
    Regards

  • Editable Field in ALV TREE Display Using OOPs

    Hi,
    I am trying to make a field editable on the ALV Tree display. I could create an editable check box. But could not make a field Editable. I have made EDIT = 'X' in the fieldcatalog for the particular field. but  it is not working.
    Please help me in solving this. Its very urgent.

    You do this with the following code example
      DATA: ls_layout TYPE lvc_s_layi.
      CLEAR ls_layout.
      ls_layout-class     = cl_item_tree_control=>item_class_text.
      ls_layout-editable   = 'X'.
      ls_layout-fieldname = your fieldname.
      APPEND ls_layout TO lt_layout.
    add PO header to tree
          CALL METHOD tree->add_node
            EXPORTING
              i_relat_node_key = space
              i_relationship   = cl_gui_column_tree=>relat_last_child
              i_node_text      = l_node_text
              is_outtab_line   = ls_po_item
              is_node_layout   = wa_layout_node
              it_item_layout   = lt_layout
    Roy

  • Editable Column in ALV Column tree model

    Hi Experts, I have created ALV tree using the class
    CL_COLUMN_TREE_MODEL
    ,i have created some columns, and now  i have to make these columns editable, Please can anyone help me resolving this.

    samthajain wrote:
    Hi Experts, I have created ALV tree using the class
    CL_COLUMN_TREE_MODEL
    ,i have created some columns, and now  i have to make these columns editable, Please can anyone help me resolving this.
    I doubt this is possible at all. Once I tried different ways of achieving editable tree, but with no luck. You can only have text fields, buttons, checkboxes (editable too) as columns but not editable input fields.
    Regards
    Marcin

  • Error in field catalog in ALV grid display using classes at do_sum = "X'.

    Hi,
    I'm using classes in ALV Grid display.
    the code for the field catalog is going to dump because of the statement in the field catalog for field 'netwr',do_sum = 'X'.
    that do_sum = 'X' is not working and going to dump when executed.with out that do_sum it is working fine. the error in dump analysys is showing sap standard incude LSLVCF01.
        assign component
               <ls_fieldcat>-fieldname of structure rt_data to <g_field>.
        if sy-subrc ne 0.
          message x000(0k).
        endif.
    sy-subrc is 4 when the program is being executed.
    CODE:
    FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      ls_fcat-fieldname = 'VBELN1'.
      ls_fcat-ref_field = 'VBELN'.
      ls_fcat-ref_table = 'VBRK'.
      ls_fcat-coltext = 'Invoice No'.
      ls_fcat-seltext = 'Invoice No'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'BUDAT'.
      ls_fcat-ref_table = 'BKPF'.
      ls_fcat-coltext = 'Invoice Date'.
      ls_fcat-seltext = 'Invoice Date'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ls_fcat-fieldname = 'NETWR'.
      ls_fcat-ref_field = 'NETWR'.
      ls_fcat-ref_table = 'VBRK'.
      ls_fcat-coltext = 'Value of Invoice'.
      ls_fcat-seltext = 'Value of Invoice'.
      ls_fcat-datatype = 'CURR'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ENDFORM.
    can u please look in the code and rectify the error,
    would appeciate ur response.
    regards,
    veera.

    Hi,
    try this..
    ls_fcat-fieldname = 'NETWR'.
    ls_fcat-ref_field = 'NETWR'.
    ls_fcat-ref_table = 'VBRK'.
    ls_fcat-coltext = 'Value of Invoice'.
    ls_fcat-seltext = 'Value of Invoice'.
    ls_fcat-datatype = 'CURR'.
    ls_fcat-do_sum = 'X'.
    <b>ls_fcat-cfieldname = 'WAERS'.</b>
    APPEND ls_fcat TO pt_fieldcat.
    CLEAR ls_fcat.
    Regards
    vijay

  • Editing of a  Column of ALV Tree(OOPS) node

    is it possible to edit a column of node of ALV tree.
    i am using ALV class "CL_GUI_ALV_TREE".
    After searching existing threads, for the same issue..i found the following.
    1) Editable Tree ALV
      ( displays pop up window where user can change values and then transfer these changes back to ALV tree)
    2) Editable Field in ALV TREE Display Using OOPs
         (this approach is not working for ALV Tree)
    But i want to edit directly coulmn of a node of ALV tree.
    is it possible in  OOPS ALV Tree?
    if it possible, can any one provide the sample code,

    As you already noticed, this is not possible, but you may edit your fields outside the tree and bring your changes back to tree. I struggled with the same once but eventually used described alternative. If you use saplink you may check upgrade [chain and rename|http://code.google.com/p/saplink-chain-and-rename/downloads/list] where this approach is released. The code is free so you will be able to study and copy whatever you need from it.
    Editing in a pop up is also an alternative here.
    Regards
    Marcin

  • How to use enter in Editable column of Reuse_alv_gird_display

    Hello gurus,
    I have a requirement , a editable column in alv display, where user enters an amount and hits 'enter' it i will multiply with other column in the report and give display in next column.  Now i can do it easily by using USER Command in Reuse alv grid display but when i use SY-UCOMM  &DATA_SAVE. and user needs to press save button.  Is ther any possibility so that if user hits enter then this requirement can be achieved.
    Thanks.

    Hi,
    Write a code like below..
    WA_FLDCAT-EDIT = 'X'.
    F SY-UCOMM = 'SAVE' .
    *** to reflect the data changed into internal table
         IF REF_GRID IS INITIAL.
           CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
             IMPORTING
               E_GRID = REF_GRID.
         ENDIF.
         IF NOT REF_GRID IS INITIAL.
    ***** To check whether the ALV Grid is Modified
    ***** And also to Modify the internal table based on Modification in ALV
           CALL METHOD REF_GRID->CHECK_CHANGED_DATA
             IMPORTING
               E_VALID = L_VALID.
         ENDIF.
    Arivazhagan S

  • How to make a entire column editable in an ALV grid

    Hi all,
             I am trying to make a column editable in an ALV grid. For that I wrote the following code. In the below code I have set the 'edit' field of ls_fcat to 'X'. But Iam getting Runtime error. Can anyone help in resolving this problem or suggest any method to make a column editable in an ALV grid.
    form prepare_fc  changing go_fieldcat type lvc_t_fcat.
    data: ls_fcat type lvc_s_fcat.
    refresh: go_fieldcat.
    clear: ls_fcat.
    ls_fcat-reptext   = ' Safety Stock Figures'.
      ls_fcat-coltext    = 'Safety Stock Figures'.
      ls_fcat-fieldname  = 'EISBE'.
    ls_fcat-ref_table  = 'IMAT'.
      ls_fcat-edit = 'X'.
    modify go_fieldcat from ls_fcat.
      APPEND LS_FCAT TO GO_FIELDCAT.
    endform.
    Thanks & Regards,
    Vishnu Priya.

    ls_fcat-edit = 'X'.
    is correct only.
    have a look into this code
    struct_grid_lset  TYPE lvc_s_layo,
    i_grid_fcat    TYPE lvc_t_fcat
    DATA ls_fcat TYPE lvc_s_fcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'MONTH'.
      ls_fcat-ref_table = 'TYPE'.
      ls_fcat-ref_field = 'C'.
    <b>  ls_fcat-edit      = 'X'.</b>
      ls_fcat-coltext   = text-030."Month
      ls_fcat-seltext   = text-030.
      APPEND ls_fcat TO p_i_grid_fcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'YEAR'.
      ls_fcat-ref_table = 'TYPE'.
      ls_fcat-ref_field = 'C'.
      ls_fcat-coltext   = text-031."Year
      ls_fcat-seltext   = text-031.
      APPEND ls_fcat TO p_i_grid_fcat.
    CALL METHOD o_grid->set_table_for_first_display
          EXPORTING
            i_bypassing_buffer    =  space
            is_variant            =  ws_f_grid_disvar
            i_save                =  ws_c_grid_save
            is_layout             =  struct_grid_lset
          CHANGING
            it_outtab             =  i_grid_outs[]
            <b>it_fieldcatalog       =  i_grid_fcat[]</b>
            it_sort               =  i_sort_fcat.      " Period
    Also Check this code.Another way using field symbols.
    i_fieldcat    TYPE lvc_t_fcat,
           w_layout TYPE lvc_s_layo ,
           w_variant TYPE disvariant.
    FIELD-SYMBOLS : <lfs_fieldcat> TYPE lvc_s_fcat.
    *Default display
      LOOP AT p_fieldcat ASSIGNING <lfs_fieldcat>.
        CASE <lfs_fieldcat>-fieldname.
          WHEN 'GL_ACCT'.
            <lfs_fieldcat>-coltext = text-050.
            <lfs_fieldcat>-no_out = ' '.
            <lfs_fieldcat>-scrtext_l = text-050.
           <b> <lfs_fieldcat>-edit    = 'X'.</b>
    WHEN OTHERS.
        ENDCASE.
      ENDLOOP.
    Hope this helps.

  • ALV grid disply with edit columns in output

    Hi all,
      i am using   CALL METHOD MY_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    to display the output in alv format.there is  3 edit columns in output display.
       if i fill one field & then put 'ENTER' then other two fields of that row should be filled with the appropriate data from the program.still control should be in output display.
    which method i should use to go inside the program when i put 'ENTER' on any field of ALV output disply & how to use those methods inside the program.
    i need some materials regarding OOPS (class, method ) . now i want to put OOPS concept in alv display.
    correct answers will be rewarded.
    Thanks & regards

    Hi,
    Check,
    OOPS
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    ABAP Objects
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b0f9ed7ccb#section7 [original link is broken]
    check the below links lot of info and examples r there for OOPS
    http://www.sapgenie.com/abap/OO/index.htm
    http://www.geocities.com/victorav15/sapr3/abap_ood.html
    http://www.brabandt.de/html/abap_oo.html
    http://www.sapgenie.com/abap/OO/
    http://www.sapgenie.com/abap/OO/index.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    <b>Reward if helpful.</b>

  • Group feature at ALV grid with editable columns

    Am I right ?
    Group function by using a sorted layout is disabled while having one (or more) editable columns, isn't it ?
    ... or is there a possibility to use gouped rows ?
    Greetings
    Markus

    Also...
    *& Report ZDEMO_ALVGRID_EDIT *
    *& Example of a simple ALV Grid Report *
    *& The basic ALV grid, Enhanced to display specific fields as *
    *& editable depending on field value *
    REPORT ZDEMO_ALVGRID_EDIT .
    TABLES: ekko.
    TYPE-POOLS: slis. "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
    ebeln TYPE ekpo-ebeln,
    ebelp TYPE ekpo-ebelp,
    statu TYPE ekpo-statu,
    aedat TYPE ekpo-aedat,
    matnr TYPE ekpo-matnr,
    menge TYPE ekpo-menge,
    meins TYPE ekpo-meins,
    netpr TYPE ekpo-netpr,
    peinh TYPE ekpo-peinh,
    field_style TYPE lvc_t_styl, "FOR DISABLE
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
    wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: it_fieldcat TYPE lvc_t_fcat, "slis_t_fieldcat_alv WITH HEADER LINE,
    wa_fieldcat TYPE lvc_s_fcat,
    gd_tab_group TYPE slis_t_sp_group_alv,
    gd_layout TYPE lvc_s_layo, "slis_layout_alv,
    gd_repid LIKE sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    PERFORM data_retrieval.
    PERFORM set_specific_field_attributes.
    PERFORM build_fieldcatalog.
    PERFORM build_layout.
    PERFORM display_alv_report.
    *& Form BUILD_FIELDCATALOG
    Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
    wa_fieldcat-fieldname = 'EBELN'.
    wa_fieldcat-scrtext_m = 'Purchase Order'.
    wa_fieldcat-col_pos = 0.
    wa_fieldcat-outputlen = 10.
    wa_fieldcat-emphasize = 'X'.
    wa_fieldcat-key = 'X'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'EBELP'.
    wa_fieldcat-scrtext_m = 'PO Item'.
    wa_fieldcat-col_pos = 1.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'STATU'.
    wa_fieldcat-scrtext_m = 'Status'.
    wa_fieldcat-col_pos = 2.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'AEDAT'.
    wa_fieldcat-scrtext_m = 'Item change date'.
    wa_fieldcat-col_pos = 3.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'MATNR'.
    wa_fieldcat-scrtext_m = 'Material Number'.
    wa_fieldcat-col_pos = 4.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'MENGE'.
    wa_fieldcat-scrtext_m = 'PO quantity'.
    wa_fieldcat-col_pos = 5.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = 'MEINS'.
    wa_fieldcat-scrtext_m = 'Order Unit'.
    wa_fieldcat-col_pos = 6.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    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.
    wa_fieldcat-fieldname = 'PEINH'.
    wa_fieldcat-scrtext_m = 'Price Unit'.
    wa_fieldcat-col_pos = 8.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    ENDFORM. " BUILD_FIELDCATALOG
    *& Form BUILD_LAYOUT
    Build layout for ALV grid report
    FORM build_layout.
    Set layout field for field attributes(i.e. input/output)
    gd_layout-stylefname = 'FIELD_STYLE'.
    gd_layout-zebra = 'X'.
    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'
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
    i_callback_program = gd_repid
    i_callback_user_command = 'USER_COMMAND'
    is_layout_lvc = gd_layout
    it_fieldcat_lvc = it_fieldcat
    i_save = 'X'
    TABLES
    t_outtab = it_ekko
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " DISPLAY_ALV_REPORT
    *& Form DATA_RETRIEVAL
    Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
    SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
    UP TO 10 ROWS
    FROM ekpo
    INTO CORRESPONDING FIELDS OF TABLE it_ekko.
    ENDFORM. " DATA_RETRIEVAL
    *& Form set_specific_field_attributes
    populate FIELD_STYLE table with specific field attributes
    form set_specific_field_attributes .
    DATA ls_stylerow TYPE lvc_s_styl .
    DATA lt_styletab TYPE lvc_t_styl .
    Populate style variable (FIELD_STYLE) with style properties
    The NETPR field/column has been set to editable in the fieldcatalog...
    The following code sets it to be disabled(display only) if 'NETPR'
    is gt than 10.
    LOOP AT it_ekko INTO wa_ekko.
    IF wa_ekko-netpr GT 10.
    ls_stylerow-fieldname = 'NETPR' .
    ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
    "set field to disabled
    APPEND ls_stylerow TO wa_ekko-field_style.
    MODIFY it_ekko FROM wa_ekko.
    ENDIF.
    ENDLOOP.
    endform. " set_specific_field_attributes
    REWARD POINTS IF usefful !!

  • Saving editable column contents in Std. Table using ALV

    Hi All,
       I developed a ALV report which displays list of sales orders of particular customer, in this report created by name is editable column. Now i want to save the created by name after user changes the contents of this column and click on save button. I am getting all the data to be saved in field "RS_SELFIELD" (RS_SELFIELD TYPE SLIS_SELFIELD)  Kindly help me to get out of this issue.  
    Advance thanks for your response.

    Try this code.
    FORM user_command  USING    r_ucomm LIKE sy-ucomm
                               rs_selfield TYPE slis_selfield.
    * Local data declaration
      DATA: li_tab TYPE REF TO data,
            l_line TYPE REF TO data.
    * Local field-symbols
      FIELD-SYMBOLS:<l_tab> TYPE table,
                    <l_wa>  TYPE ANY.
    * Create table
      CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
      ASSIGN li_tab->* TO <l_tab>.
    * Create workarea
      CREATE DATA l_line LIKE LINE OF <l_tab>.
      ASSIGN l_line->* TO <l_wa>.
      CASE r_ucomm.
    *   When a record is selected
        WHEN '&IC1'.
    *     Read the selected record
          READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
          rs_selfield-tabindex.
          IF sy-subrc = 0.
    *       Store the record in an internal table
            APPEND <dyn_wa> TO <l_tab>.
    *       Fetch the field catalog info
            CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
              EXPORTING
                i_program_name         = 'Z_DEMO_ALV'
                i_structure_name       = p_table
              CHANGING
                ct_fieldcat            = i_fieldcat
              EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
            IF sy-subrc = 0.
    *         Make all the fields input enabled except key fields
              w_field-input = 'X'.
              MODIFY i_fieldcat FROM w_field TRANSPORTING input
              WHERE key IS INITIAL.
            ENDIF.
    *       Display the record for editing purpose
            CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
              EXPORTING
                i_callback_program    = sy-repid
                i_structure_name      = p_table
                it_fieldcat           = i_fieldcat
                i_screen_start_column = 10
                i_screen_start_line   = 15
                i_screen_end_column   = 200
                i_screen_end_line     = 20
              TABLES
                t_outtab              = <l_tab>
              EXCEPTIONS
                program_error         = 1
                OTHERS                = 2.
            IF sy-subrc = 0.
    *         Read the modified data
              READ TABLE <l_tab> INDEX 1 INTO <l_wa>.
    *         If the record is changed then track its index no.
    *         and populate it in an internal table for future
    *         action
              IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
                <dyn_wa> = <l_wa>.
                i_index = rs_selfield-tabindex.
                APPEND i_index.
              ENDIF.
            ENDIF.
          ENDIF.
    *   When save button is pressed
        WHEN 'SAVE'.
    *     Sort the index table
          SORT i_index.
    *     Delete all duplicate records
          DELETE ADJACENT DUPLICATES FROM i_index.
          LOOP AT i_index.
    *       Find out the changes in the internal table
    *       and populate these changes in another internal table
            READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
            IF sy-subrc = 0.
              APPEND <dyn_wa> TO <dyn_tab_temp>.
            ENDIF.
          ENDLOOP.
    *     Lock the table
          CALL FUNCTION 'ENQUEUE_E_TABLE'
            EXPORTING
              mode_rstable   = 'E'
              tabname        = p_table
            EXCEPTIONS
              foreign_lock   = 1
              system_failure = 2
              OTHERS         = 3.
          IF sy-subrc = 0.
    *       Modify the database table with these changes
            MODIFY (p_table) FROM TABLE <dyn_tab_temp>.
            REFRESH <dyn_tab_temp>.
    *       Unlock the table
            CALL FUNCTION 'DEQUEUE_E_TABLE'
              EXPORTING
                mode_rstable = 'E'
                tabname      = p_table.
          ENDIF.
      ENDCASE.
      rs_selfield-refresh = 'X'.
    ENDFORM.                    "user_command

  • Editing rows and columns in alv reports in webdynpro abap

    how edit row and columns in webdynpro abap ?
    can i add colors to salv repotrs for below and above range of values  how ?
    if possible send source code for it.............

    hi
    check out this link for editing the columns of ALV
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b
    check out for this thread as well for coloring ALV
    Coloring of selected table cells: Ideas wanted
    regards,
    amit

  • EDIT limit of a column in ALV grid

    I want to have an editable column in my ALV grid program.
    i am using below code while creating field catalog.
    gwa_fieldcat-tabname = text-02.                  "'GIT_BOM_REP'.
    gwa_fieldcat-fieldname = COMMENT.                "'Comment'.
    gwa_fieldcat-seltext_l = text-058.                "'Comment'.
    gwa_fieldcat-edit = gc_x.
    APPEND gwa_fieldcat TO git_fieldcat.
    CLEAR gwa_fieldcat.
    I am able to write in the output, but the problem is i can write only upto 10 characters.
    Field length for this editable column is 200 and type is C.
    Please suggest.
    Thanks in Advance,
    James.

    Thanks for your reply.....
    I am using this code also:
    *Layout to set width.
      gwa_layout-colwidth_optimize = gc_x.  
      gwa_layout-box_fieldname = 'BOX'.
      gwa_layout-box_tabname = 'GIT_BOM_REP'.
    GIT_BOM_REP-COMMENT length is 200 and typ is C.
    this is the 20th column in my ALV report. and i am using REUSE_ALV_GRID_DISPLAY FM.
    Regards,
    James

Maybe you are looking for

  • Synaptics driver goes hectic after changing policy.

    When I booted into a clean install of arch, two fingers moving on the touchpad at once just moved the mouse pointer. I updated the policy to emulate two finger scrolling and reboot, but then when I put two fingers on the touchpad, it jumps back and f

  • Working with PL/SQL Packages and Extension SDK

    Hi, I'm working on an Extension for SQL Developer. I want this Extension to wrap my PL/SQL Packages. The Situation: I got an Oracle DB 10g Revision 1 so I can't use the dbms_ddl call to wrap my Packages. I have to use the wrap.exe Utility. When I rig

  • W2 Mag Media Missing Contact Information

    On the W-2 mag media files the contact information is missing. All the mag media files, federal and state, need to have this information added. I'm not sure if this is picked up from one record in SAP or if there are multiple contact records in SAP. 

  • Hlep me please I have problems with Live! 24-bit Exter

    <div align="center"><p align="center">i have? Sound Blaster? Li've! 24-bit External? <p align="center">?I work with it before one weak it is good? <p align="center">but when i formats my laptop? and going to installation CD? driver <p align="center">

  • OSX Installation fail!

    So I had a problem with my iMac but since I have all my backups on my external HD, ive decide to erase my hd and start again but will it fix the problem? The problem is, I think I deleted a file on my iMac cause when I try to boot it, the spinning ge