Skip to Content
author's profile photo Former Member
Former Member

Loop at itab into smartform

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 08:00 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 22, 2008 at 08:07 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 08:14 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 08:35 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 09:02 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 10:21 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 .

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 10:51 AM

    Thank you, it works now.

    Diana

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.