Skip to Content
0
Former Member
Feb 26, 2007 at 10:27 AM

Printing variable with same name but different contents in different elemen

15 Views

Hello All,

I am developing a SAP Script where there is a variable, say lv_var1, which is used in several elements in same window. What I am doing is assigning some value to this variable and then calling write_form function module for the corresponding

window/element.

e.g.

lv_var1 = 1.

perform write_form using win1 ele1. * This sub contains the FM write_form

lv_var1 = 2.

perform write_form using win1 ele2.

I need to get the value 1 in element ele1 and value 2 in element ele2.

But I am getting value 2 in both cases. I debugged and found that the script will

print the values at the time of end_form and so it is taking latest values of the variables.

Is there any way to avoid this other than using 2 variables with different names.

Regards

Indrajit.