Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3177

Re: Access to local variables in calling procedure

$
0
0

So, in the beginning implicit - the Variable is unknown  - as it is declared with DATA statement, after the Implicit enhancement.

 

Yes, the variable is unknown at compile time. But at runtime you can access it dynamically with another field-symbol trick.

 

So something like this is possible.

2015-07-18 09_16_49-DV2(1)_010 ABAP Editor_ Display Report Z_TEST_DIRTY_ASSIGN.png

 

This is possible due to the fact that in ABAP local variables are created when a subroutine/method is entered.

Validity and Visibility

 

For me this is just some kind of academic example. One should see this only as a last resort.

This is a very fragile approach, because at the next upgrade SAP might have refactored (renamed or removed) the lv_local_to_this variable and you would hardly detext this until it leads to logical errors during integration testing. But of course there are ways to detect this in the BADI method...


Viewing all articles
Browse latest Browse all 3177

Trending Articles