cancel
Showing results for 
Search instead for 
Did you mean: 

Loop at itab into smartform

Former Member
0 Kudos

Hello All,

I have a smartform that has an internal table as input parameter. I want to print on smatform some text for every line of this internal table.

For example, if my internal table contains:

ZNR ZDATE ZNRDAYS

1 10.12.2007 15

2 01.02.2008 7

3 08.09.2006 34

I want in smartform to print:

For the number 1 the start date will be 10.12.2007, available 15 days.

For the number 2 the start date will be 01.02.2008, available 7

days.

For the number 3 the start date will be 08.09.2006 , available 34 days.

How can I make this?

Thank you in advance,

Diana

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Thank you, it works now.

Diana

Former Member
0 Kudos

Hi,

I've created a loop node and a text child-node for it.

My loop is at ITAB into WA_ITAB and in the text node I try to get WA_ITAB-ZNR and so on...

But I get an erros when I run the smartform. It says that my internal table doesn't exist or is not declared. But I have declared the internal table in the Global Definition. I have it also in the Tables (because I get it as input parameter).

What shoul I do?

Thank you,

Diana

Former Member
0 Kudos

Declare your itab in form interface-> tables tab.

parameter name -> as itab type assignment as -> like and associated type as-> standard table name.

and in ur interface program in smartform function module please declare your table .

Former Member
0 Kudos

hi,

If you are using loop node... then create a text node after the display of internal table data and hardcode the stmt with the insertion of internal table fields wherever required.

if you are using table node... then create a line type with single cell... and add this line type in the main area of the table node and do the hard code of the stmt with the internal table data

or

if you dont want to add any new line type or text node... then you can try this... after the display of data in the text node write the part of the statement just below the internal table field

eg.

&itab-data1&

For the number &itab-data1&

here both the statements are in the same text node

regards

padma

Former Member
0 Kudos

Hi Diana,

Create the table in the mainwindow with cells:

znr zdate znrdays.

For znr :

create the program lines:

znr = znr + 1 .

In global defintions declare withe variable znr and default value 0.

Drag and drop the fields in the text node.

Regards,

Sravanthi

Former Member
0 Kudos

Hi,

In smartform, create a 'table line' and in 'data' tab give the internal table details in 'loop at' column.

Then you will have the data in work area and then print the data as needed.

Thanks,

Parul.

former_member585060
Active Contributor
0 Kudos

In MAIN Window under Tables Node, Main Area

Goto Text where you assign Table fields

Add the text just before the corresponding fields

Ex:-

Cell1

Text1

For the number &ITAB-NUM&

Cell2

Text2

the start date will be &ITAB-DATE&

Cell3

Text3

, available &ITAB-DAYS& days.

Former Member
0 Kudos

After you loop at your internal table, you need to populate the field name in a text element. so in your text element print this way

For the number &itab-<1>& the start date will be &itab-<2>, available &itab-<3 >,days.

So here say youa re looping at t_itab into i_itab and your <1> ,<2>,<3> are fields that you fetch.

This will work.