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: 

Global Variable in a User Exit

Former Member
0 Kudos

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

Mohamed_Mukhtar
Active Contributor
0 Kudos

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

Mohamed_Mukhtar
Active Contributor
0 Kudos

Hi Bala,

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

Thanks

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

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,

Former Member
0 Kudos

Hi Bala,

Did u try the Memory Export/Import option?

Regards,

Sudeesh Soni

Former Member
0 Kudos

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..?

0 Kudos

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

0 Kudos

Yes Sudeesh.

0 Kudos

Hi Bala,

Which UserExit are u using?

Regards,

Sudeesh Soni