Question

I don't quite understand how the TABLES statement works in ABAP. From a few example codes I've seen that the tablename afther the statement is an already existing dictionary structure. Is this the only way it can be used? Because I'm never sure which structure it is that I need.

And once it is declared how do I pass this to the actual screen? I wish it were as straight forward as the HIDE method, I can't get my head around this.

Was it helpful?

Solution

The tables statement just provides you with a single-line work area of the dictionary structure that you specify. It allows you to use fields of the structure as select-options and make the structure of the table available as a variable in your program.

If you are trying to write the structure to an abap list you could use it as follows:

tables: aufk.

select single * from aufk into aufk
  where aufnr = some_order_number.  

"I'm pretty sure the into clause is optional 
"because of the tables statement, but including it to be explicit.

write / aufk.

If you are trying to display the field using ABAP dynpro, you should make sure that you read the field in the PBO and add the field(s) to the screen from the dictionary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top