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

SAP Script and variable declaration

Former Member
0 Likes
1,936

Hi all,

I am declaring a variable at the start in the Main Window of a SAp Script using DEFINE and assigning values to it depending on certain conditions.

Is the variable accessible in the other windows of the script as i need to print information based on the value of the variable taken from the main window.

Pls suggest.

Thanks,

Stock

5 REPLIES 5
Read only

Former Member
0 Likes
821

NO, It will not be accessible in other windows.

In such cases , you better define in the Driver program itself, so that it is visible across all the windows.

Regards,

Ravi

Read only

Former Member
0 Likes
821

hi,

Variable defined in the main window using DEFINE statement is available in other variable windows of the same script. so, u can print that variable in other windows

Read only

Former Member
0 Likes
821

Hi,

yes you can use variable in other windows.

regards,

ananth

Read only

Clemenss
Active Contributor
0 Likes
821

Hi stock,

simply said: A variable defined in SAPScript can be used as soon as it has been defined. That means you have to take into account the processing order. Use SAPScript debugger to see the procesing orde of your pages and windows.

Regards,

Clemens

Read only

Former Member
0 Likes
821

You are assigning values to the variable using some conditions.

Are you using any

IF < condition>

Some code.

( assigning values to the variable.)

ENDIF.

It does not work.

Since IF...ENDIF does not work in script editor.

Otherwise,The variable declared in Main window can be used in other windows of the same script.

I Hope now You can get free from the problem.

<b>Reward points if it helps you.</b>

Regds,

Rama chary.Pammi