Skip to Content
author's profile photo Former Member
Former Member

How to Input Value in ALV report at reuntime...?

Dear All,

How to Input Value or change the value of a field in ALV report at runtime...?

regards,

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • Posted on Aug 03, 2006 at 04:20 AM

    HI,

    To input value in ALV you have to make it editable.

    to change values at runtime you have to capture some events and then change your values in internal table which is used to display alv.

    Here is an example of editable ALV.

    <b>REPORT ZWA_ALV_EDITABLE_FM .
    
    
    type-pools: slis.
    
    data: gs_layout type slis_layout_alv.
    DATA: d_ref TYPE REF TO data.
    
    DATA: itab type table of fmfint.
    
    SELECT * FROM fmfint
    INTO TABLE itab.
    
    gs_layout-edit = 'X'.
    
    * Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
         exporting
              i_callback_program      = 'ZWA_ALV_EDITABLE_FM'
              i_callback_user_command = 'USER_COMMAND'
              i_structure_name        =  'fmfint'
              is_layout               = gs_layout
         tables
              t_outtab                = itab.
    
    
    form user_command using r_ucomm type sy-ucomm
                            rs_selfield type slis_selfield.
      if r_ucomm = '&DATA_SAVE'.
    
        message i000(SU) with 'saved'.
    
        MODIFY fmfint FROM TABLE itab.
    
        call function 'REUSE_ALV_LIST_DISPLAY'
             exporting
                  i_structure_name = 'fmfint'
             tables
                  t_outtab         = itab.
      endif.
    endform.</b>

    Regards,

    Wasim Ahmed

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 04:25 AM

    Hi

    Its Simple, just when you are building fieldcat put edit = 'X'. Please refer to standard program in SE38 BCALVEDIT to get the logic of approach

    Hope This Helps

    Anirban

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 04:33 AM

    Hai,

    There is option in fieldcatalog EDIT parameter which is set to 'X' to the field to be accept input.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 06:09 AM

    Hi,

    Refer the ALV demo programs starting with B*ALV, you can also have a look at the following,

    BCALV_EDIT_01

    BCALV_EDIT_02

    BCALV_EDIT_03

    Rgds,

    Add comment
    10|10000 characters needed characters exceeded