Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

replacement for LOCAL

Former Member
0 Likes
534

Hi,

I need the replacement for the keyword LOCAL......

some how i found the replacement (by my own) but it is not working properly...

the replacement is data declaration for the local...

Example program for local...

REPORT ZTEST_LOCAL_EXAMPLE.

DATA text TYPE string VALUE 'Global text'.

WRITE / text. " Global text

PERFORM subr1.

WRITE / text. " Global text

FORM subr1.

LOCAL text.

*data text type string. "replacement for local

text = 'Text in subr1'.

WRITE / text.

PERFORM subr2 USING text.

WRITE / text.

ENDFORM.

FORM subr2 USING para TYPE string.

LOCAL para.

para = 'Text in subr2'.

WRITE / text.

ENDFORM.

Here it is local statement and the replacement statement... but the replacement is not working properly....

Thanks

vishnu. R

3 REPLIES 3
Read only

matt
Active Contributor
0 Likes
491

Output

Global text     
Text in subr1   
Text in subr2   
Text in subr1   
Global text     

Output with replacement

Global text      
Text in subr1    
Global text      
Text in subr1    
Global text      

Looks fine to me. What do you expect?

matt

Read only

Former Member
0 Likes
491

just look closely the output it gets varies.........

actually the local is obsoleted and i need the replacement for that...

if u use the replacement the output and the functionality should not get change...

got me................ !!!!!!!................

Read only

Former Member
0 Likes
491

local is a keyword used instead of tables statement

it is mandatory to use that when the work areas of subroutine and the call programs are different

and u can use tables statements if the work areas are same.