2013 May 16 7:34 AM
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.
2013 May 16 7:56 AM
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
2013 May 16 7:43 AM
Hi,
Whether tha variable &gu_hu& is defined before using it in script?
Thanks & Regards,
Swarna
2013 May 16 7:54 AM
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
2013 May 16 7:55 AM
&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.
2013 May 16 7:56 AM
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
2013 May 16 8:26 AM
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.
2013 May 16 9:07 AM
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.
2013 May 16 11:33 AM
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.
2013 May 16 11:55 AM
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
2013 May 16 12:23 PM
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.
2013 May 16 12:33 PM
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?
2013 May 16 12:47 PM
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
2013 May 17 7:38 AM
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.
2013 May 17 1:28 PM
Thanks Arindam. The issue is resolved. I used the PERFORM operation in the script for getting the value from FM.
Thanks.
2013 May 17 1:35 PM
Great!! then mark as answered and close the thread.
Cheers,
Arindam
2013 May 17 1:52 PM