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

Problem in data printing in SAP Script

Former Member
1,961

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
Read only

asik_shameem
Active Contributor
1,344

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
Read only

brad_bohn
Active Contributor
0 Likes
1,344

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

Read only

Former Member
0 Likes
1,344

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.

Read only

asik_shameem
Active Contributor
1,345

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.

Read only

0 Likes
1,344

Thank you so much..

Read only

1,344

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

Read only

Former Member
1,344

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

Read only

Former Member
0 Likes
1,344

Hi all,

Thank u for your valuable suggestions.

@ Ashik Shameem

Thank u boss your suggestion resolved my problem.

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