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: 

regarding smartforms

Former Member
0 Kudos

hi experts,

i have an assignment like this,i need to develop an smartforms in which

employees details will come page wise means for first employee the details will come

in the first page for second employee the details will come in the second page

like this i need the outptut ,here i need to use templates plz let me know how will

i proceed in smartforms as well as in the driver programs....

if possible plz send ur codes as i m new to smartforms.

1 ACCEPTED SOLUTION

former_member262988
Active Contributor
0 Kudos

hi,

yes no need to create one more page....sae page you can set...

10 REPLIES 10

Former Member
0 Kudos

Hi,

Since you will have multiple employees printed together, then use a loop at the top then put all your templates, tables etc inside. The LOOP element will be assigned an internal table which will have the employee information. If you need to display further details like salary then use a TABLE element inside the LOOP element.

Why we need to use LOOP at the outer side, because LOOP can contain a table but a table cannot.

Secondly to print each employee on a separate page insert a COMMAND element inside LOOP in the last. so when all information is printed system will issue a page break.

set the COMMAND to send a page break.

pls reward points .

and reply for further help.

0 Kudos

hi habib,,

thnx for the reply,

here i need some confirmation from your side here there is no need to define second page etc,the first page is sufficient

and in the main window i will put the first loop rt sir....

0 Kudos

yes u will specify the same page as the next page, and yes the loop will be the first thing.

inside the loop you will create multiple text elements. in this you will put the fields for e.g

if your LOOP has table ITAB and work area WA with field PERNR as employee number, then in the text element you will write as follows

&WA-PERNR&

like this you will create multiple elemetns for each information like name etxc.

Edited by: Khusro Habib on Jul 29, 2008 7:13 AM

Former Member
0 Kudos

ravi,

In driver programme put this logic.

take employee no in internal table.

loop on internal table.

with in loop write this statements.

loop.

AT FIRST.

CONTROL_PARAMETERS-NO_CLOSE = 'X'.

ENDAT.

AT LAST.

CONTROL_PARAMETERS-NO_CLOSE = SPACE.

ENDAT.

CALL FUNCTION ( smartform )

CONTROL_PARAMETERS-NO_OPEN = 'X'.

endloop.

pass employee no in your smartform. design your smartforms for single employee only.

former_member262988
Active Contributor
0 Kudos

hi,

write the driver program in se38 ......with taking an internal table with the details of all employees for your selection.......

in the driver program itself call ssf_function_module ........and pass the internl atable to this FM .......sort the table by employee number

now create a smartform ......with one page...desgin the page as per your requirement.....

in the mail window create a loop (assgin the tAable ....to it which has been passed from driver program....)

inside the loop create at new (down you will see ) and put the employee number field.....

next inside the loop create a command ...and put a new page(call) ...

new page will trigger automatically for each employeee.

0 Kudos

hi sahilja thnx for ur help,

plz explain this in details as i m new to smrtforms,,,

"inside the loop create at new (down you will see ) and put the employee number field....."

former_member262988
Active Contributor
0 Kudos

hi,

yes no need to create one more page....sae page you can set...

Former Member
0 Kudos

hi ravi,

You will need to use loops along with template.In the loops use the AT BEGIN OF 'emp id' & make sure that the next page is the same page..

There would not be much coding..

Best of luck,

Bhumika

former_member262988
Active Contributor
0 Kudos

hi,

when you create a loop .......under the same ...you will see sort criteria....field name....there you mention the field name(employee number)and select the check box event on sort.....

next create the command(by rt click....)check the new page check box.....(give the page from drop down)..

Former Member
0 Kudos

Hi,

In your smart form if you are using loop node you have option of sort criteria.... give your employee number and select check box under event on sort before... it works same as at new command ...

You get separate event node displayed under the loop node...

create a command node and text element or template node under the event and another text node or template after the event...

make sure you place the text element after the command node.... In your command node check the new page checkbox and give the name of the next page (it can be the same page name also) and also in the conditions tab check the checkbox not in first page...

this would definitely solve your issue

regards

padma