ABAP技术问询:如何获取事务的参数ID以用于SET PARAMETER ID语句?
Hey there! Let's tackle your questions about SAP transaction parameter IDs, starting with ME23 and then covering the general methods to find any parameter ID you need.
For the ME23 (Display Purchase Order) transaction, the parameter ID linked to the purchase order input field is BES. You can use it in your ABAP code just like you did with MM03:
SET PARAMETER ID 'BES' FIELD '4500000001'. " Replace with your actual purchase order number CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
Here are the most reliable, go-to ways to find the parameter ID for any input field in SAP transactions:
F1 Help + Technical Info (Quickest for most cases)
- Open the target transaction's initial screen (like ME23's main screen).
- Click on the input field you're targeting (e.g., the Purchase Order box).
- Press
F1to pull up the help window. - Click the Technical Information icon (the hammer/wrench icon in the top-right of the help window).
- Look for the Parameter ID field in the popup—this is exactly what you're after.
Inspect the screen via SE80
- Launch SE80, enter the transaction code (e.g., ME23) in the input field, and select "Transaction" from the dropdown.
- Expand the transaction's tree to locate its initial screen (usually nested under the "Screens" folder).
- Double-click the screen to open it, then select the input field in the layout editor.
- Check the Parameter ID property in the screen element's attributes panel.
Check user profile (SU3) for existing parameters
- Go to transaction SU3 and switch to the Parameters tab.
- If you or other users have set default values for the field you care about, you'll see the parameter ID listed here alongside its saved value.
ABAP code query (for bulk or automated checks)
You can directly query SAP's database tables to fetch parameter IDs programmatically. For example, using tables likeDD03L(data element details) orDYNPRO_FIELDS(screen field info). Here's a quick snippet:SELECT SINGLE rollname INTO @DATA(lv_rollname) FROM tstc JOIN dynpro ON tstc.pgmna = dynpro.pgmna AND tstc.dynnr = dynpro.dynnr JOIN dynpro_fields ON dynpro.pgmna = dynpro_fields.pgmna AND dynpro.dynnr = dynpro_fields.dynnr WHERE tstc.tcode = 'ME23' AND dynpro_fields.fldname = 'EBELN'. " EBELN is the field name for purchase order SELECT SINGLE paramid INTO @DATA(lv_paramid) FROM dd03l WHERE rollname = @lv_rollname. WRITE: / 'Parameter ID for ME23 Purchase Order:', lv_paramid.
内容的提问来源于stack exchange,提问作者Anton Pugin

