ALV 取得 方法

2022-07-29 06:03:08 字數 1630 閱讀 9791

表示されたalvをダブルクリックした時に別畫面へ遷移する方法を說明しよう。

下記サンプルのように標準トランザクションへ遷移したり、別のalvを表示したりする事が可能である。

abap

form call_alv.

call function 'reuse_alv_grid_display'

exporting

i_callback_program = sy-repid

i_callback_user_command = 'user_command'

it_fieldcat = it_fieldcat

tables

t_outtab = it_data

exceptions

program_error = 1

others = 2.

endform.

form user_command using ucomm like sy-ucomm

selfield type slis_selfield.

case ucomm.

* double click

when '&ic1'.

read table it_data into wa_data

index selfield-tabindex.

if selfield-fieldname = 'banfn'.

set parameter id 'ban' field wa_data-banfn.

call transaction 'me53n' and skip first screen.

elseif selfield-fieldname = 'ebeln'.

set parameter id 'bes' field wa_data-ebeln.

call transaction 'me23n' and skip first screen.

endif.

endif.

endcase.

endform.

泛用モジュール:reuse_alv_grid_displayを使用する際に、i_callback_programとi_callback_user_commandを設定しよう。

一般的なのalvレポートであればi_callback_programには自身のプログラム名、i_callback_user_commandには実行したいform名を指定しよう。

この例では、alvをダブルクリックした時にform:user_commandが実行される。引き數のucommをチェックし』&ic1′(ダブルクリック)の時だけ

処理が実行されるようにしよう。シングルクリックではform:user_commandが実行されなかったが念の為確認しておく事をお勧めする。

次にselfield-tabindexには選択した行番號が入っているので、その値を使用してalvに渡した內部テーブルから値を取得しよう。

ソートやフィルタされている場合でも、indexをチェックするだけで問題はない。

selfield-fieldnameには選択された列名が入ってるので選択列によって処理を変えたい場合はチェックしよう。

ALV引數彙總

在網上看到一些alv的引數,還有平時用到的一些引數,做個彙總,不斷更新中 rs selfield col stable x rs selfield row stable x rs selfield refresh x 這3行就可以實現自動重新整理,並且返回時滑鼠回到原來的位置 rs selfield...

ORACLE的TRACE取得方法

1,自session內trace取得方法。取得開始 alter session set timed statistics true alter session set sql trace true sql執行 取得終了 alter session set timed statistics false...

ALV 報表 顏色 例項

在alv報表設計有時候需要根據一定條件將特定的單元顯示成特定的顏色,具體實現步驟如下 1.在需要顯示的內錶中新增新的字段,字段型別為lvc t scol 2.根據條件設定顏色資料 3.設定layout coltab fieldname的資料指定顯示顏色的字段.如下 注意紅色部分 report z a...