cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while printing second page

Former Member
0 Kudos

Hi Experts,

I have been caught in some strange problem.

I have an smartform, where i want to print two different pages.

I do not want to print MAIN window of first page into second page.

But i am not able to print second page.

I want to print both pages irrespective of data in main window.

It goes to second page only if data is not accoodated in first page, which i do not want.

If data is not accomodated in first page then it shoud print rifst page format only.

Then last page as second page format.

I have tried it by giving page break in command line.

But it is not working.

Hope i am making you all proper understand my question.

Thanks in advance,

Pratik Vora

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

1) Go to first page settings remove the next page as second page and replace it with first page itself.(this means if the main window exceeds it calls the first page again and fills the data in the main window of first page)

2) As you do not need main window in the second page remove it( I think that page maight be a text page like terms and conditions) Design the page as u required.

3) Now go to first page main window and then create a command node under it and select the check box go to page and select the next page as second page.(Note: this command node should be after alll the nodes in the main window)

4) By this after finising the data in the mainwindow it calls the second page.

Thanks,

Nethaji.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Create 2 pages then give Next page for Page as 'Page 1 Name' & next page for Page 2 as 'Page 2 Name'.

U declare a FLAG variable to trigger the second page & declare another 2 variables for Counting No of lines in the table & for a counter in the LOOP.

Now, U LOOP ur Internal table, Print all the line items & increase the counter value in the LOOP for every line item printing.

Now, write a condition in the LOOP, IF both LV_COUNT = LV_LINES, create COMMAND 'Go to New Page' 'page 2 name' and give LV_FLAG = 'X' in condition tab of the COMMAND..

eg:

data : lv_count TYPE i,

lv_lines TYPE i,

lv_flag.

describe table itab lines lv_lines.

write the below code lines in Main window:

LOOP AT itab.

lv_count = lv_count + 1. ---> Counting the Line items in the LOOP

IF lv_count = lv_lines.

lv_flag = 'X'.

ENDIF.

Now, create a COMMAND, 'Go to New Page', give lv_flag = 'X' in Condition tab of the COMMAND.

ENDLOOP.

Hope it works!!

Rgds,

Pavan

Former Member
0 Kudos

you might want to search the forum, cause this problem has been solved a LOT of times.

actually right now we got a thread on same page as your answer, just about this topis....

have a look if thats enough, if not search the forum you will get lots of more info.