简体   繁体   中英

How to access a Field in a Dynpro i Added via the Dict in the PAI?

I have the following question:

I have a dypro and added via the layout builder a dict delement: mara-matnr

Now I see it in my element list: 在此处输入图片说明

Now I wanted to know, how to access the value of the matnr in my PAI which looks like this:

MODULE user_command_1000 INPUT.
  " HOW TO ACCESS THE VALUE OF MATNR HERE?
ENDMODULE.

I have to guess what you did to get that far, and I'd strongly recommend not to continue along that road. What I'd rather do is

  • create a new dictionary structure (not a transparent table!) that contains the screen fields you need
  • use the TABLES statement with the structure to declare a global variable in your program or function pool top include
  • place the fields of the structure on the screen, just like you did with the MARA fields in your example
  • use the fields of your global variable in your coding

The way you prepared the screen, you would have to add a global variable named MARA with the structure of the transparent table MARA , probably using the statement TABLES mara. While this is perfectly possible, it's also really dangerous - you could end up changing the database contents inadvertedly, especially since you seem to be rather new to the system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM