cancel
Showing results for 
Search instead for 
Did you mean: 

How to control page printing in smartforms

Former Member
0 Kudos

Hi Experts

I have a print program and smartforms that will print a letter in Page 1 and a form in Page 2.

I created a checkbox that suppose will control the printing of Page 2.

If its untick, Page 2 will not be printed.

I have pass the checkbox parameter from print program to smartforms but I dont know where to put the printing condition.

Is there any suggestion?

Thanks in advance.

az

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi,

If you create a command line in one page, it will be present in all the pages.

The reason is command line will be present in MAIN window only.

Let me know if you are still not able to solve the issue.

Regards

Madhu G S

Former Member
0 Kudos

Hi Madhu.

My smartform is printing 2 thing, a letter and a form. These 2 item is printed using same print program and smartform. I put the letter as first page without Main Window, because this letter is not going to be more than one page. While the form I put as second page and next page with Main Window because this form might have more than one page.

So according to your advise I need to add Command in Main Window in the first page.

The thing is, I dun have Main in first page. And when I created it, its giving me error when I execute it.

Please advise..

Thanks

az

Former Member
0 Kudos

Hi,

The problem may be with the command line in the second page.

You can try this.

In the command line you can check for a flag with the check box variable,

ie

v_check = X

v_flag = 0 (v_flag is a global parameter)

In your first page after the command line put a program logic and inside that set fv_lag varible to 1.

This is to make sure command line does not execute from second page.

Regards

Madhu G S

Reward points if usefull.

Former Member
0 Kudos

Hi

Is it that I need to create command in both pages?

I created only in Page 1

Thanks

az

Former Member
0 Kudos

Hi,

You can put a command lineonly in your main window.

right click on any row of the main window.

Add a command line.

Tick the check box in the command line and it asks u for the next page.

Also in the command line's condition check wether check box is ticked.

Also put next page of first to first only

and next page of second to second only.

Regards

Madhu G S

Reward points if usefull

Former Member
0 Kudos

Hi Madhu

My Page 1 doesnt have Main Window, Only Secondary Window.

I changed the secondary window which contain the Command to Main.

It is successful when I activate but I encounter an ABAP dump.

Short text

Exception condition "ERROR" raised.

What happened?

The current ABAP/4 program encountered an unexpected

situation.

Error analysis

A RAISE statement in the program "SAPLSTXBC" raised the exception

condition "ERROR".

Since the exception was not intercepted by a superior

program, processing was terminated.

Short description of exception condition:

For detailed documentation of the exception condition, use

Transaction SE37 (Function Library). You can take the called

function module from the display of active calls.

Any idea regarding this?

Thanks

az

former_member196280
Active Contributor
0 Kudos

Place command in your first page, write you condition in your command window and goto general attributes tab of command and tick the check box, goto new page.. this will help you to goto the new page in smartform.

Also make sure you change the next page attribute of your first page to second.

close the thread once your question is answered.

Regards,

SaiRam

Former Member
0 Kudos

Hi SaiRam

Thanks for your reply

I've created new window in Page 1 and put my condition in the Condition tab.

And then created command, ticked on Go to New Page and set it to Page 2.

But I encounter this error "%COMMAND1 No new page allowed in secondary window"

Thanks

az

Former Member
0 Kudos

Hi

I ve tried Condition tab in Window.

I put my condition in every Window I have in the second page but it will print a blank page.

Any other idea how to solve this?

Thanks

az

Former Member
0 Kudos

Hi,

Sorry.

Condition tab is available in windows.

You should set the condition for all the windows present in that page.

Regards

Madhu G S

Reward points if usefull

Former Member
0 Kudos

Hi,

Just click on the second page.

Then go to 'Conditions' Tab (Last tab)

There you can give the condition

if check box parameter is v_check

v_check = 'X'

This will control the printing of second page.

Regards

Madhu G S

Reward Points if usefull.

Former Member
0 Kudos

Hi Madhu G S

There is no Condition tab in Page

Thanks

az

Former Member
0 Kudos

Hi Zakaria,

U can find CONDITIONS Tab in WINDOWS Node.

Best regards,

raam