ABAP中文示例2
*&---------------------------------------------------------------------*
*& Report Z_TEST03
*&
*&---------------------------------------------------------------------*
*&Author : chenyanjun
*&
*&---------------------------------------------------------------------*
REPORT Z_TEST03 NO STANDARD PAGE HEADING.
*----------------定義工廠表所需資訊-----------------*
DATA: BEGIN OF IT_T001W OCCURS 0,
WERKS LIKE T001W-WERKS ,
NAME1 LIKE T001W-NAME1 ,
PFACH LIKE T001W-PFACH ,
END OF IT_T001W.
*---------------定義總庫存額資訊------------------------*
DATA: BEGIN OF IT_S032 OCCURS 0,
WBWBEST LIKE S032-WBWBEST,
WERKS LIKE S032-WERKS,
END OF IT_S032.
*--------------------定義結果資料資訊-----------------------------*
DATA: BEGIN OF IT_RESULT OCCURS 0,
NAME1 LIKE T001W-NAME1,
PFACH LIKE T001W-PFACH,
WBWBEST LIKE S032-WBWBEST,
END OF IT_RESULT.
DATA PWBWBEST TYPE P DECIMALS 3.
SELECT-OPTIONS S_WERKS FOR IT_T001W-WERKS.
*--------------------輸出面眉HEADING-------------------*
TOP-OF-PAGE.
PERFORM FRM_HEAD_OUTPUT .
*------------------START-OF-SELECTION-------------*
START-OF-SELECTION.
PERFORM FRM_GETDATA.
PERFORM FRM_PROCESS.
*------------------END-OF-SELECTION---------------*
END-OF-SELECTION.
PERFORM FRM_OUTPUT.
*&---------------------------------------------------------------------*
*& Form FRM_HEAD_OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* *----------------------------------------------------------------------*
FORM FRM_HEAD_OUTPUT .
ULINE.
WRITE: '|' , (30) '電廠' CENTERED,'|', (25) '裝機容量(kwh)' CENTERED,'|',
(28) '庫存資金(萬元)' CENTERED, '|' , (28) '庫存資金佔用額(萬元/kwh)' CENTERED , '|'.
ULINE /.
ENDFORM. " FRM_HEAD_OUTPUT
*&---------------------------------------------------------------------*
*& Form FRM_GETDATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* *----------------------------------------------------------------------*
FORM FRM_GETDATA .
SELECT * FROM T001W
INTO CORRESPONDING FIELDS OF TABLE IT_T001W
WHERE FABKL EQ 'ZT'.
SELECT * FROM S032
INTO CORRESPONDING FIELDS OF TABLE IT_S032
WHERE WERKS IN S_WERKS.
ENDFORM. " FRM_GETDATA
*&---------------------------------------------------------------------*
*& Form FRM_PROCESS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* *----------------------------------------------------------------------*
FORM FRM_PROCESS .
LOOP AT IT_S032.
CLEAR IT_RESULT.
READ TABLE IT_T001W WITH KEY
WERKS = IT_S032-WERKS.
IT_RESULT-NAME1 = IT_T001W-NAME1.
IT_RESULT-PFACH = IT_T001W-PFACH * 10000.
IT_RESULT-WBWBEST = IT_S032-WBWBEST / 10000.
* IT_RESULT-PWBWBEST = IT_RESULT-WBWBEST / IT_RESULT-PFACH.
COLLECT IT_RESULT.
ENDLOOP.
ENDFORM. " FRM_PROCESS
*&---------------------------------------------------------------------*
*& Form FRM_OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* *----------------------------------------------------------------------*
FORM FRM_OUTPUT .
LOOP AT IT_RESULT.
PWBWBEST = IT_RESULT-WBWBEST * 10000 / IT_RESULT-PFACH.
WRITE: '|', (30) IT_RESULT-NAME1 , '|' , (25) IT_RESULT-PFACH CENTERED , '|' ,
(28) IT_RESULT-WBWBEST, '|', (28) PWBWBEST , '|'.
ULINE /.
ENDLOOP.
ENDFORM. " FRM_OUTPUT
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8356764/viewspace-928982/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Yii2事件示例解析事件
- Ansible Jinja2 使用及示例
- ROS2中使用Gtes示例ROS
- ROS2中使用 Gtes示例ROS
- Pandas-2-2-中文文件-二十-
- Pandas-2-2-中文文件-二十二-
- AWS EC2 上安裝 Docker 的示例Docker
- object2vr中文版ObjectVR
- SAP ABAP Netweaver 裡的 ABAP 會話概念會話
- AP316C I2C驅動示例
- SqlAlchemy-2-0-中文文件-二十-SQL
- SqlAlchemy-2-0-中文文件-二-SQL
- SqlAlchemy-2-0-中文文件-十三-SQL
- SqlAlchemy-2-0-中文文件-十六-SQL
- Implement CGLIB in ABAPCGLib
- escape in ABAP and JavaScriptJavaScript
- JavaScript and Ruby in ABAPJavaScript
- 數學建模例題例 2.26 陣列生成示例2陣列
- SAP ABAP RFC介面通用日誌工具:abap fm logger
- SAP ABAP Gateway Client 的 ABAP 實現,重用 HTTP ConnectionGatewayclientHTTP
- 如何使用 ABAP 程式消費 SAP ABAP OData 服務
- Koa v2.x 中文文件 APIAPI
- CoCos2dx開發:中文亂碼
- ABAP Netweaver 和 ABAP Platform 這兩個名詞的辨析Platform
- Standard ABAP Debugger 和 Classic ABAP Debugger 的實現差異
- Log4j2 + Maven的配置檔案示例詳解Maven
- ABAP文件生成工具
- null in ABAP and nullpointer in JavaNullJava
- GEE呼叫Sentinel-2 MSI L2A資料集 示例程式碼解析筆記筆記
- mac下載工具:JDownloader 2 for Mac 中文版Mac
- 火車山谷Train Valley 2 中文遊戲攻略AI遊戲
- 示例解讀 Python 2 和 Python 3 之間的主要差異Python
- Rust 程式設計影片教程(進階)——018_2 互斥器示例Rust程式設計
- 從 ABAP Netweaver 到 ABAP Platform,我們一直在努力Platform
- ABAP初學者如何系統地學習ABAP程式設計?程式設計
- 聊聊C語言和ABAPC語言
- ABAP巨集的除錯除錯
- ABAP 7.55 新特性 (一)
- SAP ABAP呼叫WEBAPI(一)WebAPI