2015 Feb 02 5:34 AM
Hi,
In my requirement am having two different pages first page is challan and second page is jj the values from first
page internal table same as second page.first page may be data overflow it contains matnr field (table) so some times data overflow
to next page.But the second page is always constant (single page) the values are just address fields so it is fetched from
first page itself.
Here issue is if internal table itab[] = 1 value means two page is printing correctly.
suppose internal table having 2 or more values means ,
itab[] = 2 means total 4 pages we want, itab[] = 3 means total 6 pages we want,
itab = 2 means it displaying 3 only second page( jj )form is not changing and printing first page correctly based on looping.
i put loop on second page also..but second not printing multiple times based on loop.
May i know what reason??????i want to display page1 page2 for one value
next time page1 page2 for second value....Anyone suggest?????
Hi,
In my requirement am having two different pages first page is challan and second page is jj the values from first
page internal table same as second page.first page may be data overflow it contains matnr field (table) so some times data overflow
to next page.But the second page is always constant (single page) the values are just address fields so it is fetched from
first page itself.
Here issue is if internal table itab[] = 1 value means two page is printing correctly.
suppose internal table having 2 or more values means ,
itab[] = 2 means total 4 pages we want, itab[] = 3 means total 6 pages we want,
itab = 2 means it displaying 3 only second page( jj )form is not changing and printing first page correctly based on looping.
i put loop on second page also..but second not printing multiple times based on loop.
May i know what reason??????i want to display page1 page2 for one value
next time page1 page2 for second value....Anyone suggest?????
2015 Feb 02 5:46 AM
Hi Anitha,
You can overcome this problem by using COMMAND .
Using you can achieve page break.
Regards,
Dular Sharma.
2015 Feb 02 5:54 AM
Hi Anitha,
Please mention NEXT_PAGE property of PAGE2 as PAGE1.
Regrads,
Vijay
2015 Feb 02 5:56 AM
Hi thanks for your repli,
Just now i changed NEXT_PAGE property of PAGE2 as PAGE1 but 4 page is displaying
and the 4 th page is blank .
2015 Feb 02 6:10 AM
Hi Anitha,
can you post screen shot of your smartform hierarchy.
2015 Feb 02 10:39 AM
Hi,
In page1 - general attributes page1.
1)main window
2)loop at itab
3)code: N = n + 1.
4)command go to new page page1. conditions N > 1.
"""""""""""""""under loop.
After the loop.
code:
describe table ITab lines lv_lines.
LOOP AT ITab
lv_count = lv_count + 1.
IF lv_count = lv_lines.
lv_flag = 'X'.
ENDIF.
endloop.
4)command go to new page page2. conditions lv_flag = X.
In page2 - general attributes EMPTY.
SECONDARY WINDOW CONDITION LV_FLAG = X.
LOOP ITAB.
ENDLOOP.
IF I GIVE PAGE 2 GENERAL ATTRIBUTES AS PAGE 1 MEANS EMPTY PAGE IS APPEARING.
2015 Feb 02 10:44 AM
Hi Anitha,
In PAGE2 which type of Window have you used? If it is MAIN window change it to Secondary.
But it would be better you post screen shot.
Regards,
Vijay
2015 Feb 02 10:48 AM
Otherwise,
Place the COMMAND element in loop and set NEXT_PAGE as PAGE1 for page2. Remove code and conditions on the windows and Command. Do not use any conditions.
PAGE1
MAIN WINDOW
TABLE LOOP
MAIN_AREA
<DATA>
COMMAND (for page2).
PAGE2 (next page as 1)
SECONDARY WINDOW
<DATA>
Try as above.
Regards,
Vijay
2015 Feb 02 10:54 AM
2015 Feb 02 11:11 AM
Hi,
Now i set page 1 next page as page2.
then loop
command-----go to new page page2
main window
table
command
then page2 next page as page1.
secondary window go to new page page1
loop.
templates.
Now also not working???
2015 Feb 02 11:15 AM
Anitha,
I am sorry, I am not able to understand your hierarchy.
-Vijay
2015 Feb 02 11:05 AM
Hi,
you can use template on the place of internal table.
because size of template will be static and it will not affect second page.
otherwise command will be best option to use.
thanks
2015 Feb 02 11:07 AM
Hi,
Thanks for your repli.In second page am using templates only.It is the reaso it is not affecting second page.??Otherwise how can i give in command??
2015 Feb 02 11:10 AM
Have you tried with hierarchy I specified/mentioned above?
If so, what happened?
-Vijay
2015 Feb 02 1:12 PM
Yeah thanks,
By your code now it is displaying correctly but last one empty is displaying???
2015 Feb 03 3:40 AM
Hi Anitha,
So now if table is having 3 records, whether are you getting 6 pages and a blank or 5 pages + blank?
I think you are getting 6 pages + a blank. If so, this is because of NEXT_PAGE property of %PAGE2.
After three 3 records processed in the table again PAGE1 will be triggered. That to be handled.
Regards,
Vijay
2015 Feb 03 4:36 AM
Thanks for your repli,
Yeah its only happening 6 pages + blank..next page as page1 i put.
but next page as page 2 means no values are displaying.
2015 Feb 03 4:41 AM
Hi Anitha M,
In your command you have to add a condition like this.
Sy-tabix <> 1.
With regards
Arun VS
2015 Feb 03 4:47 AM
Yeah thanks for your reply,
In page1 am having command node but sy-tabix <> 1 is not working???
page2 general properties as page1 here.
2015 Feb 03 4:57 AM
Anitha,
Try as below. I hope works out.
In 'Global Definitions' - 'Initialization' tab find number of records and count the pages required.
DESCRIBE <TABLE> LINES <VARIABLE>.
COUNT = VARIABLE * 2. " Here COUNT defines number of pages to be printed.
Now place the condition for 'Main Window' in %PAGE1 as 'IF SFSY-PAGE <= COUNT.
Regards,
Vijay
2015 Feb 03 5:51 AM
2015 Feb 03 6:28 AM
As a final,
Declare a variable (say as G_FLAG) in 'Global Definitions'.
Add 'PROGRAM LINES' before COMMAND in Main Window. In that increase the count (no.of times triggered).
G_FLAG = G_FLAG + 1.
Now change the condition on 'Main Window' as G_FLAG <= COUNT.
I wish this should close the issue.
Regards,
Vijay
2015 Feb 03 6:40 AM
Hi Anitha,
Where you are giving the command ? Is it on the beginning the n you can try the command sy-tabix <> 1 over there.
With Regards
Arun VS
2015 Feb 03 2:24 PM
Hi Anitha,
Have you tried as I mentioned in my last comment??
-Vijay
2015 Feb 06 4:37 AM
2015 Feb 06 5:40 AM
2015 Feb 06 6:41 AM
2015 Feb 06 5:31 AM
Hi Anita,
I guess your requirement is Page1 & page2 should get displayed for each record.
If this is therequirement, you can have the below hierarchy,
Page : 1
Loop on the Records table( lets say It is ITAB[] )
- main window
- table
- transfer the data in other fields which you want to display on 2nd PAGE.
- command-----go to new page page2
endloop.
Page 2:
- secondary window - In this window u can display the data you are getting from page1
- command - go to page1 - (Note - as your no. of pages should be double the no of recordes, create a variable which will have the no of pages E.g. if 2 records , 4pages..save this value in this variable and use this as a condition in command on 2nd page - as only call 1st page where SFSY-PAGE < COUNT.
Hope this will work!!!
Award points if Helpful!!
Thanks!!