Application Development 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: 

please explain the following code..

Former Member
0 Kudos

i have to made some changes in material master..

i foung following code

DATA: h_name(30).

FIELD-SYMBOLS: <h_aktvstatus>.

  • Maintained views are retrieved

h_name = '(SAPLMGMU)aktvstatus'.

ASSIGN (h_name) TO <h_aktvstatus>.

r_pstat_m = <h_aktvstatus>.

please explain it specially "'(SAPLMGMU)aktvstatus'." part

thanks in advance ..

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

see this below code.

so that u can understand how ur code works.

data:var(10) value 'abcd'.

data:abcd(10) value 'xyz'.

field-symbols:<fs> type any.

assign (var) to <fs>.

write:/ <fs>."here it will give value of 'abcd'

rgds,

bharat.

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

What is happening here, is that the code is trying to access a variable field within the callstack and not within the local program memory, this is a little trick that we do when working within user exits and we don't have a specific field or internal table being passed to the exit's funciton module. Here the program name is specified and then immediately, the variable name, or this could be an internal table name as well. By assign to a field symbol, you can then gain access to this variable from your program, which of course could be very dangerous, so be careful.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

see this below code.

so that u can understand how ur code works.

data:var(10) value 'abcd'.

data:abcd(10) value 'xyz'.

field-symbols:<fs> type any.

assign (var) to <fs>.

write:/ <fs>."here it will give value of 'abcd'

rgds,

bharat.