壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 908|回复: 0

sap部分开发笔记4

[复制链接]
发表于 2010/1/8 14:13:15 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服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 2SAPBC400UDS_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 屏幕的一种
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/30 01:29 , Processed in 0.016643 second(s), 16 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表