02-13-2015 9:36 AM
Hi all,
I have this requirement:
I have to create a smartform that prints four pages with different layouts for every item of the internal table.
I tried to use command 'new page' under loop but it doesn't work fine.
I found several discussion about similar topic, but it seems no one with reference to pages with completely different layout.
Please, could someone help me ?
Regards.
02-13-2015 10:28 AM
it_tab1 having unique IDs. "Say unique Classes
it_tab2 having whole records. "Say students details
In smartforms,
Loop it_tab1 into wa1. "Element LOOP
Element TABLE with it_tab2 , In where condition pass wa1-class.
COMMAND1 next page 2
Element TABLE with it_tab2 , In where condition pass wa1-class.
COMMAND2 next page 3
Element TABLE with it_tab2 , In where condition pass wa1-class.
COMMAND3 next page 4
Element TABLE with it_tab2 , In where condition pass wa1-class.
endloop.
02-13-2015 9:47 AM
Hi Paolo.
Use COMMAND in smartform and mention the next screen.
Regards
Sreekanth
02-13-2015 10:09 AM
Hi Sreekanth,
thank you for your answer.
I use command "New page" to page2 under LOOP in page1, and It work fine; the problem is that the for the fist page is printed only for the fist item of the internal table, for all other items only page2 is printed.
Regards.
02-13-2015 10:18 AM
Hi Paolo,
Do u want to display the same item in four different pages?
for ex : if internal table have 3 records 12(3*4) pages will be there?
Regards
Sreekanth
02-13-2015 10:25 AM
Hi Sreekanth,
Yes, this is the scenario
My table:
VENDOR1
VENDOR2
VENDOR2
The output should be the output
Page1 - VENDOR1 - Master data
Page2 - VENDOR1 - Bank data
Page3 - VENDOR1 - Custom data
Page1 - VENDOR2 - Master data
Page2 - VENDOR2 - Bank data
Page3 - VENDOR2 - Custom data
Page1 - VENDOR3 - Master data
Page2 - VENDOR3 - Bank data
Page3 - VENDOR3 - Custom data
Regards,
Paolo
02-13-2015 10:33 AM
HI,
Can u share the smartform element arrangement. Take a snap.
Regards
Sreekanth
02-13-2015 10:40 AM
Hi,
this is my actual smarforms, I'm working on a Vistual Machine I hope you can see the image
Regards.
02-13-2015 11:00 AM
Main window is acceptable only for Page 1. For other pages just design as u want with secondary windows.
For your understanding from the position where u called COMMAND, content of main window break and continue from the called page.
Try by add a new COMMAND1 (call page 1) before COMMAND2 (call page 2). Give condiotion
sy-tabix <> 1 for COMMAND1. "To prevent the execution of COMMAND1 at first time.
02-13-2015 10:28 AM
it_tab1 having unique IDs. "Say unique Classes
it_tab2 having whole records. "Say students details
In smartforms,
Loop it_tab1 into wa1. "Element LOOP
Element TABLE with it_tab2 , In where condition pass wa1-class.
COMMAND1 next page 2
Element TABLE with it_tab2 , In where condition pass wa1-class.
COMMAND2 next page 3
Element TABLE with it_tab2 , In where condition pass wa1-class.
COMMAND3 next page 4
Element TABLE with it_tab2 , In where condition pass wa1-class.
endloop.
02-13-2015 11:37 AM
Hi,
Hope you are printing same contents in different layouts.
Try,
print all table contents in one layout first by using loop statement, then goes to next layout page by adding conditions ie: internal table line count EQ sy-tabix then goto to next page layout, follow the above process for third and fourth layout.
Hope it helpful,
Regards,
Ramesh.V
02-13-2015 11:57 AM
Hi all,
thank you again for your help; this is an example of my code now.
It seems these is a problem when calling the page2 due to "overflow of non main window" but
the window size in page2 is compliance with the fields to print.