马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
【abap4 SELECTION-SCREEN】
BC400 USER Dialog : SELECTION SCREENS 涉及内容: 概念: PARAMETERS
-- SINGLE FIELDS SELECT-OPTION
--- VALUE SETS 事件:INITIALIZATION AT
SELECTTION-SCREEN 系统参数:MESSAGE 格式命令: ***注:程序显示行号参考最下图 SAMPLE 1 :SAPBC400DDD_SELECT_SINGLE *&---------------------------------------------------------------------* *& Report
SAPBC400DDD_SELECT_SINGLE
* *&
reading form database = SELECT SINGLE
* *&---------------------------------------------------------------------* REPORT
sapbc400ddd_select_single
. * workarea for datas from the database DATA wa_scarr TYPE scarr. PARAMETERS pa_car TYPE s_carr_id. START-OF-SELECTION. * reading from database
SELECT SINGLE * FROM scarr
INTO CORRESPONDING FIELDS OF wa_scarr
WHERE
* specify all key fields in WHERE clause * client is specified by the system
carrid = pa_car.
IF sy-subrc = 0.
* Output
WRITE: / wa_scarr-carrid,
wa_scarr-carrname,
wa_scarr-currcode.
else .
write: / text-001 color col_negative.
ENDIF.
SAMPLE 2:SAPBC400UDS_SEL_SCREEN *&---------------------------------------------------------------------* *& Report
SAPBC400UDS_SEL_SCREEN
* *&---------------------------------------------------------------------* REPORT
sapbc400uds_sel_screen. CONSTANTS: actvt_display TYPE activ_auth VALUE '03'. DATA: wa_flight TYPE sbc400focc,
wa_sbook
TYPE sbook.
PARAMETERS: pa_car like wa_flight-carrid. * Data field for complex restrictions applied to connection id SELECT-OPTIONS: so_con FOR wa_flight-connid. * First event processed after leaving the selection screen AT SELECTION-SCREEN.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD pa_car
ID 'ACTVT'
FIELD actvt_display.
IF sy-subrc <> 0.
* Show selection screen again and show message in status bar
MESSAGE ID 'BC400' TYPE 'E' NUMBER '045' WITH pa_car.
ENDIF.
START-OF-SELECTION.
SELECT carrid connid fldate seatsmax seatsocc FROM sflight
INTO CORRESPONDING FIELDS OF wa_flight
WHERE carrid = pa_car
AND
connid IN so_con.
wa_flight-percentage =
100 * wa_flight-seatsocc / wa_flight-seatsmax.
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-seatsocc,
wa_flight-seatsmax,
wa_flight-percentage,'%'.
HIDE: wa_flight-carrid, wa_flight-connid, wa_flight-fldate.
ENDSELECT.
CLEAR wa_flight.
AT LINE-SELECTION.
IF sy-lsind = 1.
WRITE: / wa_flight-carrid, wa_flight-connid, wa_flight-fldate.
ULINE.
SKIP.
SELECT bookid customid custtype class order_date
smoker cancelled loccuram loccurkey
FROM sbook INTO CORRESPONDING FIELDS OF wa_sbook
WHERE carrid = wa_flight-carrid
AND
connid = wa_flight-connid
AND
fldate = wa_flight-fldate.
WRITE: / wa_sbook-bookid,
wa_sbook-customid,
wa_sbook-custtype,
wa_sbook-class,
wa_sbook-order_date,
wa_sbook-smoker,
wa_sbook-cancelled,
wa_sbook-loccuram CURRENCY wa_sbook-loccurkey,
wa_sbook-loccurkey.
ENDSELECT.
ENDIF.
CLEAR: wa_flight, wa_sbook.
注意: 1、 各类事件出发的时间 2、
选择屏幕也是screen program 屏幕的一种 |