2017-08-14 12 views
2

This is the pictureSAP ABAP alvローを他のテーブルに動的に追加しますか?

どのようにして行イベントを選択できますか?

if (alv_table_1_row) is selected or if button is pressed 
append to alv_table_2 

誰か助けてもらえますか?動的にalv_table_2に追加する行のクリックでしたいですか?

+0

@Brian Tompsett - 汤莱恩おかげで、写真を投稿できなくなってしまいました – User2333

+0

これまでに何を試みましたか? – vwegert

+0

@vwegert私は行を追加するためにok_codeを使用しようとしましたが、システムが私にdumpを与えました。選択イベントを取得する方法がわかりません – User2333

答えて

1

double-click ALVグリッドの行イベントを処理するために、以下のようなローカルクラスを作成します。

class lcl_alv_event_receiver definition. 

    public section. 

    methods: handle_double_click. 
    for event double_click of cl_gui_alv_grid 
     importing e_row e_column. 

endclass. 

class lcl_alv_event_receiver implementation. 

    method handle_double_click. 
     " Your event handler code here like below 
     " read table alv_table_1 index e_row-index into ls_row. 
     " append ls_row to alv_table_2. 
     " alv_table_2_grid->refresh_table_display(). 
    endmethod. 

endclass. 

左のALVが初期化された後に、コードのどこかにイベントハンドラを登録します。

+0

「alv宣言の前または後」とはどういう意味ですか? g – Allen

+0

の前にまずALVグリッドを初期化し、イベントを登録してください。 – Allen

+0

okありがとうございました – User2333