Skip to Content
1
May 24, 2018 at 02:13 AM

Data declaration within IF statement

836 Views

Hi all,

I'm looking at someone else's code where it follows the pattern :

IF x = y.

DATA: lv_abc TYPE i.

.... additional processing...

ENDIF.

ABAP does of course allow the above, but unless it's an inline declaration (which this isn't), I find DATA declaration inside an IF statement a little strange. Any comments on best practice regarding this ?