Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Editable Hierarchical ALV

Former Member
0 Kudos

There is a requirement from client that

They want to see an hierarchical ALV. This ALV needs to be editable in the line item level for the balnk lines. On click of a button, a pop window will appear in which if if they enter say 5 and the customer code then 5 blank lines should be appended at the customer's line item level where the user can enter values. Is this possible. Will the inserted/ appended lines get refreshed on the ALV. For eg:

(----


represent the blank lines)

Header--> Customer Code Customer Name

011101 XYZ

Item--> Material Quantity Unit Amount

14589 125.00 KG 145.50

12569 45.00 KG 100.00

15899 105.00 KG 120.50

-


-


-


-


-


PLZ Help!

3 REPLIES 3

Former Member
0 Kudos

Hi ,

Yes it will be refreshed .You have call the refresh_table_display method .as you are just changing the output table and not the fields structure.

martin_voros
Active Contributor
0 Kudos

Hi,

I've done similar thing. Here is the code for my method for handling double click.


 METHOD handle_node_double_click.
    CALL METHOD sender->get_outtab_line
      EXPORTING
        i_node_key     = node_key
      IMPORTING
        e_outtab_line  = gs_idoc_s
      EXCEPTIONS
        node_not_found = 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.

* Get data
* <code for changing value>

      CALL METHOD sender->change_node
        EXPORTING
          i_node_key     = node_key
          i_outtab_line  = gs_idoc_s
        EXCEPTIONS
          node_not_found = 1
          OTHERS         = 2.

      READ TABLE gt_idoc_s WITH KEY pos = gs_idoc_s-pos
        TRANSPORTING NO FIELDS.
      MODIFY gt_idoc_s FROM gs_idoc_s
        INDEX sy-tabix TRANSPORTING value_low value_high.

      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

      CALL METHOD tree1->frontend_update.
    ENDIF.

  ENDMETHOD.                    "handle_node_double_click

The important methods are get_outtab_line. change_node and frontend_update.

Former Member
0 Kudos

Hi Annie,

Please go through the following standard program.

See BCALV_EDIT_01 for an overview

EDIT of the fieldcatalog, see BCALV_EDIT_03.

Regards,

Dheeraj Soni