ABAP简单屏幕编程ABAP简单屏幕编程.doc
文本预览下载声明
ABAP简单屏幕编程1. 创建一个程序
输入Title
Type:一般创建的时候选择Module Pool。但是为了测试方便,我这里就选择Executable program。
点Save
选择Package : $TMP
选择Local Object(此时不产生请求号)
2. 创建如下的代码:
REPORT ZSCREEN.parameters: pa_anum type sbook-agencynum.data wa_booking type sbc400_booking.*workarea for single booking to be changeddata:wa_sbook type sbook.data: w_sbook type sbook.*workarea for dynprotables sdyn_book.*variable for function code of user actiondata: ok_code like sy-ucomm.
start-of-selection.set pf-status LIST.set titlebar LIST.
*selecting data using a dictionary view to get the data from sbook* and the customer name from scustomselect carrid connid fldate bookid customid namefrom sbc400_bookinginto corresponding fields of wa_bookingwhere agencynum = pa_anum.
if sy-subrc = 0.write: / wa_booking-carrid color col_key,wa_booking-connid color col_key,wa_booking-fldate color col_key,wa_booking-bookid color col_key,wa_booking-name.hide: wa_booking-carrid,wa_booking-connid,wa_booking-fldate,wa_booking-bookid,wa_booking-name.endif.endselect.clear wa_booking.
at line-selection.select single *from sbookinto wa_sbookwhere carrid = wa_booking-carridand connid = wa_booking-connidand fldate = wa_booking-fldateand bookid = wa_booking-bookid.
if sy-subrc = 0.move-corresponding wa_sbook to w_sbook.* move wa_booking-name to sdyn_book-name.call screen 100.else.message id BC400 type S number 047 with wa_booking-carrid.endif.
3. 如图:
4. 接下来创建状态栏
在程序的名称上右键-Create-GUI Status
输入Status and Short Text。Status type选择“Normal Screen”
5. 输入Pick,并双击出现如下对话框,选择第一个Radiobutton Static text,回车(确定)
6. 输入Function Text,选择Icon Name的图标,回车(确定)。
7. 在Function Key中分别输入如下内容:
8. 在Application Toolbar中输入对应的文字,然后一直按确定。
9. 激活,这样GUI Status就创建完成。
10. 在左边的GUI Status上按右键,再创建一个GUI Status,其余步骤和上一个步骤相同。
创建完成后的效果如下:
11. 激活,保存
12. 创建GUI Title
在程序的名称上右键-Create-GUI Title
输入Title Code and Title,回车(确定)。
13. 激活
14. 再创建一个GUI Title
在GUI Title上右键Create
显示全部