sap屏幕元素与事件
sap屏幕基本元素的創(chuàng)建
???? select-options對象:通常用于參照一數(shù)據(jù)庫字段來建立數(shù)據(jù)輸入域。
???????? 定義代碼: select-options: data for sy-datum.
?
?
???? parameters對象:可以參照數(shù)據(jù)字典具體字段或自定義數(shù)據(jù)類型創(chuàng)建文本輸入域以及單選框/復(fù)選框等。
???????? 定義代碼:parameters: matnr like mara-matnr. //創(chuàng)建輸入域
?
? ? ? ? ? ? ? ? ? ? ? parameters: type as checkbox.???????? //創(chuàng)建checkbox
??? ??? ??? ????
??? ??? ??? ????????? parameters: p1 radiobutton group grp1 default? 'x', //創(chuàng)建RadioButton組
??? ??? ??? ?? ? ? ?? parameters: p2 radiobutton group grp1,
??? ??? ? ? ? ?? ???? parameters: p3 radiobutton group grp1.
?
?
??? selection-screen對象:用于創(chuàng)建屏幕的框架,主要包括屏幕元素的創(chuàng)建以及子屏幕的創(chuàng)建等。
??? ? ? ? ? ? ? 子屏幕主要分兩種:一種為include Screen,可以通過Report端程序直接調(diào)用;
??? ??? ??? ??? ??????? ? ? ? ? ? ? ? ?? 另外一種為SubScreen,需要通過Screen Painter所創(chuàng)建的屏幕引用。
??? ? ? ? 定義代碼:(1) selection-screen begin of screen scr.
??? ??? ??? ??? ??? ? ? ? ? ? ? ? ........
??? ??? ??? ?????? ? ? ?? ? selection-screen end of screen scr.
???????????????????? ? ? (2)selection-screen-screen begin of screen scr as subscreen.
??? ??? ??? ?? ? ? ?? ?? (3)selection-screen begin? of block block.
??? ??? ??? ??? ??? ? ? ? ?? ? ............
??? ??? ??? ??? ?????????? selection-screen end of bleck.
?
?
sap屏幕事件的控制
?
?? PAI:Process After Input在屏幕數(shù)據(jù)處理之前。
?? PBO:Process Before Output:在處理完之后。
??
?? initialization事件:在屏幕未顯示之前
? ?? ? 例子:
? ? ? ? parameters qual_day type d default sy-datum.
????? ? initialization.
????? ? ? ? qual_day + 6(2) = '01'.
???? ? ? ?? qual_day = qual_day - 1.
??
?? start-of-selection事件:在單擊[執(zhí)行]按鈕后觸發(fā)該事件
? ? ?? 例子:
? ? ?? start-of-selection.
??????? ?? write: 'date:',qual_day.
?
?? end-of-selection事件:在所有數(shù)據(jù)處理完成,但輸出屏幕還未顯示之前[主要應(yīng)用于一些執(zhí)行結(jié)果的檢驗等]
?? ? ? 例子:
? ?? ? end-of-selection.
?????? ? ?? if qual_day <> syst-datum.
?????????????? write: 'Today:', syst-datum.
?????? ? ?? endif.
?
?? 屏幕事件的中止
? ?? 1)exit: 中止某一事件模塊。
? ?? 2)reject:功能與exit基本一致
? ?? 3)stop:強制中止所有事件
總結(jié)
以上是生活随笔為你收集整理的sap屏幕元素与事件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: REUSE_ALV_GRID_DISPL
- 下一篇: abap子程序