Display a contents of a table on SmartForm with LOOP

There's a DDIC Table called "Ugyfel" containing 5 rows.  I'd like simply to display all the rows on a SF's Main window.

Please follow this process to display the value from your table "Ugyfel"

1.   Go with a transaction code : smartforms
2.   Enter the form name like : ysmart_forms1
3.   Create
4.   Enter the Description for the form
5.   From the left side window there will be a form interface to provide table .....
6.   Go for tables option
7.   ugyfel like ugyfel(ref.type)
8.   Pages and window---> page1---> main window
9.   Go to the form painter adjust the main window.
10. Select main window and right click --> go for create loop
11. Name: loop1, desc: display loop.
12. Internal table ktab into ktab.
13. select loop right click -> create a text
14. name  : text1,  desc: display text.
15. Go to change editor.
16. Write the mater what ever you want and if you want to display data from the table write the table fields as follows:

&ktab-<field1>&    &ktab-<field2>&

save  & activate then execute ,, scripts will generate a function module  like : '/ibcdw/sf0000031' copy this function module and call in executable program...

For that
1.  go with abap editor se38.
2.  table: ugyfel.
3.  parameters: test like ugyfel-<field1>.
4.  data itab like ugyfel occurs 0 with header line.
5.  select * from ugyfel into table itab where field1 = test1.
6.  call function '/ibcdw/sf0000031'
7.  tables
     ktab = itab.

Save and activate the program ( ^f 3).

Now run the program ( f 8)

ALL THE BEST.

SmartForm Tips by : Maheshkumar Gattu

Get help for your ABAP problems
Do you have a ABAP Question?

Fast Links:
ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

ABAP Programming Tips
ABAP Forum for Discussion and Samples Program Codes for Abapers

Smartforms Tips
SAP Smartforms Tips and Tricks

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.