有时会查不到,此时需要 google 一下
对应程序,或tcode + bapi
tcode MD04 MD_STOCK_REQUIREMENTS_LIST_API
2024年3月11日 星期一 更新
BAPI_MATERIAL_STOCK_REQ_LIST 这个 bapi 可以替代 MD_STOCK_REQUIREMENTS_LIST_API,为什么要替代,因为用 rfc 调用的时候,MD 开头的报错,因为调用的 rfc 有module 在 blacklist
Blacklisted RFC calls
When calling a blacklisted RFC from an external application you can get similar dump with reference to OSS note 2295840 – Outbound / Inbound calls from external to RFC FM are blocked when the FM is blacklisted and the UCON-Check is active. This note itself is old and refers to newer OSS note 2416705 – Outbound / Inbound calls from external to RFC FM are blocked when the FM is blacklisted using Blacklist Object. You can run program RS_RFC_BLACKLIST_COMPLETE to see which function modules are blacklisted:
What to do when you hit a blacklisted item?
The best approach is to avoid doing what you did and look for the functional alternative provided by SAP. Search for the correct simplification item OSS note. In almost all cases SAP provides a solution.
https://www.saptechnicalguru.com/s4hana-blacklist/
Normally there is a need to get stock requirements information for certain selected materials and plants. After scouting through various answers in sap forums and blogs we knew we had to use the FM MD_STOCK_REQUIREMENTS_LIST_API or BAPI_MATERIAL_STOCK_REQ_LIST to get results similar to MD04 transaction.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/alternative-to-md-stock-requirements-list-api-to-get-item-in-mrp-document/ba-p/13446829
更详细的解决方案
With SAP S/4HANA® version 1511 SP02 and higher, SAP uses the UCON Blacklist functionality to block certain RFC function modules. The reason for this is that many API calls (BAPIs) have been changed, and may not be backwards compatible. So the result could be that inconsistent or wrong data is being committed to the database. In order to avoid such an issue without even being recognized by the client caller (e.g. TCRA4S), this blacklist was introduced to block all APIs which have been changed in an incompatible way.
TCRA4S Version 18.1 and higher is fully compatible with the above mentioned API changes done by SAP. However the UCON Blacklist prevents external applications such as TCRA4S to work properly with SAP S/4HANA®.
When a blocked remote enabled function module (RFC FM) is called from an external client on a SAP S/4HANA® system, an error is raised and shown to the caller with the following error text:
“UCON RFC Rejected; Called Function :; Caller SID :; Caller Program :”.
Example from TCRA4S:
Error Message: RFC code = 4 (RFC_ABAP_MESSAGE) :: Incompatible Call Rejected, see note 2295840; Called Incompatible Function :RFC_GET_SAP_SYSTEM_PARAMETERS; Caller Program :nwpipe; Caller Dest. :demchdc81!
There are multiple options to avoid this error:
Call a non-blacklisted function from SAP in case SAP provides one with the same or similar functionality
Create an ABAP wrapper function for the blacklisted call
Deactivate the UCON blacklist in SAP
Remove the function call from the SAP UCON blacklist
More information and a list of BAPIs being blocked by this blacklist can be downloaded via the following OSS note:
#2259818 - RFC enabled Function Modules with incompatible signature change compared to its version in ERP are blocked from external access
查询 BOM 替代料
进入 MAST(Material to BOM Link)表,批量查询料号对应的 BOM STLNR
MATNR material
进入 STPO (BOM item) 表
根据查询到的 STLNR(BOM) + IDNRK(BOM component) + 当天日期 查出 POSNR (BOM item number)
再根据查出的 POSNR + STLNR + 当天日期 查出对应的 BOM 替代料,批量查询时注意去重
参考
https://blog.csdn.net/weixin_45499651/article/details/104050517
SAP ABAP 各模块的BAPI函数汇总
https://blog.csdn.net/yishangbing/article/details/133735340