请提供SAP输出采购申请程序
时间: 2023-05-25 08:06:46 浏览: 102
以下是SAP输出采购申请程序的代码:
REPORT Z_OUTPUT_PUR_REQ.
*Declaration of data variables
DATA: i_eban TYPE STANDARD TABLE OF eban,
wa_eban TYPE eban,
it_mara TYPE STANDARD TABLE OF mara,
wa_mara TYPE mara.
*Selection screen
PARAMETERS: p_matnr TYPE matnr,
p_werks TYPE werks.
*Start of selection
START-OF-SELECTION.
*Read data from table MARA based on selection screen input
SELECT * FROM mara INTO TABLE it_mara WHERE matnr = p_matnr AND werks = p_werks.
*Check if material is valid
IF sy-subrc EQ 0.
*Valid material, read data from table EBAN
SELECT * FROM eban INTO TABLE i_eban WHERE banfn EQ wa_mara-banfn AND werks = p_werks AND bstyp = 'F'.
*Loop through data and print output
LOOP AT i_eban INTO wa_eban.
WRITE: / wa_mara-matnr, wa_eban-banfn, wa_eban-menge, wa_eban-meins.
ENDLOOP.
ELSE.
*Invalid material, display error message
MESSAGE 'Invalid Material entered' TYPE 'E'.
ENDIF.
*End of program
END-OF-SELECTION.
相关推荐
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)