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

Error -Unknown symbol in script

Former Member
0 Kudos
3,282

Hello Experts,

We are getting error in one of custom developed script where we provide Print control code for printing barcode for document number. While doing so the document number does not appear in output layout. When the syntax check is done in script with Texts, it is giving 'Unknown symbol &gu_hu&'.

The print program is the FM from which the script is called.

We checked in the forum, but did not get any inputs.

Please provide inputs on how to resolve this.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

arindam_m
Active Contributor
0 Kudos
2,047

Hi,

Check if the variable is visible in the script you can select the available variables from the INCLUDE symbols options present in the menu list.

Check the link below:

http://help.sap.com/saphelp_40b/helpdata/en/f4/b4a0b3453611d189710000e8322d00/content.htm

Cheers,

Arindam

15 REPLIES 15
Read only

former_member217544
Active Contributor
0 Kudos
2,047

Hi,

Whether tha variable &gu_hu& is defined before using it in script?

Thanks & Regards,

Swarna

Read only

sandeep_katoch
Contributor
0 Kudos
2,047

Hi Mohammed,

This is quiet a simple error. This comes when you have used a variable in script that is neither passed in FM nor is passed via the driver program.

Try to search the driver program for the variable.

If this is the variable that you are using for printing the document number than obviously it willnot be printed. But I strongly recommend you to debug the script once. just run the report rstxdbug and sript debugger will be on .

Run the report and debug and check why the document number is not getting printed.

regards,

Sandeep Katoch

Read only

Former Member
0 Kudos
2,047

&GU_HU& shud be in capital letters.

check ur script and change it to capital letter.

declare &GU_HU& in driver program of script.

I think it is not defined in driver program. u can check window in which it is appearing check whether &gu_hu& is present in script and if it is present then check whether it is defined in driver program or in script or not.



Read only

arindam_m
Active Contributor
0 Kudos
2,048

Hi,

Check if the variable is visible in the script you can select the available variables from the INCLUDE symbols options present in the menu list.

Check the link below:

http://help.sap.com/saphelp_40b/helpdata/en/f4/b4a0b3453611d189710000e8322d00/content.htm

Cheers,

Arindam

Read only

Former Member
0 Kudos
2,047

Hello All,

Thanks for your quick response.

I posted the query after checking the below.

I have debugged the script and came to know the value for gu_hu is not available in script and hence it is not printing the value.

Also I have declared the variable in print program(print program am using is a function module).

I have checked the syntax error in script using include text only and got to know the error.

When the driver program is normal print program i.e.report, it is displaying the value and script is able to identify the variable, but when I run the same from FM it is not displaying the value, but throwing the error.

Thanks.

Read only

Former Member
0 Kudos
2,047

if you have encountered the error in script but not while printing or while chcking print preview then u can simply ignore this error.

u can create import parameter for that variable.

try this n check.

Read only

Former Member
0 Kudos
2,047

Thanks Arindam.

The error is no more in script. I inserted the variable in script using Insert symbol from program in CAPs. But when I execute the FM, the value is not passed to script. I checked in debug mode and it does'nt have that value.

Thanks.

Read only

Former Member
0 Kudos
2,047

Hello Jaffer,

 

You wrote "the value and script is able to identify the variable".

When there is no problem while running the print program then why again you are trying to execute the FM

without passing the value of &GU_HU& in FM? does your FM has "&GU_HU&" this variable? or &GU_HU& is getting passed directly from print program to the script.Clarify

Read only

Former Member
0 Kudos
2,047

Hello Afzal,

We have to trigger the script from FM not from report. I was just saying if I call script in report the value for variable is passed to script and printing the value, but while calling the same from FM, the value is not passed to script.

Thanks.

Read only

Former Member
0 Kudos
2,047

Hello,

       Your variable has nothing to do with the FM. Do you really want to print the value of your variable after executing the FM? Then you have edit the function moudle. By the way how the end user is getting the print of script by running the FM?

Read only

arindam_m
Active Contributor
0 Kudos
2,047

Hi,

You must pass the variable or populate it in program and it must be a global variable in the driver program of the script. Else it must be populated with Perform calls in script. Check the link below:

http://help.sap.com/saphelp_40b/helpdata/EN/d1/803279454211d189710000e8322d00/content.htm

With this you can populate the value in any program perform.

Cheers,

Arindam

Read only

Former Member
0 Kudos
2,047

Hello Afzal,

The end user is getting print of script when the FM is executed. The input to FM say is '12345' and FM modifies the value into '12345ABC' and the same value needs to be printed in the barcode.

The same is getting printed when script is called from report program, but does not when it is called from FM.

Thanks.

Read only

Former Member
0 Kudos
2,047

Thanks Arindam. The issue is resolved. I used the PERFORM operation in the script for getting the value from FM.

Thanks.

Read only

arindam_m
Active Contributor
0 Kudos
2,046

Great!! then mark as answered and close the thread.

Cheers,

Arindam

Read only

Former Member
0 Kudos
2,046

Already done. Thank you.