Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms - Print 4 pages with different layout under loop

Former Member
0 Kudos

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.



1 ACCEPTED SOLUTION

former_member202818
Active Contributor
0 Kudos

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.

10 REPLIES 10

former_member202818
Active Contributor
0 Kudos

Hi Paolo.

Use COMMAND in smartform and mention the next screen.

Regards

Sreekanth

0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

HI,

Can u share the smartform element arrangement. Take a snap.

Regards

Sreekanth

0 Kudos

Hi,

this is my actual smarforms, I'm working on a Vistual Machine I hope you can see the image

Regards.

0 Kudos

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.

former_member202818
Active Contributor
0 Kudos

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.

VenkatRamesh_V
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.