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

Global Variable in a User Exit

Former Member
0 Likes
3,091

Folks, I have a small problem. I have a Exit and there are several includes with in the exit. Due to modularization they have written Forms in One Include and actual call is happening at someother include. I need to code in a logic based on a value of variable. The variable is flag which is updated at Form Include.

I couldnt add the field at the top include and it does not allow me to due a Implicit enhancement at Beginning or the end.

Can you please suggest how to add this field which could be visible through out the function group.

Thanks,

Balakumar

1 ACCEPTED SOLUTION
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
1,833

Hi Bala,

One option is to export that flag into the memory and import from same memory in the next include.

Thanks

9 REPLIES 9
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
1,834

Hi Bala,

One option is to export that flag into the memory and import from same memory in the next include.

Thanks

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,833

I couldnt add the field at the top include

Which Enhancement/Customer-Exit are you using, most exit function groups provide a customer include Z<Xgroup>TOP in L<Xgroup>TOP?

Regards,

Raymond

Read only

0 Likes
1,833

Hi Raymond,

I tried that and when i try to get in to change mode it says.

"Carry out repairs in non-original system only if they are urgent". I couldn't place or change the enhancement with in this include.

Thanks

Balakumar

Read only

0 Likes
1,833

Hi,

Access the variable using dynamic referencing.

constant: field(50) type c value '(program name)flag'.

here program name is main where variable is declared.

  field-symbols: <flag>.

* Assign an individual variable

  assign (field) to <flag>.

if <flag> is assigned.

endif,

Read only

Former Member
0 Likes
1,833

Hi Bala,

Did u try the Memory Export/Import option?

Regards,

Sudeesh Soni

Read only

Former Member
0 Likes
1,833

Hi Sudeesh

I did Import and Export option. But since the logic which is implemented currently i am not sure whether the Export will be called for all the logical possibilities with in the code. Hence it would be better to have a global variable. Is in it..?

Read only

0 Likes
1,833

Hi Bala,

You mean given flag value is getting updated at multiple position in the code and therefor you cant use export option?

Regards,

Sudeesh Soni

Read only

0 Likes
1,833

Yes Sudeesh.

Read only

0 Likes
1,833

Hi Bala,

Which UserExit are u using?

Regards,

Sudeesh Soni