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

Retaining value of a variable .

Former Member
0 Likes
1,258

Hi All,

I am trying to enable disable the controls on selection screen depending upon the value of a variable. The value of the variable is getting set in the program.

The program calls a transaction , now when i press the back button from that transaction , i want to show different controls on the selection screen and want to disable the previous controls.

I tried to save the value of the variable to the ABAP memory but its not working .

Please Suggest wht can be done to solve the problem.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
897

Hi,

Use the DATABASE option in the EXPORT / IMPORT statement..to retain the value..

Ex..

EXPORT v_value TO DATABASE indx(ST) ID 'ZMY_VALUE'.

IMPORT v_value FROM DATABASE indx(ST) ID 'ZMY_VALUE'.

Thanks,

Naren

Hi All,

I am trying to enable disable the controls on selection screen depending upon the value of a variable. The value of the variable is getting set in the program.

The program calls a transaction , now when i press the back button from that transaction , i want to show different controls on the selection screen and want to disable the previous controls.

I tried to save the value of the variable to the ABAP memory but its not working .

Please Suggest wht can be done to solve the problem.

5 REPLIES 5
Read only

Former Member
0 Likes
897

Hi,

try to assign the value of the variable

in the at selection screen output..

for ex

initially some X wil be shown in the selection screen..

after executing the program

you are calling a transaction

and take the value from the transaction

by using

get parameter

and pass this value in the at selection screen output..

hope this works,

this is just a suggestion ....

regards,

venkatesh

Read only

0 Likes
897

HI Venkatesh,

Thanks for ur suggestion.

I would like to add something to my question. The variable's value is not getting set in the transaction , i am just setting it 1 by assigning value 1 to the variable n when next time the program loads after clicking on back ,i am checking the value of this variable if it is 1 then i am enabling some different controls. But when program loads again the variable value is again getting set to 0 , so i want to retain this value.

Tell if any method is there for this.

Thanks

Read only

Former Member
0 Likes
897

Hope you are using IMPORT AND EXPORT

EXPORT <variable> TO MEMORY ID 'TD'.

IMPORT <variable> FROM MEMORY ID 'TD'.

Regards,

Vishal

Message was edited by:

Vishal Tyagi

Read only

0 Likes
897

Hi Vishal,

I have tried import n export .its not working

Read only

Former Member
0 Likes
898

Hi,

Use the DATABASE option in the EXPORT / IMPORT statement..to retain the value..

Ex..

EXPORT v_value TO DATABASE indx(ST) ID 'ZMY_VALUE'.

IMPORT v_value FROM DATABASE indx(ST) ID 'ZMY_VALUE'.

Thanks,

Naren