cancel
Showing results for 
Search instead for 
Did you mean: 

smartform printing

Former Member
0 Kudos

Hello,

I have a smartform that has a FAX_PAGE, i want to be able only pull this page out of the smartform.

So i put the startpage to FAX_PAGE but the FM produces an error and the page does not come out.

I debugged my way through and found that at some point its checks a table for the word FAX_PAGE but finds nothing. I looked to see what was in this table and the only entrys were FIRST_PAGE 4 times.

What am i doing wrong? Or does someone have the code i should use to pull this out?

Best Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Lisa,

If you know at which page numbr it is printed.

why dont you use

tdpageslct = '1' in output_options in ur smartform fm

where 1 is the fax_page number

if it runs into many pages u can use '1-'.

Former Member
0 Kudos

Hi,

I tried this today but still nothing happened. But this time the FM did not return an error, it just returned the wrong page, i tried different numbers but no change.

Best regards

Former Member
0 Kudos

a few questions.

Does your fax page have a Main Window

Does it run into many pages or has only 1 page.

When u print it out at what page number does it occur.

How many pages do u have in your smartform

Former Member
0 Kudos

Hi,

It does not have a main window, and it is one page only. When we print out the smartform normally only firstpage and nextpage is printed.

I only want the faxpage to be added if it is a fax that is beeing sent. so i call the smartform FM once to get the fax page then call it again to get the normal pages and put these in a PDF file. But only the call to the FM works and the fax page is not included. I also tried to try to only get the fax page out but was unable to do so.

The Faxpage is at the bottom of the list on the left, I do not know how to see what page number it is on

Former Member
0 Kudos

Lisa,

Here is what you can do.

Whether or not u require ur fax page we will call the smartofrm only once.

Since you require the fax page, only when sending faxes.

Make the fax page the first page in the list.

Set the next page of the fax page to the remaining page(s).

Now in your abap program.

Set the following logic.

if print_fax_page = yes.

tdpagesselect = '1-'.

else.

tdpagesselect = '2-'.

endif.

This way the fax page will print only when u need it.

i dont remember the exact spelling of tdpagesselect variable.

remember that fax page must be the first page in ur smartform list

This will solve the issue.

Former Member
0 Kudos

Hi,

Now only the faxpage comes out even if i use '1-' or '2-'.

Best regards

Former Member
0 Kudos

have u set the next page of ur fax_page to the page u need to print next?..

if yes paste ur FM call and output_options here and we'll go thru it

Former Member
0 Kudos

Hi,

Now i get both the faxpage first page even if i have the page at 1- or 2-.

Best Regards

Former Member
0 Kudos

Ok

Now atleast we are getting all pages.

The only issue now is that tdpgslct is not being recieved by the SF

Please paste the following here so we can look at it

1. The code where u modify output_options (tdpagslct)

2. Your function module call.

Former Member
0 Kudos

data my_output_options like is_output_options.

my_output_options = is_output_options.

IF fax = 'X'.

my_output_options-tdpageslct = '1-'.

else.

my_output_options-tdpageslct = '2-'.

ENDIF.

CALL FUNCTION lv_function_mail

EXPORTING

control_parameters = ls_control_param

mail_appl_obj = is_mail_appl_obj

mail_recipient = is_mail_recipient

mail_sender = is_mail_sender

output_options = my_output_options "is_output_options

iv_bus = bbppd_po

iv_po_header = ls_sf_po-header

it_longtext = ls_sf_po-it_longtext

is_partner = ls_sf_po-vendor

IMPORTING

document_output_info = ls_document_output_info2

job_output_info = ls_job_output_info2

job_output_options = ls_job_output_options2

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

This enoght?

Former Member
0 Kudos

Lisa ,

Everything looks fine.

This may be a silly.

But please check if your variable fax has indeed 'X' and not some other value

i.e check to see what goes into my_output_options-tdpageslct

I have used this code many times before it it works great

Former Member
0 Kudos

Hi,

I have debugged this and i have hit both situations and the pageslct was once 1- and once 2- and the faxpage and the firstpage came out both times.

best regards

Former Member
0 Kudos

Ok Lisa,

This was the easiest way this could be done so I preferred it.

Also im sure the fax page probably is a fax cover page and should be the first page in the print. There is obviously some disconnect .

However, another way to do this is....

Rturn the fax page to the last in the list in your smartform.

In your main window, as the last node, add a COMMAND node.

set Go To Page as fax_page

and put your FAX variable value as a condtion in the command.

This is so that the command be executed only for fax pages.

Dont change the next page of your first or next page .Do this only in the COMMAND node

Also this will work only if u have only a first and next page in ur smartform(besides ur fax page) and both these have the main window.

The Fax_page can have the next page as itself.

Message was edited by:

Nehal Fonseca

Former Member
0 Kudos

hi again,

I havent tried this yet but wont that result in the fax page at the back, we want the fax page to be the first page the see when the reciever recieve the fax.

We have other solutions in our R/3 system that use the first method i used where we open the smartform and pull out the fax page then call the smartform again for the normal page and this works fine. But in this new SRM system it does not work and im lost for words why not, but then again not alot works on this system >.<

Ill try this but the order the pages are to come in are very important im afraid...

Best regards

Former Member
0 Kudos

Lisa,

looks like u have to try the same old way or the option 2, for why its not working

look at this link .

Former Member
0 Kudos

okay, now i am really confused, maby i should find out if i am changing the code in the right place because i have just commented the calls out and the form is still beeing printed.

so looks like i changing at the wrong place.

Former Member
0 Kudos

hahaha

its quite obvious

that the smartform is not being called by the driver program ur editing.

When uve found the right program, use the TDPAGESSLCT. it will work

Former Member
0 Kudos

Hey Its done finally... great,

What was the issue..

Former Member
0 Kudos

As the program i was editing sends the smartform as at email i found A FM that looked like the one that made the smartform.

What i dident know was that the FM i was changing was the Smartform for the email and not the invoice.

i found out that the FM just above the one i was changing was the one that made the invoice so i did as you said and it work as it should.

So thank you for that.

Former Member
0 Kudos

Thats cool Lisa,

Alls well that ends well.

Kind Regards,

Nehal Fonseca

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you for your help this worked when i finally found the right FM 😜