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: 

how to give loop to the template

Former Member
0 Kudos

hello,

i had created smartform, in that i had created the template. Now the driver program had passing two records. But the template at a time will process the one record. So can we please specify how to loop into internal table which is coming into smartform from driver program. I had check in the driver program the internal table conatins two record but at the time of execution ie after passing to smartform it is taking latest record ie second record.

11 REPLIES 11

varma_narayana
Active Contributor
0 Kudos

Hi..

Template is not the Right node for this bcoz it will display only Static values.

Create a <b>Table Node</b> where you the Option to Loop the Internal table and Display.

<b>Reward if Helpful.</b>

former_member588853
Active Contributor
0 Kudos

HI,

Let me say the clear picture..

Let us take the table below

Fields:

matnr werks lgort -


This is the template static value

1001 09 1001 -


This is an internal table

1003 09 1001

Template just takes static values you cannot loop into it..

please define a table by right click and pass the values.

rewards if useful,

regards,

nazeer

Former Member
0 Kudos

Hi,

Template is not used for looping purpose . U can use tables in place of templates .

Or

If it is mandatory for u to use loop in template . Then put the template inside the loop in smartform .

Regards

0 Kudos

Hi Neetesh,

I did the same ie. first i had created the loop and inside that loop i had put the template. But the problem is both the records are coming on one page. I want to display on per page the single record.

Can you please help me to do this.

thanks

Former Member
0 Kudos

I think ur problem can be solved only by creating table.

You can not display variable no of records using template.

Either use table. Or u can do one thing create a loop and then under that loop u can keep ur template.

0 Kudos

Hi suman,

I did the same ie. first i had created the loop and inside that loop i had put the template. But the problem is both the records are coming on one page. I want to display on per page the single record.

Can you please help me to do this.

thanks

0 Kudos

Hi Darshana,

For every record in your internal table, trigger the NEXT-PAGE event.

I mean there is a node for triggering next-page, based on few conditions.

Best Regards,

Ram.

0 Kudos

Hi ram,

how to trigger the next-page based on the condition.

Please help me to solve this.

Thanks

0 Kudos

Hi Darshana,

There is a node called "COMMAND".

Create the command node just before the end of the loop after you print the template. In this you have an option called "GO TO" where you can set it to next page.

Best Regards,

Ram.

0 Kudos

Hi Ram,

I had created the command, but there is only one page selected and it is giving error -%COMMAND1 No new page allowed in secondary window.

I had created like this PAGE-WINDOW-LOOP-TEMPLATE. There is no main window.

Please help me to do this

0 Kudos

Hi darshana,

I guess you need to have MAIN window.

Try introducing a MAIN window and two pages.

Trial and error would definitely help you solve the issue.

Best Regards,

Ram.