cancel
Showing results for 
Search instead for 
Did you mean: 

smartform with multiple page output

Former Member
0 Kudos
145

Hi all,

I have to generate an output letter for each customer using smartform .In the report program I am fetching the customer data and I am populating the data into an internal table say ts_customer. i.e ts_customer will contain the data of all the customers in case of multiple customer output. Suppose ts_customer contains 3 records corresponding to 3 customers.But when I am executing the program only the smartform output corresponding to the first customer is getting displayed i.e only one page is getting displayed.As of now I am looping the table ts_customer in the report program. Is it possible to loop the table ts_customer from within the smartform so that the letter corresponding to each customer will be displayed.

Thanks & Regards,

Neethu.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Neetu,

I guess You declared 2 second page if not declare it..or else

Have You declare the table in main window..if so,

Loop the your final Internal table...with SF...I mean

Loop at ts_...

call Fucntion 'SSF_-----'

end loop.

Try it...

regards,

sg

Answers (5)

Answers (5)

Former Member
0 Kudos

problem solved

Former Member
0 Kudos

Hi,

In the initialazition tab copy the data of ts_customer into anther internal table like as follows.

data:it_cust type table of ts_customer.

it_cust[] = ts_customer[].

sort it_cust by kunnr.

delete adjacent duplicates it_cust comparing kunnr.

now your internal table contains no duplicate kunnr.

first loop the it_cust.

then loop the ts_cust where kunnr = it_cust-kunnr.

after this loop create a command node

select the go to and give the next page .

now it will give multiple letters for each customers.

Tnks,

NN.

chaithanya_mk
Participant
0 Kudos

Hi Neethu,

The best solution for this kind of requirement is to add loop inside the smartform and not in the program.

To do this follow the below steps:

1) Declare your Internal table in Form Interface.

2) Declare a work area in Global Definations

3) Add a loop above the window which you want to print.

4) On the Data tab of Loop node enter ts_customers into wa_customers.

Now try to execute your transaction the test it.

Finally, dont forget to give Reward points.

Cheers,

Chaith.

Former Member
0 Kudos

Hi Chaith,

I want to print the data in the main window.

I have created the loop inside the main window node.

But how to create loop above the main window node??

We can create loop only under window node right???

Thanks & Regards,

Neethu.

Former Member
0 Kudos

what ure doing is fine for now

ure right u cannot have a loop outside a window..

the issue is something else

chaithanya_mk
Participant
0 Kudos

Hi Neethu,

Under the main window create the loop and under the loop put your text elements on which you can print the data of ts_customers.

Cheers,

Chaith.

Former Member
0 Kudos

have u also checked in page Attributes

what is setas Next Page

Former Member
0 Kudos

yea i have done that .

but still output is getting generated only for one customer

Former Member
0 Kudos

Hi

U created a table regarding customer ts_customer.

u mention loop (table to wa)in the data tab of the table painter.

In order to go to next page use command node at the end of the table.In the command node check the option Go to new page. Give the default page1 only to it in that.

Then it will trigger new page....

it will work surely...... if not get me back,i will give the solution.

thnx

sravani

Plz reward points if helpful..

Former Member
0 Kudos

Hi ,

I declared the table ts_customer in the form interface parameters.

I am fetching the data in the report program and passing it to the form via the form interface.And in the main window I have created a loop.

i.e loop at ts_customer into wa_customer.

and I am displaying &wa_customer-kunnr&, &wa_customer-kunn2& etc in text elements. At the end of all text elements I have created a command & given go to new page Page1 and also in the command conditions I have checked the check box Only After End of Main Window. But this is not working.Even if I give multiple customer only the page corresponding to the last customer is getting displayed.

I think its overwriting. Please give the solution.

Thanks & Regards,

Neethu.

Former Member
0 Kudos

Why have u checked only after end of Main WIndow

Please uncheck that

Dont u want a new page for every customer?

also check what is the next page of your page 1

set it to page 1 in page Attributes

Former Member
0 Kudos

Hi,

I have unchecked the check box but still not working.

Thanks & Regards,

Neethu.

Former Member
0 Kudos

Hi

U told that u have created the table in the main window.

After th e end of the table u create command and check the option Go to new page...and give ur default page.

U first uncheck the option only after the end of main window.

thnx

sravani.

Former Member
0 Kudos

Hi ,

U have to use page breaks . Once all the details related to a particular customer are printed then use page break using command to display the next customer details in next page .

Regards

Neetesh

Former Member
0 Kudos

Hi,

how to use page breaks??

I have created a command in the main window & given go to new page.

But its not working.

Thanks & Regards,

Neethu.