cancel
Showing results for 
Search instead for 
Did you mean: 

When calling SAP SCRIPT from function module, variables are not passing

Former Member
0 Kudos

HI All,

I need to pass some variable to SAP SCRIPT from Function module, basically my print program is written inside a function module,

everything is fine but vriables are not passing properly.

appreciate your expert ideas when sap script is developed inside function module;

thank you very much

Iver

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

I solve the problem following previous comments, this is the code:

in FM:

in the control program i fill de variables and add the TDPROGRAM value when open the form in "Options":

My Variables are printing ok!

Regards

Former Member
0 Kudos

Hi

The SAPSCRIPT can see the global variable of driven program or the program set in OPTION-TDPROGRAM (it's field of import parameter OPTION of fm OPEN_FORM)

The parameters of FM interface are local by default, so they can't be used by SAPSCRIPT, but they become global just as Madhukar Shetty said.

Max

Former Member
0 Kudos

Hi,

In the function module follow the path

goto ( in menu )

EDIT-->Interface --> Globalize parameters.

this will solve your problem , this will make all the paramater decalared in FM as Global parameter.

Regards,

Madhukar Shetty

Former Member
0 Kudos

Check whether the variable is declared globally in the driver program. The variables which are declared globally can only be passed to the script.

Edited by: Jeniphin on Nov 26, 2010 4:25 AM

venkat_o
Active Contributor
0 Kudos

Hi,

What do you mean by properly?

<li>If you declare a variable like below in function module.

DATA:var_001 TYPE char3.

Variable should be used in script editor as below.

/: &var_001&

Regards,

Venkat.O