关于在Extractor BADI逻辑中按公司代码过滤删数的可行性咨询
DELETE c_t_data WHERE bukrs NE t_cc Work for 0FI_GL_14 Extractor BADI? Hey there! Great question about optimizing your 0FI_GL_14 extractor performance by filtering records in the BADI. Let's break down whether this approach is feasible:
Core Feasibility
Yes, this DELETE statement will work for your scenario, and it's a solid performance-focused choice:
- The syntax is valid ABAP for filtering internal tables. Assuming
t_ccholds the correct company code value, it will remove all records fromc_t_datawhere thebukrsfield doesn't match your target company code. - By trimming down the dataset early in the extraction process, you reduce the amount of data passed downstream (to BW or other systems), which directly boosts performance—exactly what you're aiming for.
Critical Things to Verify
To avoid unexpected behavior, make sure you check these details:
- Type Matching: Ensure
t_ccuses the exact same data type asc_t_data-bukrs(which isTYPE bukrs, a 4-character string). Mismatched types can cause implicit conversions that lead to incorrect filtering (e.g., a numeric type fort_ccmight not match the CHAR4bukrsvalues properly). - Variable Initialization: Double-check that
t_ccis properly populated before running theDELETEstatement. Ift_ccis empty (space), this command will delete every record wherebukrsis not empty—probably not what you want. Always confirmt_ccis set to your target company code (e.g., via configuration tables, selection parameters, or hardcoded values if appropriate). - BADI Execution Timing: Ensure you're running this logic in the correct BADI method. For 0FI_GL_14, you'll want to use the
MODIFY_DATAmethod ofRODPS_BADI(or the relevant extractor-specific BADI), which triggers after the initial data extraction but before the data is sent to the target system. This ensures you're filtering the full extracted dataset.
Optional Performance Tweak
If you're working with ABAP 7.40 or higher, you can use the newer inline syntax for even cleaner code (though the original statement is already efficient):
c_t_data = VALUE #( FOR wa IN c_t_data WHERE ( bukrs = t_cc ) ( wa ) ).
This creates a new internal table containing only matching records, which can be slightly more readable than a DELETE command, but both approaches offer similar performance.
内容的提问来源于stack exchange,提问作者Rubane

