Application Development 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: 

Problem in data printing in SAP Script

Former Member

Hi All,

I have a output type for which Program,Form Routine and Script name are maintained in the NACE. This output type is used for sending email of script output as PDF file.Now the problem is when i am procesing this output type the values in the internal table are not getting printed in the script.

I found this by activating the debugger in both SAP Script and the Program.While debugging i can see the values in the program but the same is blank in the script.So the OTFDATA is not getting generated and hence the PDF contains no values.BUT the texts which are hardcoded in the SAP SCRIPT they appear in the PDF.

Can anyone please suggest any ideas.

Thanks in Advance.

1 ACCEPTED SOLUTION

asik_shameem
Active Contributor

Hi,

It is a typical issue in script. Here is the solution.

itcpo-tdprogram = sy-repid.
" It should be the program name where you declared your variables

CALL FUNCTION 'OPEN_FORM'
 EXPORTING
...
  OPTIONS = itcpo.

7 REPLIES 7

brad_bohn
Active Contributor
0 Kudos

How are the variables declared? Locally or Globally? How did you reference them in the SAPScript?

Former Member
0 Kudos

What function are you using to print PDF documents? Have you passed the internal table in the function used? If possible please attach code here.

Good Luck.

asik_shameem
Active Contributor

Hi,

It is a typical issue in script. Here is the solution.

itcpo-tdprogram = sy-repid.
" It should be the program name where you declared your variables

CALL FUNCTION 'OPEN_FORM'
 EXPORTING
...
  OPTIONS = itcpo.

0 Kudos

Thank you so much..

Thank you Asik, you are my savior. You should have a statue with a plaque saying: itcpo-tdprogram = sy-repid.

Former Member
0 Kudos

Seenu,

You need to declare the variable globally before the start of selection.

I believe your internal table is declared in a routine, which sapscript cannot take.

declare the same table before start of selection, you will the values in sapscript.

Syed

Former Member
0 Kudos

Hi all,

Thank u for your valuable suggestions.

@ Ashik Shameem

Thank u boss your suggestion resolved my problem.

Once again Thank u all.........